Re: Re: vertical cross section with wpp output by

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri, 14 Nov 2008 13:54:06 -0700

Hi Jin-Young Kim,

The problem is that octet 28 of the GDS in this file has the scanning
mode for the lat (y) axis set to scan in the -j direction.
See http://www.nco.ncep.noaa.gov/pmb/docs/on388/table8.html

But this contradicts the fact that the la1 value is less than the la2
value, which should mean that the scanning direction
would be positive.

This octet is set to decimal 0, meaning bit 2 (counting from the
"big" end of the byte) is 0. It should, (at least if it were like all
the GRIB files
we have encountered up to now where the la1 value is less than the
la2 value) have the value 64 (binary 0100 0000).

NCL has the correct values for la1 and la2 in its attributes, but it
relies on the scanning direction to calculate the actual
coordinate values starting from la1. This means it goes away from la2
rather than towards it.
Note that wgrib does not actually calculate the coordinates. It just
gives the values of la1 and la2, which agree with NCL.
It also shows that "scan" is 0, which means that it agrees that the Y
axis scanning direction is negative.

Admittedly NCL does not check the coordinates to see whether the la2
value agrees with the end coordinate it gets and
perhaps it should. It could put out an error message that there is a
contradiction in the GDS and then favor getting the
direction by checking whether la2 - la1 is pos or neg.

But I would have to say that the grib writer that is outputting the
data is creating an incorrect GDS for each record.

As a workaround I think the correct latitude values can be obtained
for this file with the following calculation

badlat = f->g0_lat_0
latdiff = badlat_at_La1 - badlat
lat = badlat_at_La1 + latdiff

or in a single calculation:
lat = 2 * badlat_at_La1 - badlat

Using these lat values you get a good alignment with the map outlines
for the PRES_GDS0_SFC variable, so I think
this is correct.

  -dave

On Nov 13, 2008, at 3:04 PM, Jin-Young Kim wrote:

> Thanks for replying.
> Would you look at blue characters?
>
> On Fri, Nov 14, 2008 at 5:20 AM, WRF Help <wrfhelp_at_ucar.edu> wrote:
> Hi,
>
> I apologize, but I am not clear on exactly what you are saying
> here. Let me see if I can restate it to you to see if I am on the
> right track. Are you saying that when you print the lat/lon
> information from NCL you get:
>
>
> g0_lat_0 = [-8.753..-64.193]
> g0_lon_1 = [-103.249..-46.369]
>
> but those are not the values in the wrfpost grib file? What are the
> values in the grib file? (Try wgrib -V). Are you using the
> automated copygb_hwrf.txt file or are you setting the values for
> copygb yourself?
>
> Those values in the wrfpost grib file via ncl scripts.
> when i do "getfilevarnames(wrfprs_d02.00)" in ncl scripts,
> it's showing g0_lat_0, g0_lon_1 with level information.
> But when i do wgrib -V,
> it looks same as latlon: lat -8.753000 to -46.687000
> long -103.249000 to -46.369.
> I think ncl could not recognize grib information exactly.
> What do you recommend to me?
>
> I've used automated copygb-hwrf.txt file in the WPPV3.
>
>
> Or are you saying that it does not match the grid you entered in to
> start with for WPS? It will not match exactly after it has been
> put through copygb.
>
> I think grib output information is correct even though it
> postprocess with WPP.
> I think NCL could not read correct information because of WPP
> included missing values.
> It's just my opinion.
>
>
> I still see you have those stripes running through your image.
> There appears to be something wrong with your run. Have you looked
> into that?
>
> --wrfhelp
>
>
> About results,, i'm still look at with other person..
> Thanks
>
> Best regards,
> Jin-Young Kim
>
>
> On Thu, 13 Nov 2008 06:40:43 +0900
>
> "Jin-Young Kim" <ruwiejin_at_gmail.com> wrote:
> missed attach file
>
> ---------- Forwarded message ----------
> From: Jin-Young Kim <ruwiejin_at_gmail.com>
> Date: Thu, Nov 13, 2008 at 6:37 AM
> Subject: Re: vertical cross section with wpp output by
> To: WRF Help <wrfhelp_at_ucar.edu>
>
>
> I've used copygb for lan-lon projection. After wrfpostandgrads
> output figure
> is attached.
>
> I'm curious for latitude information when i read ncl scripts.
>
> g0_lat_0 = [-8.753..-64.193]
> g0_lon_1 = [-103.249..-46.369]
>
> so latitude is different..
> Should i think ncl wrfpost should right or not?
> Then it does not match with my configuration.
>
> How do you think about this?
> Please give me comment..
>
> Thanks
>
> Jin-Young Kim
>
>
>
>
>
> On Thu, Nov 13, 2008 at 5:34 AM, WRF Help <wrfhelp_at_ucar.edu> wrote:
>
> I have used NCL to create images after running through WPP, however
> I have
> never done vertical/horizontal cross-sections through the data so I
> do not
> have any sample scripts to send your way. One option would be to
> post to
> the wrf_users_at_ucar.edu email to see if any users have any examples
> they
> are willing to share.
>
> Are you using copygb? What type of projection are you writing out?
>
> --wrfhelp
>
> On Wed, 12 Nov 2008 10:57:18 -0700
>
> "Jin-Young Kim" <ruwiejin_at_gmail.com> wrote:
>
> Dear WRFHELP,
>
> I've recognized my problem..
>
> When i read WPP output with NCL scripts..
> lat /longitude does not match with actual latitude and logitude.
> It might be actual latitude and longitude?!
> Anyway i've been finding wrong latitude..
>
> when i check wppandgrads information,
> ctl has been check right lat/long to be able to capture correct figure
> at the correct position.
>
> Is there anybody to use WRF NMM output after WPP package..
> and draw NCL ?
> Would you send me example scripts to draw
> horizontal and vertical cross section ?
>
> Thanks
>
> Jin-Young Kim
>
> On Tue, Nov 11, 2008 at 2:54 PM, Jin-Young Kim <ruwiejin_at_gmail.com>
> wrote:
>
> Greetings WRFHELP,
> I have problem to use WRFPOST data to draw vertical cross section.
>
> 1) i would like to draw certain latitude cross section.
> so i've write with referring ncl example script..
> but WRFpost output does not applied. Would you look at red line?
>
> Here is scripts
>
> ;/opt/ncl/5.0.0_bin/bin/
> ;/opt/ncl/5.0.0_bin/bin/ncl_filedump
> ;/opt/ncl/5.0.0_bin/bin/ncl_convert2nc
> ;/opt/ncl/5.0.0_intel_9.1/bin
> ;load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>
> begin
>
>
> dir = "../DENNIS04L.2005070700/PSTP/postprd/"
>
> ifim = sprinti("wrfprs_d02.%0.2i"+".grb",ispan(24,30,6))
> ofim = sprinti("windx_d02h_%0.2i",ispan(24,30,6))
> titl = sprinti("%0.2i",ispan(24,30,6))
>
> do i= 0, dimsizes(ifim)-1
>
> grb_file = addfile(dir+ifim(i),"r")
> names = getfilevarnames (grb_file)
> print (names)
>
> psfc = grb_file->PRMSL_GDS0_MSL(:, :)
> psfc = psfc*0.01
> psfc_at_units = "hPa" ; Pa
>
> u10m = grb_file->U_GRD_GDS0_HTGL(:, :)
> ugrd = grb_file->U_GRD_GDS0_ISBL(:, :,:)
> u10m_at_units = "m/s" ; m/s
>
> v10m = grb_file->V_GRD_GDS0_HTGL(:, :)
> vgrd = grb_file->V_GRD_GDS0_ISBL(:, :,:)
> v10m_at_units = "m/s" ; m/s
>
> wind=sqrt(ugrd*ugrd+vgrd*vgrd)
> ************************************************
> wks =gsn_open_wks("ps",ofim(i))
> gsn_define_colormap(wks,"gui_default")
>
> res = True
> res_at_cnFillOn = True
> res_at_tiMainString = "Wind Speed (m/s) " + titl(i) + "h
> Fcst.";title
> res_at_cnLevelSpacingF = 5. ; contour spacing
>
> ; ({700},{-30:50},{ 135:270})
> plot=gsn_csm_contour(wks,ugrd(:,{19.4:19.4},:),res) ; lattitude 19.4
> degree
> ; plot=SahdeGtContour(plot,-999,10)
> ; opt = True
> ; opt_at_gsnShadeFillType = "Pattern"
> ; opt_at_gsnShadeHigh = 100
>
> ; plot=gsn_csm_contour_shade(plot,-999,25,opt)
>
> 2) i would do inverse vertical level also.
> when i draw original data .. it stack from higher level(200mb) to
> lower level(1000mb).
> Do you know anybody this part?
>
> Best regards,
> Jin-Young Kim
> --
> Ph. D. Student
> Jin-Young Kim (jin_at_climate.pknu.ac.kr)
> Integrated Climate System Modeling Lab.
> Department of Environmental Atmospheric Sciences
> Pukyong National University, Busan 608-737, South Korea
> Web : http:climate.pknu.ac.kr/~jin <http://climate.pknu.ac.kr/%7Ejin>
>
> Visiting Scholar
> Jin-Young Kim (Jin-Young.Kim_at_noaa.gov)
> Global Systems Division
> Earth System Research Laboratory
> R/GSD7
> 325 Broadway
> Boulder, CO80305-3328
>
> +1-303- 497-4422 (Office)
> +1-303- 497-7262 (FAX)
>
>
>
>
> --
> Ph. D. Student
> Jin-Young Kim (jin_at_climate.pknu.ac.kr)
> Integrated Climate System Modeling Lab.
> Department of Environmental Atmospheric Sciences
> Pukyong National University, Busan 608-737, South Korea
> Web : http:climate.pknu.ac.kr/~jin
>
> Visiting Scholar
> Jin-Young Kim (Jin-Young.Kim_at_noaa.gov)
> Global Systems Division
> Earth System Research Laboratory
> R/GSD7
> 325 Broadway
> Boulder, CO80305-3328
>
> +1-303- 497-4422 (Office)
> +1-303- 497-7262 (FAX)
>
>
>
>
>
> --
> Ph. D. Student
> Jin-Young Kim (jin_at_climate.pknu.ac.kr)
> Integrated Climate System Modeling Lab.
> Department of Environmental Atmospheric Sciences
> Pukyong National University, Busan 608-737, South Korea
> Web : http:climate.pknu.ac.kr/~jin
>
> Visiting Scholar
> Jin-Young Kim (Jin-Young.Kim_at_noaa.gov)
> Global Systems Division
> Earth System Research Laboratory
> R/GSD7
> 325 Broadway
> Boulder, CO80305-3328
>
> +1-303- 497-4422 (Office)
> +1-303- 497-7262 (FAX)
>
>
>
> --
> Ph. D. Student
> Jin-Young Kim (jin_at_climate.pknu.ac.kr)
> Integrated Climate System Modeling Lab.
> Department of Environmental Atmospheric Sciences
> Pukyong National University, Busan 608-737, South Korea
> Web : http:climate.pknu.ac.kr/~jin
>
> Visiting Scholar
> Jin-Young Kim (Jin-Young.Kim_at_noaa.gov)
> Global Systems Division
> Earth System Research Laboratory
> R/GSD7
> 325 Broadway
> Boulder, CO80305-3328
>
> +1-303- 497-4422 (Office)
> +1-303- 497-7262 (FAX)
>
>
>
>
> --
> Ph. D. Student
> Jin-Young Kim (jin_at_climate.pknu.ac.kr)
> Integrated Climate System Modeling Lab.
> Department of Environmental Atmospheric Sciences
> Pukyong National University, Busan 608-737, South Korea
> Web : http:climate.pknu.ac.kr/~jin
>
> Visiting Scholar
> Jin-Young Kim (Jin-Young.Kim_at_noaa.gov)
> Global Systems Division
> Earth System Research Laboratory
> R/GSD7
> 325 Broadway
> Boulder, CO80305-3328
>
> +1-303- 497-4422 (Office)
> +1-303- 497-7262 (FAX)
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Nov 14 2008 - 13:54:06 MST

This archive was generated by hypermail 2.2.0 : Fri Nov 14 2008 - 16:42:12 MST