Coordinate variables must be the same dimension as their dimension

From: H.Dang <danghy_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 20 2012 - 16:35:56 MST

Hello,

I met some problem when defining coordinate variables, the error message
is:

fatal:Coordinate variables must be the same dimension as their dimension
fatal:No coordinate variable exists for dimension (V_lat) in variable
(v_cloud_yr)
fatal:["Execute.c":7556]:Execute: Error occurred at or near line 33 in file
cloud_cor.ncl

My code is:

  1 ;*******************************************
  2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  4 begin
  5
  6 f1 = addfile("cld_int.nc","r")
  7 V_swf_cloud = f1->SWCF
  8 V_lat = f1->lat
  9 V_lon = f1->lon
 10 v_swf_cloud = V_swf_cloud(:,:,:)
 11 lat_cloud = V_lat(:)
 12 lon_cloud = V_lon(:)
 13
 14 v_cloud_yr = new((/144,96/),double)
 15 do ilat = 0,144-1
 16 do jlon = 0,96-1
 17 v_cloud_yr(ilat,jlon) = avg(v_swf_cloud(ilat,jlon,:))
 18 end do ; jlon
 19 end do ; ilat
 20
 21 lat_cloud!0 = "V_lat"
 22 lat_cloud&V_lat = lat_cloud
 23 lon_cloud!0 = "V_lon"
 24 lon_cloud&V_lon = lon_cloud
 25 printVarSummary(lat_cloud)
 26 printVarSummary(lon_cloud)
 27
 28 printVarSummary(v_cloud_yr)
 29 v_cloud_yr!0 = "V_lat" ;"lat"
 30 v_cloud_yr!1 = "V_lon" ;"lon"
 31 printVarSummary(v_cloud_yr)
 32
 33 v_cloud_yr&V_lat= lat_cloud
 34 v_cloud_yr&V_lon= lon_cloud
 35
 36 end

Could you please give some suggestion about the line 33? Thanks.

Hongyan

P.S. Following is all the information on screen:

Variable: lat_cloud
Type: double
Total Size: 768 bytes
            96 values
Number of Dimensions: 1
Dimensions and sizes: [V_lat | 96]
Coordinates:
            V_lat: [ -90..89.99999999999999]
Number Of Attributes: 2
  units : degrees_north
  long_name : latitude

Variable: lon_cloud
Type: double
Total Size: 1152 bytes
            144 values
Number of Dimensions: 1
Dimensions and sizes: [V_lon | 144]
Coordinates:
            V_lon: [ 0..357.5]
Number Of Attributes: 2
  units : degrees_east
  long_name : longitude

Variable: v_cloud_yr
Type: double
Total Size: 110592 bytes
            13824 values
Number of Dimensions: 2
Dimensions and sizes: [144] x [96]
Coordinates:
Number Of Attributes: 1
  _FillValue : 9.969209968386869e+36

Variable: v_cloud_yr
Type: double
Total Size: 110592 bytes
            13824 values
Number of Dimensions: 2
Dimensions and sizes: [V_lat | 144] x [V_lon | 96]
Coordinates:
Number Of Attributes: 1
  _FillValue : 9.969209968386869e+36
fatal:Coordinate variables must be the same dimension as their dimension
fatal:No coordinate variable exists for dimension (V_lat) in variable
(v_cloud_yr)
fatal:["Execute.c":7556]:Execute: Error occurred at or near line 33 in file
cloud_cor.ncl

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 20 16:36:49 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 21 2012 - 10:43:23 MST