Page 1 of 1

floating point with WPP and Qcloud or Qice

PostPosted: Fri Jul 11, 2008 10:24 am
by DVD
I’m using WRF-ARW v3 and WPP v3. For our database we need regular lat-lon grib files, that’s why I use the WPP. For our cloud fraction algorithm we need the Qcloud and Qice. But when I set

(CLD WTR ON MDL SFCS ) SCAL=( 3.0)
L=(00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000)
(CLD ICE ON MDL SFCS ) SCAL=( 3.0)
L=(00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000)

To:

(CLD WTR ON MDL SFCS ) SCAL=( 3.0)
L=(11111 11111 11111 11111 11111 00000 00000 00000 00000 00000 00000 00000 00000 00000)
(CLD ICE ON MDL SFCS ) SCAL=( 3.0)
L=(11111 11111 11111 11111 11111 00000 00000 00000 00000 00000 00000 00000 00000 00000)

It gives a floating point acceptation.

In GRIBBIT.f it calls the function W3FI72, this is the one to give the error.
The error occurs when the variable “GRIDO” is to short. Because for each level it should be dx * dy, but in the case of the floating point acception it is about 12 to short.
I really don’t have a clue why this is, because the same output give nice output with ARWpost->GrADS.

Do anybody know what is going on and where to look for the solution?

Thanks in advanced!

Daniël

Re: floating point with WPP and Qcloud or Qice

PostPosted: Thu Mar 05, 2009 10:43 am
by ivan
I am not sure, whether this is relevant, but I got a lot of floating point underflow errors when running WRFPost. Finally I asolved the problem by adding -fpe3 flag to FFLAGS in makefile and recompiling the WPP.
I use ifort compiler and fpe3 in my compiler disable all floating point exceptions.

Re: floating point with WPP and Qcloud or Qice

PostPosted: Wed Apr 08, 2009 5:25 am
by DVD
Hi,

I couldn't find the similar kind of flag for pgf, so I've tried to solve the error by preventing the floating point exception to occur at all.

After an extensive search I found that extreme small numbers give and floating point exception in the functions "GET_BITS" (range=inf, so amount of bits=inf) and W3FI72.

After the line "CALL COLLECT(GRID,GRIDO)" I added the following code:
Code: Select all
      DO I=1,IM
        DO J=1,JM
          if ( abs(GRIDO(I,J)) .lt. 1.E-30 ) then
            GRIDO(I,J)=0.
          end if
        enddo
      ENDDO

This way all small numbers are set to zero, I'm not interested in Qcloud being 1.E-38 kg/kg anyway!

Hope this will help other people too.

cheers,

Daniël