Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#525 closed upgrade (Done)

Added error function (ERF) routines

Reported by: arango Owned by: arango
Priority: major Milestone: Release ROMS/TOMS 3.6
Component: Nonlinear Version: 3.6
Keywords: Cc:

Description (last modified by arango)

Added a new file ROMS/Utility/erf.F to incomplete gamma function and error function:

  ERF        Error function, ERF(x)
  ERFC       Complementary error function, ERFC(x)
  ERFCC      Complementary error function, ERFCC(x): cheaper Chebyshev fitting approximation
  GAMMP      Incomplete gamma function, P(a,x)
  GAMMQ      Incomplete gamma function complement, Q(a,x)=1-P(a,x)

This functions are not part of the standard intrinsic functions in Fortran. There are handy when defining analytical expression. The implementation of these functions are adapted from Numerical Recipes.

I recommend to have a call the MPI communication routine mp_bcasti to broadcast the exit_flag in case of an internal error in the gamma function or error function computation. For example, we need to have something like this:

      DO j=JstrR,JendR
        DO i=IstrR,IendR
          fac=-0.5_r8*u0*guscale*GRID(ng)%f(i,j)*sqrt(pi)/g
          dw=(yr(i,j)-yr(i,Mm(ng)/2))/guscale
          df=fac*ERF(dw)
          zeta(i,j,1)=df
        END DO
      END DO
# ifdef DISTRIBUTE
      CALL mp_bcasti (ng, model, exit_flag)  ! in case of error in ERF
# endif

Change History (2)

comment:1 by arango, 12 years ago

Resolution: Done
Status: newclosed

comment:2 by arango, 12 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.