New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 3450 for branches/2012/dev_r3438_LOCEAN15_PISLOB – NEMO

Ignore:
Timestamp:
2012-08-10T20:45:03+02:00 (12 years ago)
Author:
cetlod
Message:

ranch:2012/dev_r3438_LOCEAN15_PISLOB : change ACOSH/ASINH intrinsic function with their mathematical formulae, see ticket #972

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90

    r3449 r3450  
    154154                  ! compute the roots 
    155155                  IF( zp > 0.) THEN 
    156                      zphi = ASINH( zq / ( 2. * zr * zr * zr ) ) 
     156                     ! zphi = ASINH( zq / ( 2. * zr * zr * zr ) ) 
     157                     zphi =  zq / ( 2. * zr * zr * zr )  
     158                     zphi = LOG( zphi + SQRT( zphi * zphi + 1 ) )  ! asinh(x) = log( x + sqrt( x*x + 1 ) ) 
    157159                     zxs  = -2. * zr * SINH( zphi / 3. ) - za1 / 3. 
    158160                  ELSE 
    159161                     IF( zd > 0. ) THEN 
    160162                        zfff = MAX( 1., zq / ( 2. * zr * zr * zr ) ) 
    161                         zphi = ACOSH( zfff ) 
     163                      !  zphi = ACOSH( zfff ) 
     164                        zphi = LOG( zfff + SQRT( zfff * zfff - 1 ) )  ! acosh(x) = log( x + sqrt( x*x - 1 ) ) 
    162165                        zxs = -2. * zr * COSH( zphi / 3. ) - za1 / 3. 
    163166                     ELSE 
    164167                        zfff = zq / ( 2. * zr * zr * zr ) 
    165168                        zfff = MIN( 1., zfff ) 
    166                         zphi = ACOSH( zfff ) 
     169                        !zphi = ACOSH( zfff ) 
     170                        zphi = LOG( zfff + SQRT( zfff * zfff - 1 ) )  ! acosh(x) = log( x + sqrt( x*x - 1 ) ) 
    167171                        DO jic = 1, 3 
    168172                           zfunc = -2 * zr * COS( zphi / 3. + 2. * FLOAT( jic - 1 ) * rpi / 3. ) - za2 / 3. 
Note: See TracChangeset for help on using the changeset viewer.