Re.fatal:relhum: The input arrays must have the same dimension sizes

From: wei <whua27_at_nyahnyahspammersnyahnyah>
Date: Tue Jun 19 2012 - 03:40:41 MDT

Dear Mary,
thanks for your support. unfortunately, I could not figure out the
problem. Hence, code and print summary including error is given below:
thank again
****************************************************************
 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/contributed.ncl"

 begin

  a = addfile("anl_p.pres.jma.nc","r")
  a1 = addfile("anl_p.tmp.jma.nc","r")
  a2 = addfile("anl_p.spf.jma.nc","r")
  p = a->pres
  printVarSummary(p)
  t = a1->tmp
  printVarSummary(t)
  q = a2->spf
  printVarSummary(q)

  w = q/(1-q)
  copy_VarCoords(q,w)
  printVarSummary(w)
  rh = relhum (t, w, conform(t,p,(/0,2,3/)))
  printVarSummary(rh)
  end
************************************************************

 Copyright (C) 1995-2011 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.0.0
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.

Variable: p
Type: float
Total Size: 4008960 bytes
            1002240 values
Number of Dimensions: 3
Dimensions and sizes: [time | 24] x [lat | 145] x [lon | 288]
Coordinates:
            time: [0.5..143.5]
            lat: [90..-90]
            lon: [ 0..358.75]
Number Of Attributes: 11
  center : Japanese Meteorological Agency - Tokyo (RSMC)
  long_name : Pressure reduced to MSL
  units : Pa
  _FillValue : 1e+20
  level_indicator : 102
  gds_grid_type : 0
  parameter_table_version : 3
  parameter_number : 2
  forecast_time : 0
  forecast_time_units : hours
  initial_time : 07/26/2011 (00:00)

Variable: t
Type: float
Total Size: 92206080 bytes
            23051520 values
Number of Dimensions: 4
Dimensions and sizes: [time | 24] x [lev | 23] x [lat | 145] x [lon |
288]
Coordinates:
            time: [0.5..143.5]
            lev: [0..1000]
            lat: [90..-90]
            lon: [ 0..358.75]
Number Of Attributes: 11
  center : Japanese Meteorological Agency - Tokyo (RSMC)
  long_name : Temperature
  units : K
  _FillValue : 1e+20
  level_indicator : 100
  gds_grid_type : 0
  parameter_table_version : 3
  parameter_number : 11
  forecast_time : 0
  forecast_time_units : hours
  initial_time : 07/26/2011 (00:00)

Variable: q
Type: float
Total Size: 48107520 bytes
            12026880 values
Number of Dimensions: 4
Dimensions and sizes: [time | 24] x [lev | 12] x [lat | 145] x [lon |
288]
Coordinates:
            time: [0.5..143.5]
            lev: [100..1000]
            lat: [90..-90]
            lon: [ 0..358.75]
Number Of Attributes: 11
  center : Japanese Meteorological Agency - Tokyo (RSMC)
  long_name : Specific humidity
  units : kg kg^-1
  _FillValue : 1e+20
  level_indicator : 100
  gds_grid_type : 0
  parameter_table_version : 3
  parameter_number : 51
  forecast_time : 0
  forecast_time_units : hours
  initial_time : 07/26/2011 (00:00)

Variable: w
Type: float
Total Size: 48107520 bytes
            12026880 values
Number of Dimensions: 4
Dimensions and sizes: [time | 24] x [lev | 12] x [lat | 145] x [lon |
288]
Coordinates:
            time: [0.5..143.5]
            lev: [100..1000]
            lat: [90..-90]
            lon: [ 0..358.75]
Number Of Attributes: 1
  _FillValue : 1e+20
fatal:relhum: The input arrays must have the same dimension sizes
fatal:Execute: Error occurred at or near line 20 in file rh.ncl

On Mon, Jun 18, 2012 at 8:08 PM, Mary Haley <haley@ucar.edu> wrote:

> Wei,
>
> Your question is confusing. Did you actually fix the conform call? You
> can't use:
>
>
> rh = relhum (t, w, conform(t,p,1)))
>
> Because you are then telling "conform" that the second leftmost dimension
> of "t" is the exact same size as "p". This is not correct. I think you
> simply have this reversed. That is, all *but* the second dimension of "t"
> is equal to p, so you should be using:
>
> rh = relhum (t, w, conform(t,p,(/0,2,3/)))
>
> This basically says "conform p to be equal to the size of t", and hence
> conform needs to know what dimensions of "p" are already equal to the
> dimensions of "t".
>
> You then mentioned "q", which has different levels than "t", but you
> didn't show the code that you had for this. "relhum" is pretty basic: all
> input arrays must be the same size.
>
> --Mary
>
>
> On Jun 18, 2012, at 5:51 AM, wei wrote:
>
> > Dear Mary,
> > Thanks for your response, I have followed your guidance but the problem
> is still exist. variable t (temperature; 23 level) has four dimension like:
> > time: [0.5..143.5]
> > lev: [0..1000]
> > lat: [90..-90]
> > lon: [ 0..358.75]
> > but the levels started from 0 to 1000
> > and q (specific humidity;12 level) is also four dimension,but the
> levels started from 100 to 1000:
> > time: [0.5..143.5]
> > lev: [100..1000]
> > lat: [90..-90]
> > lon: [ 0..358.75]
> > when I calculated w (mixing ration) it gives the followings output:[time
> | 24] x [lev | 12] x [lat | 145] x [lon | 288]
> > but when I used the function : rh = relhum (t, w, conform(t,p,1))) for
> calculating the RH it gives the following error give below and print
> variable summary is also given.
> > According to my idea the problem is level and I do not know how to make
> the equal level of w and t? Please someone give me help to figure out this
> problem.
> > thanks in advance and regards,
> >
> >
> >
> > On Fri, Jun 15, 2012 at 7:07 PM, Mary Haley <haley@ucar.edu> wrote:
> >
> > You need to fix the third argument to conform. The third argument is the
> list of dimension indexes of the first variable that make up the same
> dimensions in the second variable.
> > t is time x lev x lat x lon, and p is time x lat x lon, so the
> dimensions of t that equal the dimensions of p are (/0,2,3/). This is what
> you want to use instead of "1".
> >
> > --Mary
> >
> >
> > On Jun 15, 2012, at 7:49 AM, wei wrote:
> >
> > > Dear all,
> > > Could anyone give me help how to solve the problem for calculating RH
> from JRA-25 data.
> > > thanks and regards,
> > > wei
> > > ***********************************************
> > > p = a->pres
> > > printVarSummary(p)
> > > t = a1->tmp
> > > printVarSummary(t)
> > > q = a2->spf
> > > printVarSummary(q)
> > > w = q/(1-q)
> > > w!0="time"
> > > w!1="lev"
> > > w!2="lat"
> > > w!3="lon"
> > > printVarSummary(w)
> > > rh = relhum (t, w, conform(t,p,1))
> > > printVarSummary(rh)
> > > end
> > > ***********************************************
> > >
> > > print Var Summary:
> > > Variable: p
> > > Type: float
> > > Total Size: 4008960 bytes
> > > 1002240 values
> > > Number of Dimensions: 3
> > > Dimensions and sizes: [time | 24] x [lat | 145] x [lon | 288]
> > > Coordinates:
> > > time: [0.5..143.5]
> > > lat: [90..-90]
> > > lon: [ 0..358.75]
> > > Number Of Attributes: 11
> > > center : Japanese Meteorological Agency - Tokyo (RSMC)
> > > long_name : Pressure reduced to MSL
> > > units : Pa
> > > _FillValue : 1e+20
> > > level_indicator : 102
> > > gds_grid_type : 0
> > > parameter_table_version : 3
> > > parameter_number : 2
> > > forecast_time : 0
> > > forecast_time_units : hours
> > > initial_time : 07/26/2010 (00:00)
> > >
> > > Variable: t
> > > Type: float
> > > Total Size: 92206080 bytes
> > > 23051520 values
> > > Number of Dimensions: 4
> > > Dimensions and sizes: [time | 24] x [lev | 23] x [lat | 145] x [lon
> | 288]
> > > Coordinates:
> > > time: [0.5..143.5]
> > > lev: [0..1000]
> > > lat: [90..-90]
> > > lon: [ 0..358.75]
> > > Number Of Attributes: 11
> > > center : Japanese Meteorological Agency - Tokyo (RSMC)
> > > long_name : Temperature
> > > units : K
> > > _FillValue : 1e+20
> > > level_indicator : 100
> > > gds_grid_type : 0
> > > parameter_table_version : 3
> > > parameter_number : 11
> > > forecast_time : 0
> > > forecast_time_units : hours
> > > initial_time : 07/26/2010 (00:00)
> > >
> > > Variable: q
> > > Type: float
> > > Total Size: 48107520 bytes
> > > 12026880 values
> > > Number of Dimensions: 4
> > > Dimensions and sizes: [time | 24] x [lev | 12] x [lat | 145] x [lon
> | 288]
> > > Coordinates:
> > > time: [0.5..143.5]
> > > lev: [100..1000]
> > > lat: [90..-90]
> > > lon: [ 0..358.75]
> > > Number Of Attributes: 11
> > > center : Japanese Meteorological Agency - Tokyo (RSMC)
> > > long_name : Specific humidity
> > > units : kg kg^-1
> > > _FillValue : 1e+20
> > > level_indicator : 100
> > > gds_grid_type : 0
> > > parameter_table_version : 3
> > > parameter_number : 51
> > > forecast_time : 0
> > > forecast_time_units : hours
> > > initial_time : 07/26/2010 (00:00)
> > >
> > > Variable: w
> > > Type: float
> > > Total Size: 48107520 bytes
> > > 12026880 values
> > > Number of Dimensions: 4
> > > Dimensions and sizes: [time | 24] x [lev | 12] x [lat | 145] x [lon
> | 288]
> > > Coordinates:
> > > Number Of Attributes: 1
> > > _FillValue : 1e+20
> > > fatal:conform: The array to be conformed must have the same number of
> dimensions as indicated by the length of the last argument
> > > fatal:Execute: Error occurred at or near line 24 in file rh.ncl
> > > _______________________________________________
> > > 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
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 19 03:41:00 2012

This archive was generated by hypermail 2.1.8 : Mon Jun 25 2012 - 09:57:23 MDT