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

Re: 970624: Ask for help on nf_test with win32_install--jchiang



> >To: address@hidden
> >From: Jing-Hsien Chiang <address@hidden>
> >Subject: Ask for help on nf_test with win32_install--jchiang
> >Organization: Japan NUS
> >Keywords: 199706240906.DAA23550
>
> Hi there,
>
> I have been challenging to install netCDF-3.3/netCDF-3.3.1 to my PC which
> has a Windows NT4.0 installed. When I was struggling with netCDF-3.3's
> nf_test, which version has no makefile of MSVC++ and PowerStationFortran
> for it, you released version 3.3.1. It gives me a great pleasure to see
> what there is a maks.zip in this new release. I switch immediately to use
> netCDF-3.3.1 package to install netCDF into my PC. But, I failed again in
> testing nf_test. After some debugging work, to my knowledge, I find the
> program failed when it processes the following function, which is embedded
> in ncx.c, with testing data, fr=-3.402823e+37, 3.402823e+37.
>
> ncx_get_float_schar(const void *xp, schar *ip)
> {                                   ^^^^^^|_ this argument did pass over.
>       float xx;
>       get_ix_float(xp, &xx); /* get xx value=-3.402823e+37 here */
>       *ip = (schar) xx; /* failed here */
>       if(xx > SCHAR_MAX || xx < SCHAR_MIN)
>               return NC_ERANGE;
>       return ENOERR;
> }
>
> And, if I skipped the test_nf_get_var1_int1 and _int2, then I got failed
> at the following function.
>
> ncx_get_float_int(const void *xp, int *ip)
> {
>       float xx;
>       get_ix_float(xp, &xx);
>       *ip = (int) xx; /* failed here */
>       if(xx > (double)INT_MAX || xx < (double)INT_MIN)
>               return NC_ERANGE;
>       return ENOERR;
> }
>
> I have also checked those function with debugging into nc_test and found
> those function are working properly. I'll appreciate it if you could share
> me your experiences on the subject. Next is description as followed the
> requirement to ask for support.
>
>
>     1.  The standard output of the command "uname -a".
>       >There is no such a command in NT, here I write down the OS and
> Compiler
>       >instead.
>       >OS:Windows-NT4.0
>       >Compiler:Microsoft Visual C++ 4.0, Microsoft Power Station
> Fortran 4.0
>
>     2.  The contents of the file VERSION, which is in the top-level
>       source directory.
>       >3.3.1
>
>     3.  The standard output and error output of the configure script
>       (step 4 above).
>       >No such an output in this case.
>
>     4.  The absolute pathnames of all compilers (C, FORTRAN, C++) used
>         in the build process (use the type(1) or which(1) utility to
>         determine this).
>         >d:\msdev\bin\cl.exe
>         >d:\msdev\bin\fl32.exe
>
>     5.  The contents of the file "config.log", which is in the top-level
>       source directory.
>       >No such a file being generated in this case.
>
>     6.  The standard output and error output of the command "make" (step
>       6 above).
>       >No such an error message in this case.
>
>     7.  The standard output and error output of the command "make test"
>       (step 7 above).
>
>       >** Testing nf_strerror ...
>       >** Testing nf_open ...
>       >** Testing nf_close ...
>       >** Testing nf_inq ...
>       >** Testing nf_inq_dimid ...
>       >** Testing nf_inq_dim ...
>       >** Testing nf_inq_dimlen ...
>       >** Testing nf_inq_dimname ...
>       >** Testing nf_inq_varid ...
>       >** Testing nf_inq_var ...
>       >** Testing nf_inq_natts ...
>       >** Testing nf_inq_ndims ...
>       >** Testing nf_inq_nvars ...
>       >** Testing nf_inq_unlimdim ...
>       >** Testing nf_inq_vardimid ...
>       >** Testing nf_inq_varname ...
>       >** Testing nf_inq_varnatts ...
>       >** Testing nf_inq_varndims ...
>       >** Testing nf_inq_vartype ...
>       >** Testing nf_get_var1_text ...
>       >** Testing nf_get_var1_int ...
>       >run-time error M6101: MATH
>       >- floating-point error: invalid
>       >>>> message ends here <<<<<
>
>       >For you information, the run-time error M6101 written in VC++4.0
>       >online book is as follows:
>
>       Math error M6101: An invalid operation occurred. This error
> usually
>       occurs when the operand is NaN (not a number) or infinity.
>       This error terminates the program with exit code 129.
>
> Jing-Hsien
>
>
> - --
> Dr. Chiang, Jing-Hsien
> Energy & System Engineering Group
> Japan NUS Co., Ltd.
> Loop-X Bldg., 7F, Kaigan 3-9-15
> Minato-ku, Tokyo 108, JAPAN
> Phone:81-3-5440-1868
> Fax:  81-3-5440-1869
> e-mail:address@hidden

Dr. Chiang:

This problem is a problem with the test, not with the library.

The nf_test program, like the nc_test program, tests with some
extremal values. The runtime system is detecting that we
are attempting to convert ieee infinity to a non-floating point
(int, char) type, and generating a this report.

The value should actually be slightly less than ieee infinity,
so the real problem is probably the way the compiler is reading the
constant X_REAL_MAX in the file nf_test/tests.inc

The newer "Digital Fortran" (version 5.0) which is the follow-on product
to PowerStation Fortran does not exhibit this behavior, so we did not catch
the problem.

You may be able to work around the problem in the following way.
Change X_REAL_MAX at line 123 in nf_test/tests.inc to a smaller value,
say  3.40282340e+38.

The run time system may generate this error for _any_ assignment where
the source value is too big to fit in the destination type. If this is
the case, we probably will not be able to get nf_test to run
to completion. This should not keep you from using the library
if the other tests, especially fortran/ftest, work okay.

-glenn