[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Support #KPP-873190]: Problem in using the NETCDF function NF90_GET_VAR

Hi Arun,

> We are installting coupler Oasis3 at our site. We compiled and installed
> oasis3 but there is one directory *oasis3/examples/tutorial. *
> *which help in running the sample models. So during the compilation of
> tutorial we are getting below error message:*
> **
> "read_grid_irreg.F90", line 61.16: 1513-062 (S) Generic procedure reference
> can not be resolved due to incorrect actual argum
> ent attributes.
> "read_grid_irreg.F90", line 67.16: 1513-062 (S) Generic procedure reference
> can not be resolved due to incorrect actual argum
> ent attributes.
> "read_grid_irreg.F90", line 76.16: 1513-062 (S) Generic procedure reference
> can not be resolved due to incorrect actual argum
> ent attributes.
> "read_grid_irreg.F90", line 82.16: 1513-062 (S) Generic procedure reference
> can not be resolved due to incorrect actual argum
> ent attributes.
> when we gone to "read_grid_irreg.F90 program then we found this is calling a
> function NF90_GET_VAR:
> +61 CALL hdlerr( NF90_GET_VAR (il_file_id, il_lon_id, irreg_lon, &
> +62 ila_what(1:2), ila_dim(1:2)), __LINE__ )
> +63 !
> +64 WRITE(w_unit,*) 'We read globalgrid_lon'
> +65 CALL flush(w_unit)
> +66 !
> +67 CALL hdlerr( NF90_GET_VAR (il_file_id, il_lat_id, irreg_lat, &
> +68 ila_what(1:2), ila_dim(1:2)), __LINE__ )
> +69 !
> +70 WRITE(w_unit,*) 'We read globalgrid_lat'
> +71 CALL flush(w_unit)
> +72 WRITE(w_unit,*) 'We read globalgrid_lat 2'
> +73 WRITE(w_unit,*) 'ila_corners', ila_corners(:)
> +74 CALL flush(w_unit)
> +75 !
> +76 CALL hdlerr( NF90_GET_VAR(il_file_id, il_clo_id, irreg_clo, &
> +77 ila_what, ila_corners), __LINE__ )
> +78 !
> +79 WRITE(w_unit,*) 'We read globalgrid_clo'
> +80 CALL flush(w_unit)
> +81 !
> +82 CALL hdlerr( NF90_GET_VAR (il_file_id, il_cla_id, irreg_cla, &
> +83 ila_what, ila_corners), __LINE__ )
> We tried a lot , but not getting through , please help us to get this
> problem resolved.

The error means that the Fortran-90 compiler cannot determine which of
the overloaded versions of the NF90_GET_VAR function to call based on
the types and dimensionalities of the arguments you have provided.  As
an example, if the argument ila_what were an array of reals instead of
an array of integers, you would get this error message, because that
argument corresponds to the optional argument start:

      integer start
              specifies the starting point for accessing a netCDF
              variable's data values in terms of the indicial
              coordinates of the corner of the array section.  The
              indices start at 1; thus, the first data value of a
              variable is (1, 1, ..., 1).  The size of the vector
              shall be at least the rank of the associated netCDF
              variable and its elements shall correspond, in order, to
              the variable's dimensions.

Similarly the last argument, ila_corners, must be appropriate in type
and rank for the stride argument of nf90_get_var:

       integer stride
              specifies the sampling interval along each dimension of
              the netCDF variable.  The elements of the stride vector
              correspond, in order, to the netCDF variable's
              dimensions (stride(1)) gives the sampling interval along
              the most rapidly varying dimension of the netCDF
              variable).  Sampling intervals are specified in
              type-independent units of elements (a value of 1 selects
              consecutive elements of the netCDF variable along the
              corresponding dimension, a value of 2 selects every
              other element, etc.).

From the man page documentation for netcdf_f90:

       function nf90_get_var(ncid, varid, values, start, stride, imap)
              integer, intent(in) :: ncid, varid
              <<whatever>>, intent(out) :: values
              integer, dimension(:), optional, intent(in) :: start
              integer, dimension(:), optional, intent(in) ::  stride
              integer, dimension(:), optional, intent(in) ::  imap
              integer :: nf90_get_var

              (Replaces ncvgt() in version 2)

              Reads a value or values from a netCDF variable.  The
              netCDF dataset must be open and in data mode.  values
              will receive the value(s) what will be read from the
              netCDF variable identified by ncid and varid; it may be
              a scalar or an array and must be of type character,
              integer(kind=OneByteInt), integer(kind=TwoByteInt),
              integer(kind=FourByteInt), integer(kind=EightByteInt),
              real(kind=FourByteReal), or real(kind=EightByteReal).
              All values are converted from the external type of the
              netCDF variable, if possible; otherwise, an nf90_erange
              error is returned.  The optional argument start
              specifies the starting index in the netCDF variable for
              reading for each dimension of the netCDF variable.  The
              optional argument stride specifies the sampling stride
              (the interval between accessed values in the netCDF
              variable) for each dimension of the netCDF variable (see
              COMMON ARGUMENT DESCRIPTIONS below).  The optional
              argument imap specifies the in-memory arrangement of the
              data values (see COMMON ARGUMENT DEâ SCRIPTIONS below).

From the code you provided, I can't tell if your declarations of the
arguments are appropriate for this call.

You might try using the style of call in the example in the Fortran-90
Users Guide where the optional arguments are named explicitly, in case
the compiler can then give you a more explicit error message about
which argument it thinks doesn't match, something like

      status = nf90_get_var(ncid, rhVarId, rhValues(:, :, 3), &
                            start = (/ 1, 1, numTimes /),     &
                            count = (/ numLats, numLons, 1 /))


Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu

Ticket Details
Ticket ID: KPP-873190
Department: Support netCDF
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.