Re: Error message concerning latitude and longitude

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 13 2013 - 18:00:12 MST

Hi Stephan,
I would like to add to the earlier suggestions from our team. The coordinates in the file are 1d rotated coordinates generated by CDO (I think). They are relative to the rotated coordinate system. For plotting purposes NCL needs to know the coordinates in the standard unrotated system, but currently there is no public interface for converting the coordinates. Also there are different conventions for specifying the rotated coordinates. I am attaching a little C source code that performs the operation based on the conventions employed by CDO. It generates an ascii output file containing the lat and lon of each grid point in the unrotated system. I am also attaching the ascii output, an NCL script that uses it to create the 2D coordinate arrays that locate your data, as well as a PNG file of the graphics. I think the plot looks correct, but let us know if it is not. Hopefully we can build this functionality into NCL in the near future.
 -dave

On Dec 12, 2013, at 6:47 AM, Stephan Herrmann <stephan.w.herrmann@t-online.de> wrote:

>
>
> Hello everybody,
>
> I have calculated the mean temperature of Bolivia (1961-1970) with Climate Data Operators. The result is saved in the file: MPIM-REMO_EH5OMA1Br3_HR_044_BOL_1961-1970_167_timemean.nc. I want to plot the result with NCL and get the following error message:
>
> (0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.
> lines 1-1/1 (END)
>
> I need the plot for my diploma thesis in Meteorology.
>
> The NCL code is as follows:
>
> Copyright (C) 1995-2013 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.1.2
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
>
> ncl 0> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> ncl 1> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> ncl 2> begin
> ncl 3> f = addfile("MPIM-REMO_EH5OMA1Br3_HR_044_BOL_1961-1970_167_timemean.nc","r")
> ncl 4> T=f->var167(0,0,:,:)
> ncl 5> wks=gsn_open_wks("ps","Bolivia_Timemean_1961-1970")
> ncl 6> res = True
> ncl 7> res@gsnMaximize = True
> ncl 8> res@tiMainString = "Bolivia_Timemean_1961-1970"
> ncl 9> plot = gsn_csm_contour_map(wks,T,res)
> ncl 10> end
>
> I have seen this problem before in this list, but I could not make it work using those tips.
>
> Here are the information about the variable "var167" and the variable "T":
>
> Variable: var167
> Type: float
> Total Size: 18544 bytes
> 4636 values
> Number of Dimensions: 4
> Dimensions and sizes: [time | 1] x [height | 1] x [rlat | 76] x [rlon | 61]
> Coordinates:
> time: [19710101..19710101]
> height: [ 2.. 2]
> rlat: [-20.68..12.32]
> rlon: [157.56..183.96]
> Number Of Attributes: 1
> grid_mapping : rotated_pole
>
> Variable: T
> Type: float
> Total Size: 18544 bytes
> 4636 values
> Number of Dimensions: 2
> Dimensions and sizes: [rlat | 76] x [rlon | 61]
> Coordinates:
> rlat: [-20.68..12.32]
> rlon: [157.56..183.96]
> Number Of Attributes: 3
> height : 2
> time : 19710101
> grid_mapping : rotated_pole
>
> I have renamed rlat to lat and rlon to lon but this does not solve the problem. The error message still occur. I hope you can help me.
>
> Attachment: file MPIM-REMO_EH5OMA1Br3_HR_044_BOL_1961-1970_167_timemean.nc
>
>
> Best regards
>
> Stephan<MPIM-REMO_EH5OMA1Br3_HR_044_BOL_1961-1970_167_timemean.nc>_______________________________________________
> 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

Bolivia_Timemean_1961-1970.png
Received on Fri Dec 13 18:00:23 2013

This archive was generated by hypermail 2.1.8 : Wed Dec 18 2013 - 14:29:51 MST