Water-Level for the HP-48S/SX/G/GX


Overview
 

 1°)  Water-Level ( 37 waves )
 2°)  Graphic
 3°)  Tide
 4°)  A few Ports

 5°)  XDoodson Numbers >>> V



WARNING:
 

**************************************************************************************
                                                                                                                                                                                *
-These programs were carefully created, but do not take any risk !                                                                          *
                                                                                                                                                                                     *
  Always check your results at the official site:    https://tidesandcurrents.noaa.gov/tide_predictions.html            *
                                                                                                                                                                                  *
                                                                                                                                                                                *
**************************************************************************************



1°)  Water-Level

 "WL37" calculates the water level in a port with the 37 harmonic constituents given by the NOAA at the URL

        https://tidesandcurrents.noaa.gov/stations.html?type=Harmonic+Constituents

-Nodal corrections are also taken into account, in the way that is suggested in the "Supplement to Manual of Harmonic Analysis and Prediction of Tides" ( page 3 )


-The water level is computed by the harmonic method:       wl(t) = Z0 + A1 cos ( V1 - G1 ) + ............ + Ai cos ( Vi - Gi ) + ..........
  where  Z0 = the mean sea level ;  Ai and Gi = the harmonic constants of the port. ( A = amplitudes ; G = epochs )

-The Vi's  are linear combinations of astronomical arguments, namely:

         360° d                                          where  d = the number of days since 2000/01/01 at 0h UT

   h = 279.97° +   0.98564736° d                         ( all angles are expressed in degrees )
   s = 211.73° + 13.17639648° d
   p =  83.30° +   0.11140352° d

 N' = 234.98° +  0.05295376° d
  p1 = 282.94° + 0.00004708° d             
  D =   90°

-Actually, the main constituents have "nodal corrections" and each term may be written:

         A  [  cos ( V - G )  +   a   cos  ( V - 2.N' - G )  +   b   cos ( V - N' - G )   +   c   cos ( V + N' - G )   +   d  cos ( V + 2.N' - G )  ]

  where a , b , c , d  are constants

-The following formulae and coefficients have been employed:
 
 
 
       Constituents                     V         a          b        c       d
             M2
             S2
             N2
             K1
             M4
             O1
             M6
            MK3
             S4
            MN4
            NU2
             S6
            MU2
            2N2
            OO1
        LAMBDA2 
             S1
             M1
             J1
            Mm
            SSa
             Sa
            MSf
             Mf
           RHO1
            Q1
             T2
             R2
            2Q1
             P1
          2SM2
            M3
            L2
          2MK3
            K2
            M8
           MS4
          720d-2s+2h 
                720d 
         720d-3s+2h+p 
          360d+h+90° 
         1440d-4s+4h 
        360d-2s+h-90°
         2160d-6s+6h 
      1080d-2s+3h+90°
              1440d 
       1440d-5s+4h+p 
        720d-3s+4h-p 
              2160d 
          720d-4s+4h
       720d-4s+2h+2p
       360d+2s+h+90°
       720d-s+p+180° 
          360d+180° 
      360d-s+h+p+90°
      360d+s+h-p+90° 
                 s-p 
                 2h
                  h
              2s-2h 
                 2s
     360d-3s+3h-p-90°
     360d-3s+h+p-90°
          720d-h+p1 
     720d+h-p1+180°
    360d-4s+h+2p-90°
          360d-h-90° 
         720d+2s-2h 
     1080d-3s+3h+180°
      720d-s+2h-p+180°
       1080d-4s+3h-90° 
            720d+2h 
         2880d-8s+8h 
         1440d-2s+2h
        0
        0
        0
        0
        0
   -0.006 
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
        0
    -0.037
     0.0022
    -0.037 
    -0.020 
    -0.075 
     0.189 
    -0.112 
    -0.057 
        0
    -0.075 
    -0.037 
        0
    -0.037 
    -0.037 
        0
    -0.045 
        0
    -0.029 
    -0.029 
    -0.066 
        0
        0
    0.072
        0
    0.188
    0.189
        0
        0
    0.189 
   -0.011 
        0
   -0.056 
   -0.037 
    0.061 
   -0.013 
   -0.149 
   -0.035 
       0
       0
       0
    0.136 
       0
       0
       0 
    0.135 
       0
       0
       0
       0
       0
       0
    0.640 
       0
       0
    0.201 
    0.199 
   -0.065 
       0
       0 
   -0.064 
    0.415 
       0
       0
       0
       0
       0 
       0
   -0.037 
       0
       0
   -0.020 
    0.298 
       0
       0
      0
      0
      0
      0
      0
      0
      0
      0
      0
      0
      0
      0
      0
      0
   0.134 
      0
      0
      0
      0
      0 
      0
      0
      0
   0.039
      0
      0
      0
      0
      0
      0
      0
      0
      0
      0
   0.032
      0
      0

 

-L2 has also a satellite wave  L2B defined by      V = 720d-s+2h+p        c = 0.441   d = 0.062     amplitude  =  0.250 Amp(L2)
-Similarly for  M1  with  M1B                             V = 360d-s+h-p+90°         b = 0.185                 amplitude  =  0.360 Amp(M1)
                              and  M1C                            V =  360d-s+h         b = -0.148     c = -0.129     amplitude  =  0.194 Amp(M1)



 
          STACK            INPUTS         OUTPUTS
           Level2               Date                /
           Level1     GMTime ( hh.mnss )       water-level (m )
 
 
Example:     Water-Level in Seattle on 2021/07/07  12h41m  UT

-Store the vector corresponding to Seattle into 'LOC'  ( it's already stored )  and then:

    7.072021   ENTER
       12.41       WL37    ->       2.136  m    ( rounded to 3 decimals )


Notes:

-Execution time = 3 seconds with an HP48G/GX or 5 seconds with an HP48S/SX
-The function 'D&T'  will place the current date & time in the stack ( provided your HP48 gives the Greenwich Meridian Time... )

-A difference of a few centimeters may of course happen compared to the official results given by   https://tidesandcurrents.noaa.gov/tide_predictions.html     

-If need be, take also into account the barometric corrections below:

Barometric corrections:
 
 
 Atmospheric pressure  963hPa 973hPa 983hPa 993hPa 1003hPa 1013hPa 1023hPa 1033hPa 1043hPa
      corrections  +50cm  +40cm  +30cm  +20cm  +10cm      0  -10cm  -20cm  -30cm

 

2°)  Graphic


-The function  "draw" will give the water-level graphic during 1 day, from 0h UT to 24h UT


          STACK            INPUT         OUTPUT
           Level1              Date             Date
 
 
Example:     In Seattle on 2021/07/07:

 7.072021  draw  will draw the following graphic ( in about 80 seconds with an HP48G/GX, about 127 seconds with an HP48S/SX )


                                                                        *                                                                    *
                    *                                       *                 *                                                  *
      *                          *                  *                            *                                       *                           ( approximately )
                                            *                                         *                              *
                                                                                            *                   *
                                                                                                      *


3°)  Tide


-The program 'TIDE'   takes a vector with 5 elements corresponding to the water levels at 5 hours in level 2
  and the time corresponding to the 3rd water-level in level 1


                   STACK                    INPUTS                OUTPUTS
                    Level2  [ wl(-2) wl(-1) wl(0) wl(1) wl(2) ]            water-level (m )
                   Level1        GMTime(0) ( hh.mnss )          tide time ( hh.mnss )
 

Example:


  In Seattle, on 2021/07/07    'WL37'    gives the following results:

     Time(UT)           15h     16h      17h      18h      19h
  WaterLevel(m)    0.480  -066   -0.296  -0.170  0.262

-Place the vector  [ 0.480  -0.066  -0.296  -0.170  0.262 ]   in level 2                               water-level    =   -0.300 m      in level2
    and                                           17                                     in level1     TIDE    gives      tide happens  at  17h08m28s   in level1


Notes:  

-Without rounding the water-levels, it yields:   -0.299 m  &  17h08m29s  GMT   ( Low Tide )

-Likewise, 'TIDE'  gives a high tide:   3.088 m  at   9h51m36s  (GMT)

>The interval between 2 suuccessive water-levels must be 1 hour.

-'TIDE' employs an iterative method to find the extremum of the Lagrange polynomial defined by 5 points
-Sometimes - but very seldom - it may fail !


4°) A Few Ports


-The subdirectory 'PORTS' contains several vectors ( to store in 'LOC' before executing WL37 )

>I've used ->STR to save many bytes, so execute OBJ-> before storing into 'LOC'

-They contain 75 elements:  the mean-sea level and the 74 coefficients corresponding to the 37 harmonic constituents: amplitude ( in meters ) and phase ( in degrees )

-There are:

Aberdeen, Anchorpoint, Barharbor, Boston, Bridgeport, Capecod,
Delawarecity, Honolulu, Ketchikan, Kodiakisland, LosAngeles, Miami,
Milbridge, Monterey, Nassau, Newhaven, NewYorklongbeach, NewYorknortonpoint,
Philadelphia, Plymouth, Portland, Sandpoint, SanFrancisco, Seattle,
Southbeach, Sydney, Vancouver, Washington, Yakutat.

-Please check these constants at    http://tidesandcurrents.noaa.gov/stations.html?type=Harmonic+Constituents

( They could have changed a little... )

5°)  XDoodson Numbers >>> V
 

-Given a 7-digit Extended Doodson Number  XDO = c0c1c2c3c4c5c6 ,  'XDO->V'  calculates the argument V by the formula:

   V = c0 x 360 d + ( c1 - c0 - 5 ) s + ( c2 + c0 - 5 ) h + ( c3 - 5 ) p + ( c4 - 5 ) N' + ( c5 - 5 ) p1 + ( c6 - 5 ) 90°    with

   h = 279.97° +  0.98564736° d                     all angles are expressed in degrees
   s  = 211.73° + 13.17639648° d
   p  =  83.30° +   0.11140352° d                    where  d = the number of days since 01/01/2000 at 0h  UT
  N' = 234.98° +  0.05295376° d
  p1 = 282.94° +  0.00004708° d



Example:    XDO = 2745547   ( R2 wave )

     2745547  'XDO-V'   returns:

               177.03                   in level 3                
         720.98560028             in level 2
 { 720  0  1  0  0  -1  180 }   in level 1

 So,       V = 177.03 + 720.98560028 d                            with  d = the number of days since 2000/01/01 at 0h UT

 
 
 

References:

-A slightly different approach is described in the "Manual of Harmonic Analysis and Prediction of Tides" - Paul Schureman - US Gov Printing Office.
 ( with node factors and phase corrections instead of the nodal corrections )
-This quasi-harmonic method is used in an HP-48 program ( HPTIDE ) which may be downloaded from   www.hpcalc.org

-The nodal coefficients may calculated from the Hartmann and Wenzel ( 1995 ) tidal potential catalogue ( HW95 )
   or the tidal potential catalogue of Cartwright, Tayler and Edden ( 1971&1973 ).