[ncl-talk] Regridded variable coordinate problem

Dennis Shea shea at ucar.edu
Fri Feb 8 12:42:26 MST 2019


It is hard to follow a code with many randomly commented lines. My  guess:

You have:
  b1 = addfile(ncar_rea,"r")
  lat  = b1->lat                    ;;---Change (likely)
  lon  = b1->lon                   ;;---Change (likely)  *<=== ***
ORIGINAL: 0 -> 357.5   [??]*

...

  nc  = b1->air              ; FYI when reading an entire array, it is more
efficient to *not* use(:,:,:)
  nc = nc - 273.15
  nc  = lonFlip(nc)   ; change longitude (0;360) -> *(-180;180)*

*At this point, the 'lon' variable should be replaced with the new
'flipped' longitude values*
  lon = nc&lon                   ; extract the reordered lon

Without inputting the 'new'  (-180 - 180) longitudes, the function would
use the original 0-360 longitudes.

nc_regrid = rgrid2rcm_Wrap(lat,* lon,* nc_avg_subset, dst_lat, dst_lon, 0)

Assuming the '*dst_lon*' are negative, the function is, in a sense,
telling you there are no 'nearby' points.



-----------------------
Minor comments
------------------------
I have no idea what version of NCL you are using but generally, NCL does
not require that many of the  libraries be loaded.

load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"   ; <===
still needed

;;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
<=== the following can be eliminated
;;load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
;;load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
;;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"


begin   ; optional; can be eliminated for main script
 ...
end      ; if 'begin' is eliminated then the corresponding 'end' must be
removed

On Fri, Feb 8, 2019 at 10:30 AM Mauro Morichetti <s1073755 at pm.univpm.it>
wrote:

> Hi all,
>
> I would like use the function “rgrid2rcm_Wrap” to regrid a monthly
> NCAR/NCEP reanalysis temperature in a WRF grid.
>
> The problem I have this error:
>
> (0) check_for_y_lat_coord: Warning: Data either does not contain
> (0) a valid latitude coordinate array or doesn't contain one at all.
> (0) A valid latitude coordinate array should have a 'units'
> (0) attribute equal to one of the following values:
> (0)     'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
> 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
> (0) check_for_lon_coord: Warning: Data either does not contain
> (0) a valid longitude coordinate array or doesn't contain one at all.
> (0) A valid longitude coordinate array should have a 'units'
> (0) attribute equal to one of the following values:
> (0)     'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
> warning:ContourPlotInitialize: no valid values in scalar field;
> ContourPlot not possible:[errno=1101]
>
> I know it is an error referred to the coordinates units, but I can not
> solve, because I think it is a coordinate problem (I mean the coordinates
> are not well declared).
>
> This is the variable to plot:
>
> Variable: nc_regrid
> Type: float
> Total Size: 6774768 bytes
>             1693692 values
> Number of Dimensions: 3
> Dimensions and sizes: [Time | 12] x [south_north | 329] x [west_east |
> 429]
> Coordinates:
>             Time: [1902192..1910208]
> Number Of Attributes: 25
>   long_name : WRFChem
>   FieldType : 104
>   MemoryOrder : XY
>   description : TEMP at 2 M
>   units : [degC]
>   stagger :
>   coordinates : XLONG XLAT XTIME
>   Time :   0
>   NCL_tag : calculate_monthly_values: arith=avg
>   _FillValue : 9.96921e+36
>   time : 1902192
>   precision : 2
>   least_significant_digit : 1
>   GRIB_id : 11
>   GRIB_name : TMP
>   var_desc : Air temperature
>   dataset : NCEP Reanalysis Daily Averages
>   level_desc : 2 m
>   statistic : Mean
>   parent_stat : Individual Obs
>   valid_range : ( 150, 400 )
>   actual_range : ( 177.35, 317.15 )
>   lonFlip : longitude coordinate variable has been reordered via lonFlip
>   missing_value : -9.96921e+36
>   ncl : rgrid2rcm used for interpolation
>
> and attached the script.
>
> Could someone help me thanks
>
> Regards,
>
> ---------
>
> Eng. Mauro Morichetti
> Department of Industrial Engineering and Mathematical Science
> Marche Polytechnic University, Ancona, Italy
> m.morichetti at pm.univpm.it
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20190208/070de9c7/attachment.html>


More information about the ncl-talk mailing list