Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Fortran 208.15 KB | None | 0 0
  1.            PROGRAM PREDICT
  2. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3. C     Modified 2004.02.18 for Compaq Visual Fortran (B.Ducarme)        !
  4. C     Program PREDICT, version 3.31 1997.03.03 Fortran 90.             !
  5. C                                                                      !
  6. C     This file has 3707 records.                                      !
  7. C                                                                      !
  8. C     === Version for MS-DOS using LAHEY LF90 Fortran compiler  ===    !
  9. C                                                                      !
  10. C     === To run this program under UNIX, you have to modify     ===   !
  11. C         routine GEOEXT.                                              !
  12. C                                                                      !
  13. C     The program PREDICT computes model tides using different tidal   !
  14. C     potential catalogues:                                            !
  15. C                                                                      !
  16. C     Doodson (1921)                 with   378 waves,                 !  
  17. C     Cartwright-Tayler-Edden (1973) with   505 waves,                 !  
  18. C     Buellesfeld (1985)             with   656 waves,                 !
  19. C     Tamura (1987)                  with  1200 waves,                 !
  20. C     Xi (1989)                      with  2933 waves,                 !
  21. C     Roosbeek (1996)                with  6499 waves,                 !
  22. C     Hartmann and Wenzel (1995)     with 12935 waves                  !
  23. C                                                                      !
  24. C     for a number of different tidal components using observed or     !
  25. C     estimated (e.g. by a body tide and ocean tide model) tidal       !
  26. C     parameters.                                                      !
  27. C                                                                      !
  28. C     Reference:                                                       !
  29. C     ----------                                                       !
  30. C                                                                      !
  31. C     Wenzel, H.-G. (1996): The nanogal software: Earth tide data      !
  32. C         processing package ETERNA 3.3. Bulletin d'Informations       !
  33. C         Marees Terrestres vol. 124, 9425-9439, Bruxelles 1996.       !
  34. C                                                                      !  
  35. C     Disc file description:                                           !
  36. C     ----------------------                                           !
  37. C                                                                      !
  38. C     project:      Formatted file, on which the project name 'CPROJ'  !
  39. C                   has to be stored in the first record (8 characters !
  40. C                   at maximum). The project name 'CPROJ' will be used !
  41. C                   to define the print file and the output file.      !
  42. C                   This file has to be stored in the directory, from  !
  43. C                   which program PREDICT is executed.                 !
  44. C     'CPROJ'.ini:  Formatted unit, on which the input parameters      !
  45. C                   have to be stored before the execution of program  !
  46. C                   PREDICT. This file has to be stored in the         !
  47. C                   directory, from which program PREDICT is executed. !
  48. C     'CPROJ'.prn:  Formatted print file. This file will be written in !
  49. C                   the directory, from which program PREDICT is       !
  50. C                   executed.                                          !
  51. C     'CPROJ'.prd:  Formatted output file in ETERNA format. This file  !
  52. C                   will be written in the directory, from which       !
  53. C                   program PREDICT is executed.                       !
  54. C     doodsehw.dat: Formatted file, on which the Doodson (1921) tidal  !
  55. C                   potential catalogue has to be stored before the    !
  56. C                   execution of program PREDICT.                      !
  57. C                   The path for this file is                          !
  58. C                   /home/hwz/eterna34/commdat/doodsehw.dat.                    !
  59. C     doodseh2.uft: Unformatted file, on which the Doodson (1921)      !
  60. C                   tidal potential catalogue will be stored by the    !
  61. C                   first execution of program predict, if it does not !
  62. C                   yet exist. The path for this file is               !
  63. C                   /home/hwz/eterna34/commdat/doodsehw.uft.                    !
  64. C     cted73hw.dat: Formatted file, on which the Cartwright and Tayler !
  65. C                   (1971) and Cartwright and Edden (1973) tidal       !
  66. C                   potential catalogue has to be stored before the    !
  67. C                   execution of program PREDICT.                      !
  68. C                   The path for this file is                          !
  69. C                   /home/hwz/eterna34/commdat/cted73hw.dat.                    !
  70. C     cted73h2.uft: Unformatted file, on which the Cartwright and      !
  71. C                   Tayler (1971) and Cartwright and Edden (1973)      !
  72. C                   tidal potential catalogue will be stored by the    !
  73. C                   first execution of program predict, if it does not !
  74. C                   yet exist. The path for this file is               !
  75. C                   /home/hwz/eterna34/commdat/cted73hw.uft.                    !
  76. C     buellehw.dat: Formatted file, on which the Buellesfeld (1985)    !
  77. C                   tidal potential catalogue has to be stored before  !
  78. C                   the execution of program PREDICT.                  !
  79. C                   The path for this file is                          !
  80. C                   /home/hwz/eterna34/commdat/buellehw.dat.                    !
  81. C     buelleh2.uft: Unformatted file, on which the Buellesfeld (1985)  !
  82. C                   tidal potential catalogue will be stored by the    !
  83. C                   first execution of program predict, if it does not !
  84. C                   yet exist. The path for this file is               !
  85. C                   /home/hwz/eterna34/commdat/buellehw.uft.                    !
  86. C     tamurahw.dat: Formatted file, on which the Tamura (1987)         !
  87. C                   tidal potential catalogue has to be stored before  !
  88. C                   the execution of program PREDICT.                  !
  89. C                   The path for this file is                          !
  90. C                   /home/hwz/eterna34/commdat/tamurahw.dat.                    !
  91. C     tamurah2.uft: Unformatted file, on which the Tamura (1987)       !
  92. C                   tidal potential catalogue will be stored by the    !
  93. C                   first execution of program predict, if it does not !
  94. C                   yet exist. The path for this file is               !
  95. C                   /home/hwz/eterna34/commdat/tamurah2.uft.                    !
  96. C     xi1989hw.dat: Formatted file, on which the Xi (1989) tidal       !
  97. C                   potential catalogue has to be stored before the    !
  98. C                   execution of program PREDICT.                      !
  99. C                   The path for this file is                          !
  100. C                   /home/hwz/eterna34/commdat/xi1989hw.dat.                    !
  101. C     xi1989h2.uft: Unformatted file, on which the Xi (1989) tidal     !
  102. C                   potential catalogue will be stored by the first    !
  103. C                   execution of program predict, if it does not yet   !
  104. C                   exist. The path for this file is                   !
  105. C                   /home/hwz/eterna34/commdat/xi1989hw.uft.                    !
  106. C     ratgp95.dat:  Formatted file, on which the Roosbeek (1986) tidal !
  107. C                   potential catalogue has to be stored before the    !
  108. C                   execution of program PREDICT.                      !
  109. C                   The path for this file is                          !
  110. C                   /home/hwz/eterna34/commdat/ratgp95.dat.                     !
  111. C     ratgp952.uft: Unformatted file, on which the Roosbeek (1986)     !
  112. C                   tidal potential catalogue will be stored by the    !
  113. C                   first execution of program predict, if it does not !
  114. C                   yet exist. The path for this file is               !
  115. C                   /home/hwz/eterna34/commdat/ratgp95.uft.                     !
  116. C     hw95s.dat:    Formatted file, on which the Hartmann and Wenzel   !
  117. C                   (1995) tidal potential catalogue has to be stored  !
  118. C                   before the execution of program PREDICT.           !
  119. C                   The path for this file is                          !
  120. C                   /home/hwz/eterna34/commdat/hw95.dat.                        !
  121. C     hw95s2.uft:   Unformatted file, on which the Hartmann and Wenzel !
  122. C                   (1995) tidal potential catalogue will be stored by !
  123. C                   the first execution of program PREDICT, if it does !
  124. C                   not yet exist. The path for this file is           !
  125. C                   /home/hwz/eterna34/commdat/hw95.uft.                        !  
  126. C     etpolut1.dat: Formatted file, on which the pole coordinates and  !
  127. C                   DUT1 corrections have to be stored before the      !
  128. C                   execution of program PREDICT.                      !
  129. C                   The path for this file is                          !
  130. C                   /home/hwz/eterna34/commdat/etpolut1.dat.                    !
  131. C     etpolut2.uft: Unformatted direct access file, on which the pole  !
  132. C                   coordinates and DUT1 corrections will be stored by !
  133. C                   the first execution of program PREDICT, if it does !
  134. C                   not yet exist. The path for this file is           !
  135. C                   /home/hwz/eterna34/commdat/etpolut2.uft.                    !  
  136. C                                                                      !
  137. C     Used routines:                                                   !
  138. C     --------------                                                   !
  139. C                                                                      !
  140. C     ETASTN: computes astronomical elements.                          !
  141. C     PREDIN: reads control parameters.                                !
  142. C     ETDDTA: reads tabel of DDT = TDT - UTC.                          !
  143. C     ETDDTB: interpolates   DDT = TDT - UTC from table.               !
  144. C     ETGCON: computes geodetic coefficients.                          !
  145. C     ETGREN: computes date from Julian date                           !
  146. C     ETJULN: computes JULIAN date.                                    !
  147. C     ETLEGN: computes fully normalized Legendre spherical harmonics.  !
  148. C     ETLOVE: computes elastic parameters from Wahr-Dehant model.      !
  149. C     ETPOLC: computes DUT1                                            !
  150. C     ETPHAS: computes the phases and frequencies of the tidal waves.  !
  151. C     ETPOTS: computes amplitudes, frequencies and phases of tidal     !
  152. C             waves.                                                   !
  153. C     GEOEXT: computes JOBTIME.                                        !
  154. C                                                                      !
  155. C     Numerical accuracy:                                              !
  156. C     -------------------                                              !
  157. C                                                                      !
  158. C     The program has been tested on IBM-At compatible computers under !
  159. C     MS-DOS operating system with different compilers using DOUBLE    !
  160. C     PRECISION for all variables (15 digits) and on a SUN SPARC2      !
  161. C     under UNIX operating system with SUN F77 compiler, and gave      !
  162. C     identical results to 0.0001 nm/s**2.                             ! C                                                                      !
  163. C      Execution time:                                                  !
  164. C     ---------------                                                  !
  165. C                                                                      !
  166. C     The CPU execution time depends mainly on the number of waves of  !
  167. C     the choosen tidal potential development, and the number of model !
  168. C     tide values to be computed.                                      !
  169. C     The execution on a PENTIUM 100 MHz using LF90 compiler for 8760  !
  170. C     hourly samples including pole tide and LOD tide (parameter file  !
  171. C     KAHW9501.INI) are                                                !
  172. C                                                                      !
  173. C     catalogue              threshold   nwave  rms error  ex. time    !
  174. C                                             [nm/s**2]  [sec]         !
  175. C                                                                      !
  176. C     Tamura (1987)            2.D-06     1200    0.070    11.86       !
  177. C                                                                      !
  178. C     Hartmann + Wenzel (1995) 1.D-01        9   88.40      3.90       !
  179. C     Hartmann + Wenzel (1995) 1.D-02       42   14.40      4.06       !
  180. C     Hartmann + Wenzel (1995) 1.D-03      155    2.25      4.94       !
  181. C     Hartmann + Wenzel (1995) 1.D-04      434    0.44      7.20       !
  182. C     Hartmann + Wenzel (1995) 1.D-05     1248    0.068    13.51       !
  183. C     Hartmann + Wenzel (1995) 1.D-06     3268    0.011    33.01       !
  184. C     Hartmann + Wenzel (1995) 1.D-07     7761    0.002    83.82       !
  185. C     Hartmann + Wenzel (1995) 1.D-08    11462    0.001   132.86       !
  186. C     Hartmann + Wenzel (1995) 1.D-09    12000    0.001   139.95       !
  187. C     Hartmann + Wenzel (1995) 1.D-10    12011    0.001   140.11       !
  188. C                                                                      !
  189. C     Program creation:  1973.06.23 by Hans-Georg Wenzel,              !
  190. C                        Black Forest Observatory,                     !
  191. C                        Universitaet Karlsruhe,                       !
  192. C                        Englerstr. 7,                                 !
  193. C                        D-76128 KARLSRUHE,                            !
  194. C                        Germany.                                      !
  195. C                        Tel.: 0721-6082307,                           !
  196. C                        FAX:  0721-694552.                            !
  197. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  198. C     Last modification: 1997.03.03 by Hans-Georg Wenzel.              !
  199. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  200.       IMPLICIT DOUBLE PRECISION (D)
  201.       CHARACTER CUNIT(11)*8,COMPON(11)*24,CVERS*11,C88*8,C99*9
  202.       CHARACTER CHEAD(10)*64
  203.       CHARACTER CPROJ*8,CFINI*13,CFPRN*13,CFOUT*13
  204.       DIMENSION DGI(6)
  205. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  206. C     The following DIMENSION statements are concerning the number of  !
  207. C     output channels:                                                 !
  208. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  209.       PARAMETER (MAXCHAN=4)
  210.       CHARACTER CHANNEL(MAXCHAN)*10
  211.       DIMENSION DCOUT(MAXCHAN),DZERO(MAXCHAN)
  212. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  213. C     The following DIMENSION statement is concerning the tabel of     !
  214. C     differences DDT = TDT - UTC:                                     !
  215. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  216.       DOUBLE PRECISION DDTTAB(3,300)
  217.       COMMON /DDT/ DDTTAB,NDDTAB
  218. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  219. C     The following dimension statements are concerning the number of  !
  220. C     wavegroups to be used, which is restricted to  85 in the current !
  221. C     program version (parameter MAXWG).                               !
  222. C                                                                      !
  223. C     The following list of wavegroups may be used for the analyis and !
  224. C     prediction of tides (frequencies in cycle per day referring to   !
  225. C     epoch J2000):                                                    !
  226. C                                                                      !
  227. C     no.   from        to          frequency of  name of              !
  228. C           freqency    frequency   main wave     main wave            !  
  229. C                                                                      !
  230. C      1    0.000000    0.001369    0.000000      long                 !
  231. C      2    0.000133    0.004107    0.002738      SA                   !
  232. C      3    0.004108    0.020884    0.005476      SSA                  !
  233. C      4    0.020885    0.054747    0.036292      MM                   !
  234. C      5    0.054748    0.091348    0.073202      MF                   !
  235. C      6    0.091349    0.501369    0.109494      MTM                  !
  236. C      7    0.501370    0.911390    0.893244      Q1                   !
  237. C      8    0.911391    0.947991    0.929536      O1                   !  
  238. C      9    0.947992    0.981854    0.966446      M1                   !  
  239. C     10    0.981855    0.998631    0.997262      P1                   !
  240. C     11    0.998632    1.001369    1.000000      S1                   !  
  241. C     12    1.001370    1.004107    1.002738      K1                   !
  242. C     13    1.004108    1.006845    1.005476      PSI1                 !
  243. C     14    1.006846    1.023622    1.008214      PHI1                 !
  244. C     15    1.023623    1.057485    1.039030      J1                   !
  245. C     16    1.057486    1.470243    1.075940      OO1                  !
  246. C     17    1.470244    1.880264    1.864547      2N2                  !
  247. C     18    1.880265    1.914128    1.895982      N2                   !
  248. C     19    1.914129    1.950419    1.932274      M2                   !
  249. C     20    1.950420    1.984282    1.968565      L2                   !  
  250. C     21    1.984283    2.002736    2.000000      S2                   !  
  251. C     22    2.002737    2.451943    2.005476      K2                   !
  252. C     23    2.451944    7.000000    2.898410      M3M6                 !
  253. C                                                                      !
  254. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  255.       PARAMETER (MAXWG=85)
  256.       DIMENSION DFRA(MAXWG),DFRE(MAXWG),NA(MAXWG),NE(MAXWG),
  257.      1 DG0(MAXWG),DPHI0(MAXWG),DAM(MAXWG),DBOD(MAXWG)
  258.       CHARACTER CNSY(MAXWG)*4
  259. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  260. C     The following common blocks are used to transfer the control     !
  261. C     parameters from routine PREDIN to main program.                  !
  262. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  263.       COMMON /CONTROL3/ DLAT,DLON,DH,DGRAV,DAZ,DFRA,DFRE,DG0,DPHI0,
  264.      1 DATLIM,DAMIN,DPOLTC,DLODTC,IDTSEC
  265.       CHARACTER CINST*10
  266.       PARAMETER (MAXNF=8)
  267.       INTEGER IREG(MAXNF)
  268.       CHARACTER CFY1(MAXNF)*10,CFY2(MAXNF)*10
  269.       COMMON /CONTROL4/ IC,IR,ITY,ITM,ITD,ITH,IDA,KFILT,IPROBS,
  270.      1 IPRLF,IMODEL,IRIGID,IHANN,IQUICK,ISPANH,NGR,NF,
  271.      2 IREG,CFY1,CFY2,CINST,CNSY,CHEAD
  272. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  273. C     The following dimension statements are concerning the number of  !
  274. C     waves of the tidal potential catalogue, which is 13 000 in the   !
  275. C     current program version (parameter MAXNW).                       !
  276. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  277.       PARAMETER (MAXNW=12935)
  278.       DOUBLE PRECISION DC0(MAXNW),DS0(MAXNW),DDC(MAXNW),DDS(MAXNW)
  279.       COMMON /TIDWAVE/ NW,IWNR(12935),IAARG(12935,12),DX0(12935),
  280.      1 DX1(12935),DY0(12935),DY1(12935),DTHPH(12935),DTHFR(12935),
  281.      2 DBODY(12935)
  282.       COMMON /UNITS/ CUNIT,IC2
  283.       COMMON /CONST/ DPI,DPI2,DRAD,DRO
  284.       DATA IUN14/14/,IUN15/15/,IUN16/16/,IUN23/23/,IUN24/24/,IUN27/27/
  285.       DATA IUN30/30/,IUN31/31/
  286.       DATA DZERO/4*0.D0/
  287.       DATA CVERS/'3.31 970303'/,C88/'88888888'/,C99/'999999999'/
  288.       DATA COMPON/'Potential  ' ,'Gravity                 ',
  289.      1'Tilt                    ','Vertical displacement   ',
  290.      3'Horizontal displacement ','Vertical strain         ',
  291.      5'Horizontal strain       ','Aereal strain           ',
  292.      7'Shear  strain           ','Volume strain           ',
  293.      9'Ocean tide              '/
  294. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  295. C     Read project name:                                               !
  296. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  297.       OPEN(UNIT=IUN15,FILE='project')
  298.       READ(IUN15,17001) CPROJ
  299.       CLOSE(IUN15)
  300.       CFINI=CPROJ//'.ini'
  301.       CFPRN=CPROJ//'.prn'
  302.       CFOUT=CPROJ//'.prd'
  303. C
  304.       OPEN(IUN15, FILE=CFINI,FORM='FORMATTED')
  305.       OPEN(IUN16, FILE=CFPRN,FORM='FORMATTED')
  306.       OPEN(IUN23, FILE=CFOUT,FORM='FORMATTED')
  307.       WRITE(IUN16,17002) CVERS,CPROJ
  308.       WRITE(*,17002)     CVERS,CPROJ
  309.       IRESET=1
  310.       CALL GEOEXT(IUN16,IRESET,DEXTIM,DEXTOT)
  311. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  312. C     Store array of differences DDT = TDT - UTC:                      !
  313. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  314.       IPRINT=0
  315.       CALL ETDDTA(IUN16,IUN27,IPRINT)
  316. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  317. C     Read control parameters:                                         !
  318. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  319.       IPRINT=1
  320.       CALL PREDIN(IUN15,IUN16,IPRINT)
  321.       DDTH=DBLE(IDTSEC)/3600.D0
  322.       DDTD=DDTH/24.D0                                  
  323.       DTH=0.D0
  324.       IF(IRIGID.EQ.1) WRITE(IUN16,17009)
  325.       WRITE(IUN23,17018) CVERS
  326. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  327. C     Define output channels:                                          !
  328. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  329.       IPOLTC=0
  330.       ILODTC=0
  331.       NC=1
  332.       CHANNEL(1)='pred.sig. '
  333.       IF(DABS(DPOLTC).GT.1.D-6) IPOLTC=1
  334.       IF(DABS(DLODTC).GT.1.D-6) ILODTC=1
  335.       IF(IPOLTC.EQ.1.OR.ILODTC.EQ.1) THEN
  336.          NC=NC+1
  337.          CHANNEL(NC)='pred.tide '
  338.       ENDIF
  339.       IF(IPOLTC.EQ.1) THEN
  340.          NC=NC+1
  341.          CHANNEL(NC)='pole tide '
  342.       ENDIF
  343.       IF(ILODTC.EQ.1) THEN
  344.          NC=NC+1
  345.          CHANNEL(NC)='lod tide  '
  346.       ENDIF    
  347.       IPRINT=1
  348. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  349. C     Initialize direct access file for polecoordinates and DUT1:      !
  350. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  351. C HP-UNIX:      OPEN(UNIT=IUN30,FILE='../commdat/etpolut1.dat',
  352. C HP-UNIX:     1 FORM='FORMATTED',STATUS='OLD')
  353. C MS-DOS:
  354.       OPEN(UNIT=IUN30,FILE='/home/hwz/eterna34/commdat/etpolut1.dat',
  355.      1 FORM='FORMATTED',STATUS='OLD')
  356.       DCLAT=DCOS(DLAT*DRAD)
  357.       DSLAT=DSIN(DLAT*DRAD)
  358.       DCLON=DCOS(DLON*DRAD)
  359.       DSLON=DSIN(DLON*DRAD)
  360.       IPRINT=1
  361.       CALL ETJULN(IUN16,ITY,ITM,ITD,DTH,DJULD)
  362.       CALL ETPOLC(IUN16,IUN30,IUN31,IPRINT,DJULD,DCLAT,DSLAT,
  363.      1 DCLON,DSLON,DPOLX,DPOLY,DUT1,DTAI,DLOD,DGPOL,DGPOLP,DGLOD,NERR)
  364.       CLOSE(IUN30)
  365. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  366. C     Compute amplitudes, frequencies and phases of the tidal waves.   !
  367. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  368.       IPRINT=1
  369.       CALL ETPOTS(IUN14,IUN16,IUN24,IPRINT,IMODEL,DLAT,DLON,DH,DGRAV,
  370.      1 DAZ,IC,DJULD,DAMIN)
  371.       IC2=IC+2
  372.       ITH=DTH
  373. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  374. C     Print output channel table:                                      !
  375. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  376.       DO 100 JC=1,NC
  377.       WRITE(IUN16,17003)  JC,CHANNEL(JC),CUNIT(IC2)
  378.   100 WRITE(IUN23,17003)  JC,CHANNEL(JC),CUNIT(IC2)
  379. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  380. C     Print alphanumeric comment:                                      !
  381. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  382.       WRITE(IUN16,17010) CVERS
  383.       DO 900 I=1,10
  384.   900 WRITE(IUN16,17012)  CHEAD(I)
  385. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  386. C     Check wave groups and observed tidal parameters:                 !
  387. C     DG0:     amplitude factor.                                       !
  388. C     DPHI0... phase lead in degree.                                   !
  389. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  390.       WRITE(IUN16,17013) CUNIT(IC2)
  391.       WRITE(IUN23,17013) CUNIT(IC2)
  392.       DO 910 IG=1,NGR
  393. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  394. C     Convert frequencies from cpd to rad per hour:                    !
  395. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  396.       DFRA(IG)=DFRA(IG)*15.D0*DRAD
  397.       DFRE(IG)=DFRE(IG)*15.D0*DRAD
  398.       DO 930 IW=1,NW
  399.       IF(DTHFR(IW).LT.DFRA(IG)-1.D-10) NA(IG)=IW+1
  400.       IF(DTHFR(IW).LT.DFRE(IG)+1.D-10) NE(IG)=IW
  401.   930 CONTINUE
  402.       IF(NA(IG).EQ.0) NA(IG)=1
  403.       NAK=NA(IG)
  404.       NEK=NE(IG)
  405. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  406. C     Search for main wave of the group:                               !
  407. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  408.       DAM(IG)=0.D0
  409.       DO 970 IW=NAK,NEK
  410.       IF(IRIGID.EQ.1) DBODY(IW)=1.D0
  411.       DTHAM=DSQRT(DX0(IW)**2+DY0(IW)**2)
  412.       IF(DTHAM.LT.DAM(IG)) GOTO 970
  413.         DAM(IG)=DTHAM
  414.         DBOD(IG)=DBODY(IW)
  415.   970 CONTINUE
  416.   910 CONTINUE
  417. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  418. C     Check last group:                                                !
  419. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  420.   980 IF(NE(NGR).GE.NA(NGR)) GOTO 990
  421.       NGR=NGR-1
  422.       GOTO 980
  423.   990 CONTINUE
  424.       DO 995 IG=1,NGR
  425.       NANR=IWNR(NA(IG))
  426.       NENR=IWNR(NE(IG))
  427.       WRITE(IUN16,17015) IG,NANR,NENR,DG0(IG),DPHI0(IG),CNSY(IG),
  428.      1 DAM(IG),DBOD(IG)
  429.       WRITE(IUN23,17015) IG,NANR,NENR,DG0(IG),DPHI0(IG),CNSY(IG),
  430.      1 DAM(IG),DBOD(IG)
  431.       DPHI0(IG)=DPHI0(IG)*DRAD
  432.   995 CONTINUE
  433.       DO 996 IG=1,NGR
  434.       DFAC=DG0(IG)/DBOD(IG)
  435.       DO 996 IW=NA(IG),NE(IG)
  436.       IF(IRIGID.EQ.1) DBODY(IW)=1.D0
  437.       DX0(IW)=DX0(IW)*DFAC*DBODY(IW)
  438.       DX1(IW)=DX1(IW)*DFAC*DBODY(IW)
  439.       DY0(IW)=DY0(IW)*DFAC*DBODY(IW)
  440.       DY1(IW)=DY1(IW)*DFAC*DBODY(IW)
  441.   996 CONTINUE    
  442.       CALL GEOEXT(IUN16,IRESET,DEXTIM,DEXTOT)
  443. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  444. C     Print hourly model tides with format 6F13.6:                     !
  445. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  446.  1000 WRITE(IUN16,17016) CVERS,COMPON(IC2),CUNIT(IC2)
  447.       WRITE(IUN23,17019)
  448.       WRITE(IUN23,17020) (DZERO(J),J=1,NC)
  449.       ITMIN=0
  450.       ITSEC=0
  451.       DDAT=DBLE(ISPANH)/DDTH
  452.       NDAT=DDAT
  453.       CALL ETJULN(IUN16,ITY,ITM,ITD,DTH,DJULD0)
  454. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  455. C     Loop over NDAT samples:                                          !
  456. C     DTLIM is the time interval in hours for updatinmg the phases.    !
  457. C     Depending on amplitude threshold DAMIN, the phases will be       !
  458. C     updated                                                          !
  459. C     at each midnight for             DAMIN <= 1.D-8 m**2/s**2        !
  460. C     at monthly interval for 1.D-8 <  DAMIN <= 1.D-6 m**2/s**2)       !
  461. C     at yearly interval  for 1.D-6 <  DAMIN.                          !
  462. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  463.       DT=1.D99
  464.       DTLIM=1.D0
  465.       IF(DAMIN.GT.1.D-8) DTLIM=720.D0
  466.       IF(DAMIN.GT.1.D-6) DTLIM=8760.D0
  467.       DO 1090 I=1,NDAT,6
  468.       DO 1020 J=1,6
  469.       DJULD=DJULD0+DBLE(I+J-2)*DDTD
  470.       DT2000=(DJULD-2451544.D0)/36525.0D0
  471.       CALL ETGREN(IUN16,DJULD,ITY,ITM,ITD,DTH,NERR)
  472.       IF(DT.LT.DTLIM) GOTO 1033
  473.       IF(DTLIM.LT.10.D0.AND.DTH.GT.0.0001D0) GOTO 1033
  474. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  475. C     Recompute phases at interval DTLIM:                              !
  476. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
  477.       IPRINT=0
  478.       CALL ETPHAS(IUN16,IPRINT,IMODEL,DLON,DJULD)
  479.       DO 1025 IG=1,NGR
  480.       DO 1025 IW=NA(IG),NE(IG)
  481.       DTHPH(IW)=DTHPH(IW)+DPHI0(IG)
  482. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  483. C     Prepare arrays for recursion algorithm:                          !
  484. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
  485.       DC0(IW)=DCOS(DTHPH(IW))
  486.       DS0(IW)=DSIN(DTHPH(IW))
  487.       DDC(IW)=DCOS(DTHFR(IW)*DDTH)
  488.  1025 DDS(IW)=DSIN(DTHFR(IW)*DDTH)
  489.       DT=0.D0
  490.  1033 CONTINUE
  491.       DGT=0.D0
  492.       DO 1030 IG=1,NGR
  493.       DO 1030 IW=NA(IG),NE(IG)
  494.       DGT=DGT+(DX0(IW)+DT2000*DX1(IW))*DC0(IW)+
  495.      1        (DY0(IW)+DT2000*DY1(IW))*DS0(IW)      
  496.       DUMMY  =DC0(IW)*DDC(IW)-DS0(IW)*DDS(IW)
  497.       DS0(IW)=DS0(IW)*DDC(IW)+DC0(IW)*DDS(IW)
  498.  1030 DC0(IW)=DUMMY
  499. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  500. C     Compute pole tide correction and length of day tide correction:  !
  501. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  502.       DPOLT=0.D0
  503.       DLODT=0.D0
  504.       IF(IC.NE.0) GOTO 1040
  505.       IF(IPOLTC.EQ.1.OR.ILODTC.EQ.1) THEN
  506.          CALL ETPOLC(IUN16,IUN30,IUN31,IPRINT,DJULD,DCLAT,DSLAT,DCLON,
  507.      1   DSLON,DPOLX,DPOLY,DUT1,DTAI,DLOD,DGPOL,DGPOLP,DGLOD,IKENN)
  508.          DPOLT=DGPOL*DPOLTC
  509.          DLODT=DGLOD*DLODTC
  510.       ENDIF
  511.  1040 CONTINUE
  512.       DCOUT(1)=DGT+DPOLT+DLODT
  513.       DCOUT(2)=DGT
  514.       JC=2
  515.       IF(IPOLTC.EQ.1) THEN
  516.           JC=JC+1
  517.           DCOUT(JC)=DPOLT
  518.       ENDIF
  519.       IF(ILODTC.EQ.1) THEN
  520.           JC=JC+1
  521.           DCOUT(JC)=DLODT
  522.       ENDIF
  523.       DGI(J)=DCOUT(1)
  524.       IDAT=ITY*10000+ITM*100+ITD
  525.       ITH=DTH
  526.       DTMIN=(DTH-DBLE(ITH))*60.D0
  527.       ITMIN=INT(DTMIN+0.5D0)
  528.       IF(ITMIN.GE.60) THEN
  529.          ITMIN=0
  530.          ITH=ITH+1
  531.       ENDIF
  532.       DTSEC=DTH*3600.D0-DBLE(ITH)*3600.D0-DBLE(ITMIN)*60.D0
  533.       ITSEC=INT(DTSEC+0.5D0)
  534.       ITIM=ITH*10000+ITMIN*100+ITSEC
  535.       WRITE(IUN23,17021) IDAT,ITIM,(DCOUT(JC),JC=1,NC)
  536.       IF(ITIM.EQ.0) WRITE(*,17022) IDAT,ITIM,(DCOUT(JC),JC=1,NC)
  537.       DT=DT+DDTH
  538.  1020 CONTINUE
  539.       DJULD=DJULD0+DBLE(I-1)*DDTD
  540.       CALL ETGREN(IUN16,DJULD,ITY,ITM,ITD,DTH,NERR)
  541.       IDAT=ITY*10000+ITM*100+ITD
  542.       ITH=DTH
  543.       DTMIN=(DTH-DBLE(ITH))*60.D0
  544.       ITMIN=INT(DTMIN+0.5D0)
  545.       IF(ITMIN.GE.60) THEN
  546.          ITMIN=0
  547.          ITH=ITH+1
  548.       ENDIF
  549.       DTSEC=DTH*3600.D0-DBLE(ITH)*3600.D0-DBLE(ITMIN)*60.D0
  550.       ITSEC=INT(DTSEC+0.5D0)
  551.       ITIM=ITH*10000+ITMIN*100+ITSEC
  552.       WRITE(IUN16,17017) IDAT,ITIM,(DGI(J),J=1,6)
  553.  1090 CONTINUE
  554.       WRITE(IUN23,17001) C99
  555.       WRITE(IUN23,17001) C88
  556.       CALL GEOEXT(IUN16,IRESET,DEXTIM,DEXTOT)
  557.       WRITE(IUN16,17030) CPROJ,CFPRN,CFOUT,DEXTIM
  558.       WRITE(*,17030)     CPROJ,CFPRN,CFOUT,DEXTIM
  559. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  560. C     Format statements:                                               !
  561. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  562. 17001 FORMAT(A8)
  563. 17002 FORMAT(
  564.      1'     ******************************************************'/
  565.      2'     *                                                    *'/
  566.      3'     *  Program PREDICT, version ',A11,' Fortran 90.  *'/
  567.      4'     *                                                    *'/
  568.      5'     *         Prediction of earthtide signals.           *'/
  569.      6'     *         for project ',A8,  '                       *'/
  570.      7'     *                                                    *'/
  571.      8'     *    The  Black  Forest  Observatory  Schiltach      *'/
  572.      9'     *    wishes you much success when using PREDICT.     *'/
  573.      *'     *                                                    *'/
  574.      1'     ******************************************************'/)
  575. 17003 FORMAT(6x,'output channel no. ',I5,2X,A10,2X,A10)
  576. 17009 FORMAT(//' ***** Parameter IRIGID = 1 has been input. '/
  577.      1' ***** IRIGID =1 should only be used for comparison with model'/
  578.      2' ***** tides computed from ephemeris programs. For real world '/
  579.      3' ***** computations, use always IRIGID=0.'/)
  580. 17010 FORMAT(//6x,'Program PREDICT, version ',A11,'Fortran 90'//)
  581. 17012 FORMAT(1X,A64)
  582. 17013 FORMAT(///
  583.      1 6x,'Wave groups and observed tidal parameters'//
  584.      2 6x,'  no.  from    to ampl.fac. phase lead      ampl.  WD body '/
  585.      3 6x,'                               [deg]      [',A10,']'/)
  586. 17015 FORMAT(6x,3I6,2F10.4,1X,A8,2F10.4)
  587. 17016 FORMAT(////
  588.      1 6x,'Program PREDICT, version ',A11,' Fortran 90'//
  589.      2 6x,'Component ',A24,' IN ',1X,A8//6X,'Date in UT'//)
  590. 17017 FORMAT(5X,I8,1X,I6,6F10.3)
  591. 17018 FORMAT(' Model tides from program PREDICT, version',A11/)
  592. 17019 FORMAT(/'C******************************************************'/
  593.      1'PREDICT            1.0000    1.0000     0.000         3',
  594.      2'PREDICT')
  595. 17020 FORMAT('77777777',7X,4F10.3)
  596. 17021 FORMAT(I8,1X,I6,6F10.3)
  597. 17022 FORMAT(I9,1X,I2,6F10.3)
  598. 17030 FORMAT(/
  599.      1'      **********************************************'/
  600.      2'      *   Program PREDICT finished the execution   *'/
  601.      3'      *   for project ',A8,  '                     *'/
  602.      4'      *   (Hopefully it was successfull).          *'/
  603.      5'      *   Print  file is:            ',A13,' *'/
  604.      6'      *   Output file is:            ',A13,' *'/
  605.      7'      **********************************************'//
  606.      6'      Execution time: ',F10.3,'  seconds'/)
  607.       END
  608. C
  609.       BLOCK DATA
  610. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  611. C                                                                      !
  612. C     BLOCK DATA for program PREDICT, version 1996.05.25 Fortran 90.   !
  613. C                                                                      !
  614. C     Routine creation:  1993.03.29 by Hans-Georg Wenzel,              !
  615. C                        Black Forest Observatory,                     !
  616. C                        Universitaet Karlsruhe,                       !
  617. C                        Englerstr. 7,                                 !
  618. C                        D-76128 KARLSRUHE 1,                          !
  619. C                        Germany.                                      !
  620. C                        Tel: 0049-721-6082307,                        !
  621. C                        FAX: 0049-721-694552.                         !
  622. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  623. C     Last modification: 1996.05.25 by Hans-Georg Wenzel.              !
  624. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  625.       IMPLICIT DOUBLE PRECISION (D)
  626.       CHARACTER CUNIT(11)*8
  627. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  628. C     COMMON /CONST/:                                                  !
  629. C     DPI...        3.1415....  DPI2...       2.D0*DPI                 !
  630. C     DRAD...       DPI/180.D0  DRO...        180.D0/DPI               !
  631. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  632.       COMMON /CONST/ DPI,DPI2,DRAD,DRO
  633.       COMMON /UNITS/ CUNIT,IC2
  634.       DATA DPI/3.141592653589793D0/,DPI2/6.283185307179586D0/,
  635.      1 DRAD/1.745329251994330D-02/,DRO/57.295779513082320D0/
  636.       DATA CUNIT/'(m/s)**2','nm/s**2 ',' mas    ',' mm     ',' mm     ',
  637.      1' nstr   ',' nstr   ',' nstr   ',' nstr   ',' nstr   ',' mm     '/
  638.       END
  639. C
  640.       SUBROUTINE ETASTN(IUN16,IPRINT,IMODEL,DLON,DJULD,DUT1,DAS,DASP,
  641.      1 DDT)
  642. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  643. C                                                                      !
  644. C     Routine ETASTN, version 1996.05.25 Fortran 90.                   !
  645. C                                                                      !
  646. C     The routine ETASTN computes the astronomical elements for        !
  647. C     different tidal potential catalogues at a specific epoch, given  !
  648. C     in UTC. The formulas for the astronomical elements have been     !
  649. C     taken from Tamura (1987) and Simon et al. (1994).                !
  650. C                                                                      !
  651. C     Reference:                                                       !
  652. C     ----------                                                       !
  653. C                                                                      !
  654. C     Simon, J.L., P. Bretagnon, J. Chapront, M. Chapront-Touze,       !
  655. C        G. Francou and J. Laskar (1994): Numerical expressions for    !
  656. C        precession formulae and mean elements for the Moon and the    !
  657. C        planets. Astronomy and Atsrohysics, vo. 282, 663-683, 1994.   !
  658. C     Tamura, Y. (1987): A harmonic development of the tide            !
  659. C        generating potential. Bulletin d'Informations Marees          !
  660. C        Terrestres vol. 99, 6813-68755, Bruxelles 1987.               !
  661. C                                                                      !
  662. C     All variables with D as first character are double precision.    !
  663. C                                                                      !
  664. C     Input parameter description:                                     !
  665. C     ----------------------------                                     !
  666. C                                                                      !
  667. C     IUN16:       Unit number of formatted printout file.             !
  668. C     IPRINT:      Printout parameter. For IPRINT=0, nothing will      !
  669. C                  be printed on unit IUN16.                           !
  670. C     IMODEL:      Parameter describing the tidal potential catalogue. !
  671. C                  IMODEL = 1: Doodson (1921) catalogue.               !
  672. C                  IMODEL = 2: Cartwright et al. (1973) catalogue.     !
  673. C                  IMODEL = 3: Buellesfeld (1985) catalogue.           !
  674. C                  IMODEL = 4: Tamura (1987) catalogue.                !
  675. C                  IMODEL = 5: Xi (1989) catalogue.                    !
  676. C                  IMODEL = 6: Roosbeek (1996) catalogue.              !
  677. C                  IMODEL = 7: Hartmann and Wenzel (1995) catalogue.   !
  678. C                  For IMODEL = 1...5, arguments are computed from     !
  679. C                  Tamura (1987) formulas. For IMODEL = 6 and 7,       !
  680. C                  arguments are computed from Simon et al. (1994)     !
  681. C                  formulas.                                           !
  682. C     DJULD:       Julian date of the epoch in UTC.                    !
  683. C                                                                      !
  684. C     Output parameter description:                                    !
  685. C     -----------------------------                                    !
  686. C                                                                      !
  687. C     DAS(1):      Mean local Moontime in degree.                      !
  688. C     DAS(2):      Mean longitude of the Moon in degree.               !
  689. C     DAS(3):      Mean longitude of the Sun  in degree.               !
  690. C     DAS(4):      Mean longitude of the perigee of the Moon's orbit   !
  691. C                  in degree.                                          !
  692. C     DAS(5):      Negative mean longitude of the ascending node of    !
  693. C                  the Moon's orbit in degree.                         !
  694. C     DAS(6):      Mean longitude of the perigee of the Suns's orbit   !
  695. C                  in degree.                                          !
  696. C     DAS(7):      Mean longitude of the Mercury in degree.            !
  697. C     DAS(8):      Mean longitude of the Venus   in degree.            !
  698. C     DAS(9):      Mean longitude of the Mars    in degree.            !
  699. C     DAS(10):     Mean longitude of the Jupiter in degree.            !
  700. C     DAS(11):     Mean longitude of the Saturn  in degree.            !
  701. C                                                                      !
  702. C     DASP(1...11): Time derivatives of the corresponding variables    !
  703. C                  DAS in degree per hour.                             !
  704. C                                                                      !
  705. C     Used routines:                                                   !
  706. C     --------------                                                   !
  707. C     ETDDTB: interpolates DDT = DTD - UTC from table.                 !
  708. C                                                                      !
  709. C     Routine creation:  1994.07.30 by Hans-Georg Wenzel,              !
  710. C                        Geodaetisches Institut,                       !
  711. C                        Universitaet Karlsruhe,                       !
  712. C                        Englerstr. 7,                                 !
  713. C                        D-76128 KARLSRUHE 1,                          !
  714. C                        Germany.                                      !
  715. C                        Tel.: 0721-6082307,                           !
  716. C                        FAX:  0721-694552.                            !
  717. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  718. C     Last modification: 1996.05.25 by Hans-Georg Wenzel.              !
  719. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  720.       IMPLICIT DOUBLE PRECISION (D)
  721.       IMPLICIT INTEGER (I-N)
  722.       DOUBLE PRECISION DAS(11),DASP(11)
  723.       SAVE
  724.       DATA DRAD/0.174532925197721D-001/
  725.       D1MD=1.D0/(365250.D0*24.D0)
  726.       DMJD=DJULD-2400000.5D0
  727.       IMJD=DMJD
  728.       DTH=(DMJD-DBLE(IMJD))*24.D0
  729. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  730. C     Compute Universal Time epoch DTUT in Julian Centuries referring  !
  731. C     to J2000:                                                        !
  732. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  733.       DTUT=(DJULD-2451545.0D0)/36525.D0
  734. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  735. C     Correct DTH to UT1:                                              !
  736. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  737.       DTH=DTH+DUT1/3600.D0
  738. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  739. C     Compute epoch DT in Julian Centuries TDB referring to J2000      !
  740. C     (1. January 2000 12 h.):                                         !
  741. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  742.       DT=(DMJD-51544.5D0)/36525.0D0
  743. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  744. C     Correct time from UTC to TDT:                                    !
  745. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  746.       CALL ETDDTB(IUN16,IPRINT,DJULD,DDT)
  747.       DT=DT+DDT/3155760000.D0
  748.       IF(IPRINT.GT.0) WRITE(IUN16,17001) DMJD
  749.       DT2=DT*DT
  750.       DTC1=DT
  751.       DTC2=DTC1*DTC1
  752.       DTC3=DTC2*DTC1
  753.       DTC4=DTC3*DTC1
  754.       DTM1=DT/10.D0
  755.       DTM2=DTM1*DTM1
  756.       DTM3=DTM2*DTM1
  757.       DTM4=DTM3*DTM1
  758.       DTM5=DTM4*DTM1
  759.       DTM6=DTM5*DTM1
  760.       IF(IMODEL.GE.6) GOTO 2000
  761. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  762. C     Compute astronomical elements from TAMURA's 1987 formulas:       !
  763. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  764.       DTUT2=DTUT*DTUT
  765.       DTUT3=DTUT2*DTUT
  766.       DAL=280.4606184D0 + 36000.7700536D0*DTUT + 0.00038793D0*DTUT2
  767.      1 -0.0000000258D0*DTUT3
  768.       DALP=(36000.7700536D0 +2.0D0*0.00038793D0*DTUT
  769.      1 -3.0D0*0.0000000258D0*DTUT2)/(24.0D0*36525.D0)
  770.       DS=218.316656D0+481267.881342D0*DT-0.001330D0*DT2
  771.       DSP=(481267.881342D0-2.0D0*0.001330D0*DT)/(24.D0*36525.0D0)
  772.       DH=280.466449D0+36000.769822D0*DT+0.0003036D0*DT2
  773.       DHP=(36000.769822D0+2.0D0*0.0003036D0*DT)/(24.D0*36525.0D0)
  774.       DDS=0.0040D0*DCOS((29.D0+133.0D0*DT)*DRAD)
  775.       DDSP=(-0.0040D0*133.0D0*DRAD*DSIN((29.D0+133.0D0*DT)*DRAD))/
  776.      1 (24.0D0*36525.0D0)
  777.       DDH=0.0018D0*DCOS((159.D0+19.D0*DT)*DRAD)
  778.       DDHP=(-0.0018D0*19.0D0*DRAD*DSIN((159.D0+19.D0*DT)*DRAD))/
  779.      1 (24.0D0*36525.0D0)
  780.       DAS(1)=DAL-DS+DLON+DTH*15.0D0
  781.       DAS(2)=DS+DDS
  782.       DAS(3)=DH+DDH
  783.       DAS(4)=83.353243D0  +4069.013711D0*DT -0.010324D0*DT2
  784.       DAS(5)=234.955444D0 +1934.136185D0*DT -0.002076D0*DT2
  785.       DAS(6)=282.937348D0 +   1.719533D0*DT +0.0004597D0*DT2
  786. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  787. C     Compute the speeds in degree per hour:                           !
  788. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  789.       DASP(1)=DALP-DSP+15.0D0
  790.       DASP(2)=DSP+DDSP
  791.       DASP(3)=DHP+DDHP
  792.       DASP(4)=(4069.013711D0-2.0D0*0.010324D0*DT)/(24.0D0*36525.0D0)
  793.       DASP(5)=(1934.136185D0-2.0D0*0.002076D0*DT)/(24.0D0*36525.0D0)
  794.       DASP(6)=(1.719533D0+2.0D0*0.0004597D0*DT)/(24.0D0*36525.0D0)
  795.       GOTO 3000
  796.  2000 CONTINUE
  797. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  798. C     Mean longitude of the Moon (from Simon et al. 1994):             !
  799. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  800.       DS =218.3166456300D0+481267.8811957500D0*DTC1
  801.      2                         -0.0014663889D0*DTC2
  802.      3                         +0.0000018514D0*DTC3
  803.      4                         -0.0000000153D0*DTC4
  804.       DSP=(+481267.8811957500D0
  805.      2          -2.D0*0.0014663889D0*DTC1
  806.      3          +3.D0*0.0000018514D0*DTC2
  807.      4          -4.D0*0.0000000153D0*DTC3)/(36525.D0*24.D0)
  808. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  809. C     Mean longitude of the Sun (from Simon et al. 1994):             !
  810. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  811.       DH=280.46645016D0+   360007.6974880556D0*DTM1
  812.      2                         +0.0303222222D0*DTM2
  813.      3                         +0.0000200000D0*DTM3
  814.      4                         -0.0000653611D0*DTM4
  815.       DHP=      (360007.6974880556D0
  816.      2          +2.D0*0.0303222222D0*DTM1
  817.      3          +3.D0*0.0000200000D0*DTM2
  818.      4          -4.D0*0.0000653611D0*DTM3)*D1MD
  819.       DAS(1) =DH -DS +DLON+DTH*15.0D0
  820.       DASP(1)=DHP-DSP+15.0D0
  821. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  822. C     Modification for Roosbeek (1996) tidal potential catalogue:      !
  823. C     This modification has been programmed by Roosbeek himself.       !
  824. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  825.       IF(IMODEL.EQ.6) THEN
  826.         DGMST=280.460618375D0+360007.700536D0*DTM1
  827.      2                      +0.038793333333D0*DTM2
  828.      3                      -0.000025833333D0*DTM3
  829.         DGMSTP=               (360007.700536D0
  830.      2                      +2.D0*0.038793333333D0*DTM1
  831.      3                      -3.D0*0.000025833333D0*DTM2)*D1MD
  832.         DAS(1) =DGMST-DS+DLON+DTH*15.D0
  833.         DASP(1)=DGMSTP-DSP+15.D0
  834.       ENDIF
  835. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  836. C     This correction is necessary because for the determination of    !
  837. C     the HW95 tidal potential catalogue the difference DDT=TDT-UTC    !
  838. C     has been neglected. If the GMST would have been computed with    !
  839. C     with the correct DDT, the effect in GMST would be 1.0027*DDT.    !
  840. C     This effect is corrected below.                                  !
  841. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  842.       DAS(1)=DAS(1)-0.0027D0*DDT*15.D0/3600.D0
  843.       DAS(2) =DS
  844.       DASP(2)=DSP
  845.       DAS(3) =DH
  846.       DASP(3)=DHP
  847. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  848. C     Mean longitude of lunar perigee (from Simon et al. 1994):        !
  849. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  850.       DAS(4)= 83.35324312D0+40690.1363525000D0*DTM1
  851.      2                         -1.0321722222D0*DTM2
  852.      3                         -0.0124916667D0*DTM3
  853.      4                         +0.0005263333D0*DTM4
  854.       DASP(4)=            (+40690.1363525000D0
  855.      2                         -2.D0*1.0321722222D0*DTM1
  856.      3                         -3.D0*0.0124916667D0*DTM2
  857.      4                         +4.D0*0.0005263333D0*DTM3)*D1MD
  858. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  859. C     Negative mean longitude of the ascending node of the Moon        !
  860. C     in degree (from Simon et al. 1994):                              !
  861. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  862.       DAS(5)=234.95544499D0+19341.3626197222D0*DTM1
  863.      2                         -0.2075611111D0*DTM2
  864.      3                         -0.0021394444D0*DTM3
  865.      4                         +0.0001649722D0*DTM4
  866.       DASP(5)=            (+19341.3626197222D0
  867.      2                         -2.D0*0.2075611111D0*DTM1
  868.      3                         -3.D0*0.0021394444D0*DTM2
  869.      4                         +4.D0*0.0001649722D0*DTM3)*D1MD
  870. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  871. C    Mean longitude of solar perigee computed from                     !
  872. C    argument no. 2 - D -l':                                           !
  873. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    
  874.       DAS(6)=282.93734098D0       +17.1945766666D0*DTM1
  875.      1                             +0.0456888889D0*DTM2
  876.      2                             -0.0000177778D0*DTM3
  877.      2                             -0.0000334444D0*DTM4
  878.       DASP(6)=                        (+17.1945766666D0
  879.      1                             +2.D0*0.0456888889D0*DTM1
  880.      2                             -3.D0*0.0000177778D0*DTM2
  881.      2                             -4.D0*0.0000334444D0*DTM3)*D1MD
  882.  3000 CONTINUE
  883. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  884. C     Longitudes of the planets from Simon et al. 1994:                !
  885. C     Mercury = 7, Venus = 8, Mars = 9, Jupiter = 10, Saturn = 11.     !  
  886. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  887.        DAS( 7)=252.25090552D0+1494740.7217223248D0*DTM1
  888.      2                            +0.0303498417D0*DTM2
  889.      3                            +0.0000181167D0*DTM3
  890.      4                            -0.0000652778D0*DTM4
  891.      5                            -0.0000004972D0*DTM5
  892.      6                            +0.0000000556D0*DTM6
  893.       DASP( 7)=            (+1494740.7217223248D0
  894.      2                       +2.D0*0.0303498417D0*DTM1
  895.      3                       +3.D0*0.0000181167D0*DTM2
  896.      4                       -4.D0*0.0000652778D0*DTM3
  897.      5                       -5.D0*0.0000004972D0*DTM4
  898.      6                       +6.D0*0.0000000556D0*DTM5)*D1MD
  899.       DAS( 8)=181.97980085D0+ 585192.1295333027D0*DTM1
  900.      2                            +0.0310139472D0*DTM2
  901.      3                            +0.0000149111D0*DTM3
  902.      4                            -0.0000653222D0*DTM4
  903.      5                            -0.0000004972D0*DTM5
  904.      6                            +0.0000000556D0*DTM6
  905.       DASP( 8)=             (+585192.1295333027D0
  906.      2                       +2.D0*0.0310139472D0*DTM1
  907.      3                       +3.D0*0.0000149111D0*DTM2
  908.      4                       -4.D0*0.0000653222D0*DTM3
  909.      5                       -5.D0*0.0000004972D0*DTM4
  910.      6                       +6.D0*0.0000000556D0*DTM5)*D1MD
  911.       DAS( 9)=355.43299958D0+ 191416.9637029695D0*DTM1
  912.      2                            +0.0310518722D0*DTM2
  913.      3                            +0.0000156222D0*DTM3
  914.      4                            -0.0000653222D0*DTM4
  915.      5                            -0.0000005000D0*DTM5
  916.      6                            +0.0000000556D0*DTM6
  917.       DASP( 9)=             (+191416.9637029695D0
  918.      2                       +2.D0*0.0310518722D0*DTM1
  919.      3                       +3.D0*0.0000156222D0*DTM2
  920.      4                       -4.D0*0.0000653222D0*DTM3
  921.      5                       -5.D0*0.0000005000D0*DTM4
  922.      6                       +6.D0*0.0000000556D0*DTM5)*D1MD
  923.       DAS(10)= 34.35151874D0+  30363.0277484806D0*DTM1
  924.      2                            +0.0223297222D0*DTM2
  925.      3                            +0.0000370194D0*DTM3
  926.      4                            -0.0000523611D0*DTM4
  927.      5                            +0.0000011417D0*DTM5
  928.      6                            -0.0000000389D0*DTM6
  929.       DASP(10)=              (+30363.0277484806D0
  930.      2                       +2.D0*0.0223297222D0*DTM1
  931.      3                       +3.D0*0.0000370194D0*DTM2
  932.      4                       -4.D0*0.0000523611D0*DTM3
  933.      5                       +5.D0*0.0000011417D0*DTM4
  934.      6                       -6.D0*0.0000000389D0*DTM5)*D1MD
  935.       DAS(11)= 50.07744430D0+  12235.1106862167D0*DTM1
  936.      2                            +0.0519078250D0*DTM2
  937.      3                            -0.0000298556D0*DTM3
  938.      4                            -0.0000972333D0*DTM4
  939.      5                            -0.0000045278D0*DTM5
  940.      6                            +0.0000002861D0*DTM6
  941.       DASP(11)=              (+12235.1106862167D0
  942.      2                       +2.D0*0.0519078250D0*DTM1
  943.      3                       -3.D0*0.0000298556D0*DTM2
  944.      4                       -4.D0*0.0000972333D0*DTM3
  945.      5                       -5.D0*0.0000045278D0*DTM4
  946.      6                       +6.D0*0.0000002861D0*DTM5)*D1MD
  947.       DO 3110 I=1,11
  948.       DAS(I)=DMOD(DAS(I),360.0D0)
  949.       IF(DAS(I).LT.0.D0) DAS(I)=DAS(I)+360.0D0
  950.  3110 CONTINUE
  951.       IF(IPRINT.EQ.0) RETURN
  952. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  953. C     Print astronomical elements:                                     !
  954. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  955.       WRITE(IUN16,17004) (DAS(K),DASP(K),K=1,11)
  956. C 5000 CONTINUE
  957.       WRITE(IUN16,17030)
  958.       RETURN
  959. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  960. C     Format statements:                                               !
  961. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  962. 17001 FORMAT(//6x,'Routine ETASTN, version 1996.05.25.'//
  963.      1 6x,'Astronomic elements for initial epoch '/
  964.      2 6x,'Modified Julian date (TDT)    : ',F15.4/)
  965. 17004 FORMAT(//
  966.      1 6x,'local Moontime      F01',F20.11,' deg  F01.',F18.11,' deg/h'/
  967.      2 6x,'lunar longitude     F02',F20.11,' deg  F02.',F18.11,' deg/h'/
  968.      3 6x,'solar longitude     F03',F20.11,' deg  F03.',F18.11,' deg/h'/
  969.      4 6x,'lunar perigee       F04',F20.11,' deg  F04.',F18.11,' deg/h'/
  970.      5 6x,'lunar node longit.  F05',F20.11,' deg  F05.',F18.11,' deg/h'/
  971.      6 6x,'solar perigee       F06',F20.11,' deg  F06.',F18.11,' deg/h'/
  972.      7 6x,'longitude   Mercury F07',F20.11,' deg  F07.',F18.11,' deg/h'/
  973.      8 6x,'longitude   Venus   F08',F20.11,' deg  F08.',F18.11,' deg/h'/
  974.      9 6x,'longitude   Mars    F09',F20.11,' deg  F09.',F18.11,' deg/h'/
  975.      . 6x,'longitude   Jupiter F10',F20.11,' deg  F10.',F18.11,' deg/h'/
  976.      1 6x,'longitude   Saturn  F11',F20.11,' deg  F11.',F18.11,' deg/h'/
  977.      2)
  978. 17030 FORMAT(/6x,'***** Routine ETASTN finished the execution.'/)
  979.       END
  980. C
  981.       SUBROUTINE ETDDTA(IUN16,IUN27,IPRINT)
  982. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  983. C                                                                      !
  984. C     Routine ETDDTA, version 1996.05.29 Fortran 90.                   !
  985. C                                                                      !
  986. C     The routine ETDDTA reads a table of DDT = ET -UTC or TDT - UTC   !
  987. C     from file etddt.dat. The file will be opened and after use       !
  988. C     closed by the routine.                                           !
  989. C                                                                      !
  990. C     The table on file etddt.dat has to be extended, when new data    !
  991. C     are available.                                                   !
  992. C                                                                      !
  993. C     Input parameter description:                                     !
  994. C     ----------------------------                                     !
  995. C                                                                      !
  996. C     IUN16:       Unit number of formatted printer unit.              !
  997. C     IUN27:       Unit number of formmated unit, on which the table   !
  998. C                  of DDT has to be stored before the call of routine  !
  999. C                  ETDDTA. This unit will be opened by routine ETDDTA  !
  1000. C                  as /home/hwz/eterna34/commdat/etddt.dat                      !
  1001. C     IPRINT:      Printout parameter. For IPRINT=0, nothing will be   !
  1002. C                  written to IUN16.                                   !
  1003. C                                                                      !
  1004. C     COMMON /DDT/:                                                    !
  1005. C     -------------                                                    !
  1006. C     DDTTAB:      Array (1..3,1..100) containing the table of year,   !
  1007. C                  Julian date and DDT.                                !
  1008. C     NDDTAB:      Number of defined entries in table DDTTAB.          !
  1009. C                                                                      !
  1010. C     Routine creation:  1995.12.20 by Hans-Georg Wenzel,              !
  1011. C                        Black Forest Observatory,                     !
  1012. C                        Universitaet Karlsruhe,                       !
  1013. C                        Englerstr. 7,                                 !
  1014. C                        D-76128 KARLSRUHE,                            !
  1015. C                        Germany.                                      !
  1016. C                        Tel.: 0721-6082307,                           !
  1017. C                        FAX:  0721-694552.                            !
  1018. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  1019. C     Last modification: 1996.05.29 by Hans-Georg Wenzel,              !
  1020. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1021.       IMPLICIT DOUBLE PRECISION (D)
  1022.       IMPLICIT INTEGER (I-N)
  1023.       CHARACTER*10 CTEXT(8),CENDT
  1024.       DOUBLE PRECISION DDTTAB(3,300)
  1025.       COMMON /DDT/ DDTTAB,NDDTAB
  1026.       SAVE
  1027.       DATA CENDT/'C*********'/
  1028. C HP-UNIX: OPEN(UNIT=27,FILE='../commdat/etddt.dat',STATUS='OLD')
  1029. C MS-DOS:
  1030.       OPEN(UNIT=IUN27,FILE='/home/hwz/eterna34/commdat/etddt.dat',
  1031.      1 STATUS='OLD')
  1032.   100 READ(IUN27,17001) (CTEXT(I),I=1,8)
  1033.       IF(IPRINT.GT.0)  WRITE(IUN16,17002) (CTEXT(I),I=1,8)
  1034.       IF(CTEXT(1).NE.CENDT) GOTO 100
  1035.       NDDTAB=1
  1036.   200 READ(IUN27,17003,END=1000) DDTTAB(1,NDDTAB),DDTTAB(2,NDDTAB),
  1037.      1 DDTTAB(3,NDDTAB)
  1038.       IF(IPRINT.NE.0) THEN
  1039.         WRITE(IUN16,17004) DDTTAB(1,NDDTAB),DDTTAB(2,NDDTAB),
  1040.      1  DDTTAB(3,NDDTAB)
  1041.       ENDIF
  1042.       NDDTAB=NDDTAB+1
  1043.       GOTO 200
  1044.  1000 NDDTAB=NDDTAB-1
  1045.       CLOSE(IUN27)
  1046. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1047. C     Format statements:                                               !
  1048. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1049. 17001 FORMAT(8A10)
  1050. 17002 FORMAT(1X,7A10,A8)
  1051. 17003 FORMAT(F15.5,F15.6,F15.3)
  1052. 17004 FORMAT(F15.5,F15.6,F15.3)
  1053.       RETURN
  1054.       END
  1055. C
  1056.       SUBROUTINE ETDDTB(IUN16,IPRINT,DTUJD,DDT)
  1057. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1058. C                                                                      !
  1059. C     Routine ETDDTB, version 1996.05.25 Fortran 90.                   !
  1060. C                                                                      !
  1061. C     All variables with D as first character are DOUBLE PRECISION.    !
  1062. C                                                                      !
  1063. C     Input parameter description:                                     !
  1064. C     ----------------------------                                     !
  1065. C                                                                      !
  1066. C     IUN16:       Formatted printer unit.                             !
  1067. C     IPRINT:      Printout parameter. For IPRINT=0, nothing will be   !
  1068. C                  written on unit IUN16.                              !
  1069. C     DTUJD:       Julian date of epoch (Universal time).              !
  1070. C                                                                      !
  1071. C     Output parameter description:                                    !
  1072. C     -----------------------------                                    !
  1073. C                                                                      !
  1074. C     DDT:         Difference ET - UTC   resp. TDT - UTC in seconds    !
  1075. C                  from 1955.5 until now. For epochs less 1955.5, DDT  !
  1076. C                  is set to 31.59 s.                                  !
  1077. C                  For epochs exceeding the last tabulated epoch, DDT  !
  1078. C                  is set to the last tabulated DDT.                   !
  1079. C                  ET  is Ephemeris Time.                              !
  1080. C                  TDT is Terrestrial Dynamical Time.                  !
  1081. C                  UTC is Universal Time Coordinated, as broadcasted   !
  1082. C                  by radio or GPS satellites.                         !
  1083. C                                                                      !
  1084. C     COMMON /DDT/:                                                    !
  1085. C     -------------                                                    !
  1086. C                                                                      !
  1087. C     DDTTAB:      Array (1..3,1..300) containing the table of year,   !
  1088. C                  Julian date and DDT.                                !
  1089. C     NDDTAB:      Number of defined entries in table DDTTAB.          !
  1090. C                                                                      !
  1091. C     Execution time:                                                  !
  1092. C     ---------------                                                  !
  1093. C                                                                      !
  1094. C     1.38 microsec per call on a 100 MHz Pentium using Lahey LF90     !
  1095. C                   compiler.                                          !
  1096. C                                                                      !
  1097. C     Routine creation:  1995.12.20 by Hans-Georg Wenzel,              !
  1098. C                        Black Forest Observatory,                     !
  1099. C                        Universitaet Karlsruhe,                       !
  1100. C                        Englerstr. 7,                                 !
  1101. C                        D-76128 KARLSRUHE,                            !
  1102. C                        Germany.                                      !
  1103. C                        Tel.: 0721-6082307,                           !
  1104. C                        FAX:  0721-694552.                            !
  1105. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  1106. C     Last modification: 1996.05.25 by Hans-Georg Wenzel,              !
  1107. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1108.       IMPLICIT DOUBLE PRECISION (D)
  1109.       IMPLICIT INTEGER (I-N)
  1110. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1111. C     COMMON /DDT/: stored table DDTTAB of DDT = TDT - UTC:            !
  1112. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1113.       DOUBLE PRECISION DDTTAB(3,300)
  1114.       COMMON /DDT/ DDTTAB,NDDTAB
  1115.       SAVE
  1116.       DATA IWARN/1/,ITAB/1/
  1117.       IF(DTUJD.LT.DDTTAB(2,NDDTAB)) GOTO 100
  1118. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1119. C     DTUJD exceeds last tabulated epoch DDTTAB(2,NDDTAB).             !
  1120. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1121.       DDT=DDTTAB(3,NDDTAB)
  1122.       IF(IWARN.EQ.1) WRITE(IUN16,17003) DDTTAB(1,NDDTAB)
  1123.       IWARN=0
  1124.       RETURN
  1125. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1126. C     Look at table at position ITAB.                                  !
  1127. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1128.   100 CONTINUE
  1129.       IF(DTUJD.GE.DDTTAB(2,ITAB).AND.DTUJD.LT.DDTTAB(2,ITAB+1)) GOTO 230
  1130.       IF(DTUJD.LT.DDTTAB(2,ITAB)) THEN
  1131.         ITAB=ITAB-1
  1132.         IF(ITAB.GT.0) GOTO 100
  1133. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1134. C     Set DDT to first tabulated value and return:                     !
  1135. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1136.         ITAB=1
  1137.         DDT=DDTTAB(3,1)
  1138.         RETURN
  1139.       ENDIF
  1140.       IF(DTUJD.GT.DDTTAB(2,ITAB+1)) THEN
  1141.          ITAB=ITAB+1
  1142.          IF(ITAB.LT.NDDTAB) GOTO 100
  1143. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1144. C     Set DDT to last tabulated value and return:                      !
  1145. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1146.          ITAB=NDDTAB
  1147.          DDT=DDTTAB(3,NDDTAB)
  1148.          RETURN
  1149.       ENDIF
  1150. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1151. C     Interpolate table between position ITAB and ITAB+1:              !
  1152. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
  1153.   230 DDT=(DDTTAB(3,ITAB+1)*(DTUJD-DDTTAB(2,ITAB))-DDTTAB(3,ITAB)*
  1154.      1 (DTUJD-DDTTAB(2,ITAB+1)))/(DDTTAB(2,ITAB+1)-DDTTAB(2,ITAB))
  1155.       RETURN
  1156. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1157. C     Format statements:                                               !
  1158. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1159. 17001 FORMAT(//' Routine ETDDTB.FOR, version 1996.05.25.'//
  1160.      1' List of tables:'//
  1161.      2'       No.           Juld            DTX       DTY'//)
  1162. 17002 FORMAT(I10,2F15.5,F10.3)
  1163. 17003 FORMAT(/
  1164.      1' ***** Warning from routine ETDDTB.FOR, version 1996.05.25.'/
  1165.      2' ***** Epoch exceeds the last tabulated value:',F10.5/
  1166.      3' ***** DDT of last tabulated epoch is used.'/
  1167.      4' ***** Please try to update tabels in file etddt.dat.'/)
  1168.       END
  1169. C
  1170.       SUBROUTINE PREDIN(IUN15,IUN16,IPRINT)
  1171. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1172. C                                                                      !
  1173. C     Routine PREDIN, version 1996.05.25 Fortran 90.                   !
  1174. C                                                                      !
  1175. C     The routine reads the control parameter file *.INI and returns   !
  1176. C     the control parameters via COMMON /CONTROL3/ and /CONTROL4/.     !
  1177. C                                                                      !
  1178. C     Description of input parameters:                                 !
  1179. C     --------------------------------                                 !
  1180. C                                                                      !
  1181. C     IUN15:       Unit number of formatted control parameter file.    !
  1182. C     IUN16:       Unit number of formatted printer file.              !
  1183. C     IPRINT:      Print parameter. For IPRINT = 0, nothing will be    !
  1184. C                  written on IUN16.                                   !    
  1185. C                                                                      !
  1186. C     Description of COMMON block /CONTROL3/:                          !
  1187. C     ---------------------------------------                          !
  1188. C                                                                      !
  1189. C     DLAT:        Stations latitude in degree, referring to WGS84.    !
  1190. C     DLON:        Stations longitude in degree, positiv east of       !
  1191. C                  Greenwich, referring to WGS84.                      !
  1192. C     DH:          Ellipsoidal height of the station in meter          !
  1193. C                  referring to WGS84.                                 !      
  1194. C     DGRAV:       Gravity of the station in m/s**2 (necessary for     !
  1195. C                  tidal tilt only).                                   !
  1196. C     DAZ:         Azimuth of the earth tide sensor in degree (only    !
  1197. C                  for tilt and horizontal strain).                    !
  1198. C     DFRA:        Lowest  frequency within wave group in deg/h.       !
  1199. C     DFRE:        Highest frequency within wave group in deg/h.       !
  1200. C     DG0:         amplitude factor.                                   !
  1201. C     DPHI0:       phase lead in degree.                               !  
  1202. C     DATLIM:      Threshold for data snooping.                        !
  1203. C     DAMIN:       Amplitude threshold for the tidal potential         !
  1204. C                  catalogue in m**2/s**2.                             !  
  1205. C     DPOLTC:      Pole tide amplitude factor.                         !
  1206. C     DLODTC:      LOD  tide amplitude factor.                         !  
  1207. C     IDTSEC:      Sampling interval in seconds.                       !
  1208. C                                                                      !
  1209. C     Description of COMMON block /CONTROL4/:                          !
  1210. C     ---------------------------------------                          !
  1211. C                                                                      !
  1212. C     IC:          Earth tide component.                               !
  1213. C     IR:                                                              !
  1214. C     ITY:         Year       of the initial epoch.                    !
  1215. C     ITM:         Month      of the initial epoch.                    !  
  1216. C     ITD:         Day        of the initial epoch.                    !
  1217. C     ITH:         Hour (UTC) of the initial epoch.                    !
  1218. C     IDA:                                                             !  
  1219. C     KFILT:                                                           !
  1220. C     IPROBS:                                                          !
  1221. C     IPRLF:                                                           !
  1222. C     IMODEL:      Tidal potential catalogue.                          !
  1223. C     IRIGID:                                                          !  
  1224. C     IHANN:                                                           !
  1225. C     IQUICK:                                                          !  
  1226. C     ISPANH:                                                          !
  1227. C     NGR:         Number of wave groups.                              !
  1228. C     NF:          Number of meteorological parameters.                !
  1229. C     IREG:                                                            !
  1230. C     CFY1:                                                            !
  1231. C     CFY2:                                                            !
  1232. C     CINST:       Earth tide sensor name (CHARACTER*10).              !
  1233. C     CNSY:                                                            !
  1234. C     CHEAD:                                                           !
  1235. C                                                                      !
  1236. C     Program creation:  1994.11.01 by Hans-Georg Wenzel,              !
  1237. C                        Black Forest Observatory,                     !
  1238. C                        Universitaet Karlsruhe,                       !
  1239. C                        Englerstr. 7,                                 !
  1240. C                        D-76128 KARLSRUHE 1.                          !
  1241. C                        Tel.: 0721-6082301.                           !
  1242. C                        FAX:  0721-694552.                            !
  1243. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  1244. C     Last Modification: 1996.05.25 by Hans-Georg Wenzel.              !
  1245. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1246.       IMPLICIT DOUBLE PRECISION (D)
  1247.       IMPLICIT INTEGER (I-N)
  1248.       CHARACTER CINPUT*75,CINTERN*50,CONTROL*10,CREST*64,CINST*10
  1249.       CHARACTER CHEAD(10)*64
  1250. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1251. C     The following dimension statement is concerning the number of    !
  1252. C     meteorological parameters, which is 8 in the current program     !
  1253. C     version.                                                         !
  1254. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1255.       PARAMETER (MAXNF=8)
  1256.       INTEGER IREG(MAXNF)
  1257.       CHARACTER CFY1(MAXNF)*10,CFY2(MAXNF)*10
  1258. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1259. C     The following dimension statements are concerning the number of  !
  1260. C     wavegroups to be used, which is 85 in the current program        !
  1261. C     version (parameter MAXWG).                                       !
  1262. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1263.       PARAMETER (MAXWG=85)
  1264.       DIMENSION DFRA(MAXWG),DFRE(MAXWG),DG0(MAXWG),DPHI0(MAXWG)
  1265.       CHARACTER CNSY(MAXWG)*4
  1266.       COMMON /CONTROL3/ DLAT,DLON,DH,DGRAV,DAZ,DFRA,DFRE,DG0,DPHI0,
  1267.      1 DATLIM,DAMIN,DPOLTC,DLODTC,IDTSEC
  1268.       COMMON /CONTROL4/ IC,IR,ITY,ITM,ITD,ITH,IDA,KFILT,IPROBS,
  1269.      1 IPRLF,IMODEL,IRIGID,IHANN,IQUICK,ISPANH,NGR,NF,
  1270.      2 IREG,CFY1,CFY2,CINST,CNSY,CHEAD
  1271.       SAVE
  1272. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1273. C     Define default parameters:                                       !
  1274. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1275.       IH=1
  1276.       IGR=0
  1277.       IF=0
  1278.       DAMIN=1.D-8
  1279.       DPOLTC=1.16D0
  1280.       DLODTC=1.16D0
  1281.       ITH=0
  1282.       IMODEL=7
  1283.       IRIGID=0
  1284.       REWIND IUN15
  1285. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1286. C     Read control record:                                             !
  1287. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1288.   100 CONTINUE
  1289.       READ(IUN15,17001,END=5000) CINPUT
  1290.       II=INDEX(CINPUT,'=')
  1291.       IF(II.EQ.0) GOTO 100
  1292. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1293. C     Input record contains an equal sign at position II:              !
  1294. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1295.       CONTROL=CINPUT(1:II-1)
  1296. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1297. C     Search for # in the same record:                                 !
  1298. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1299.       NLE=LEN(CINPUT)
  1300.       INBL=NLE
  1301.       DO 200 I=II+1,NLE
  1302.       IF(CINPUT(I:I).NE.'#') GOTO 200
  1303.       INBL=I
  1304.       GOTO 210
  1305.   200 CONTINUE
  1306.   210 CREST=CINPUT(II+1:INBL-1)
  1307. C      WRITE(IUN16,17006) CREST
  1308. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1309. C     Search for sensor name:                                          !
  1310. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1311.       IF(CONTROL.NE.'SENSORNAME') GOTO 1300
  1312.       CINST=CREST
  1313.       GOTO 100
  1314.  1300 CONTINUE
  1315. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1316. C     Search for sampling interval:                                    !
  1317. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1318.       IF(CONTROL.NE.'SAMPLERATE') GOTO 1400
  1319.       WRITE(CINTERN,'(A15)') CREST
  1320.       READ(CINTERN,'(I15)')  IDTSEC
  1321.       GOTO 100
  1322.  1400 CONTINUE
  1323. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1324. C     Search  for stations latitude:                                   !
  1325. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1326.       IF(CONTROL.NE.'STATLATITU') GOTO 2400
  1327.       WRITE(CINTERN,'(A15)')  CREST
  1328.       READ(CINTERN,'(F15.4)') DLAT
  1329.       GOTO 100
  1330.  2400 CONTINUE
  1331. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1332. C     Search  for stations longitude:                                  !
  1333. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1334.       IF(CONTROL.NE.'STATLONITU') GOTO 2500
  1335.       WRITE(CINTERN,'(A15)')  CREST
  1336.       READ(CINTERN,'(F15.4)') DLON
  1337.       GOTO 100
  1338.  2500 CONTINUE
  1339. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1340. C     Search  for stations height:                                     !
  1341. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1342.       IF(CONTROL.NE.'STATELEVAT') GOTO 2600
  1343.       WRITE(CINTERN,'(A15)')  CREST
  1344.       READ(CINTERN,'(F15.4)') DH
  1345.       GOTO 100
  1346.  2600 CONTINUE
  1347. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1348. C     Search  for stations gravity:                                    !
  1349. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1350.       IF(CONTROL.NE.'STATGRAVIT') GOTO 2700
  1351.       WRITE(CINTERN,'(A15)')  CREST
  1352.       READ(CINTERN,'(F15.4)') DGRAV
  1353.       GOTO 100
  1354.  2700 CONTINUE
  1355. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1356. C     Search  for stations azimuth:                                    !
  1357. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1358.       IF(CONTROL.NE.'STATAZIMUT') GOTO 2800
  1359.       WRITE(CINTERN,'(A15)')  CREST
  1360.       READ(CINTERN,'(F15.4)') DAZ
  1361.       GOTO 100
  1362.  2800 CONTINUE
  1363. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1364. C     Search  for initial epoch:                                       !
  1365. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1366.       IF(CONTROL.NE.'INITIALEPO') GOTO 2900
  1367.       WRITE(CINTERN,'(A15)') CREST
  1368.       READ(CINTERN,'(3I5)')  ITY,ITM,ITD
  1369.       GOTO 100
  1370.  2900 CONTINUE
  1371. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1372. C     Search  for tidal component:                                     !
  1373. C                                                                      !
  1374. C     IC...        Earth tide component to be computed.                !
  1375. C                  IC=-1: tidal potential, geodetic coefficients       !
  1376. C                         in m**2/s**2.                                !
  1377. C                  IC= 0: vertical tidal acceleration (gravity tide),  !
  1378. C                         geodetic coefficients in nm/s**2 (positive   !
  1379. C                         down).                                       !
  1380. C                  IC= 1: horizontal tidal acceleration (tidal tilt)   !
  1381. C                         in azimuth DAZ, geodetic coefficients in     !
  1382. C                         mas = arc sec/1000.                          !
  1383. C                  IC= 2: vertical tidal displacement, geodetic        !
  1384. C                         coefficients in mm.                          !
  1385. C                  IC= 3: horizontal tidal displacement in azimuth     !
  1386. C                         DAZ, geodetic coefficients in mm.            !
  1387. C                  IC= 4: vertical tidal strain, geodetic coefficients !
  1388. C                         in 10**-9 = nstr.                            !
  1389. C                  IC= 5: horizontal tidal strain in azimuth DAZ,      !
  1390. C                         geodetic coefficients in 10**-9 = nstr.      !
  1391. C                  IC= 6: areal tidal strain, geodetic coefficients    !
  1392. C                         in 10**-9 = nstr.                            !
  1393. C                  IC= 7: shear tidal strain, geodetic coefficients    !
  1394. C                         in 10**-9 = nstr.                            !
  1395. C                  IC= 8: volume tidal strain, geodetic coefficients   !
  1396. C                         in 10**-9 = nstr.                            !
  1397. C                  IC= 9: ocean tides, geodetic coefficients in        !
  1398. C                         millimeter.                                  !
  1399. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1400.       IF(CONTROL.NE.'TIDALCOMPO') GOTO 3000
  1401.       WRITE(CINTERN,'(A15)') CREST
  1402.       READ(CINTERN,'(I15)')  IC
  1403.       GOTO 100
  1404.  3000 CONTINUE
  1405. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1406. C     Search  for tidal potential catalogue:                           !
  1407. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1408.       IF(CONTROL.NE.'TIDALPOTEN') GOTO 3100
  1409.       WRITE(CINTERN,'(A15)') CREST
  1410.       READ(CINTERN,'(I15)')  IMODEL
  1411.       GOTO 100
  1412.  3100 CONTINUE
  1413. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1414. C     Search  for truncation parameter:                                !
  1415. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1416.       IF(CONTROL.NE.'AMTRUNCATE') GOTO 3150
  1417.       WRITE(CINTERN,'(A15)')    CREST
  1418.       READ(CINTERN,'(F15.10)')  DAMIN
  1419.       GOTO 100
  1420.  3150 CONTINUE
  1421. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1422. C     Search  for print parameter of tidal component development:      !
  1423. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1424.       IF(CONTROL.NE.'PRINTDEVEL') GOTO 3200
  1425.       WRITE(CINTERN,'(A15)') CREST
  1426.       READ(CINTERN,'(I15)')  IR    
  1427.       GOTO 100
  1428.  3200 CONTINUE
  1429. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1430. C     Search  for textheader:                                          !
  1431. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1432.       IF(CONTROL.NE.'TEXTHEADER') GOTO 3400
  1433.       IF(IH.GT.10) GOTO 3300
  1434.       CHEAD(IH)=CREST
  1435.       IH=IH+1
  1436.       GOTO 100
  1437.  3300 CONTINUE
  1438. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1439. C     Search  for data error search threshold:                         !
  1440. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1441.       IF(CONTROL.NE.'SEARDATLIM') GOTO 3400
  1442.       WRITE(CINTERN,'(A15)')  CREST
  1443.       READ(CINTERN,'(F15.4)') DATLIM
  1444.       IDA=1
  1445.       IF(DATLIM.LE.0.D0) IDA=0
  1446.       GOTO 100
  1447.  3400 CONTINUE
  1448. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1449. C     Search  for numerical lowpass filter to be selected:             !
  1450. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1451.       IF(CONTROL.NE.'NUMHIGPASS') GOTO 3500
  1452.       WRITE(CINTERN,'(A15)') CREST
  1453.       READ(CINTERN,'(I15)')  KFILT
  1454.       GOTO 100
  1455.  3500 CONTINUE
  1456. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1457. C     Search  for print parameter for observations:                    !
  1458. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1459.       IF(CONTROL.NE.'PRINTOBSER') GOTO 3600
  1460.       WRITE(CINTERN,'(A15)') CREST
  1461.       READ(CINTERN,'(I15)')  IPROBS
  1462.       GOTO 100
  1463.  3600 CONTINUE
  1464. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1465. C     Search  for print parameter for observations:                    !
  1466. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1467.       IF(CONTROL.NE.'PRINTLFOBS') GOTO 3700
  1468.       WRITE(CINTERN,'(A15)') CREST
  1469.       READ(CINTERN,'(I15)')  IPRLF
  1470.       GOTO 100
  1471.  3700 CONTINUE
  1472. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1473. C     Search  for rigid earth model parameter:                         !
  1474. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1475.       IF(CONTROL.NE.'RIGIDEARTH') GOTO 3800
  1476.       WRITE(CINTERN,'(A15)') CREST
  1477.       READ(CINTERN,'(I15)')  IRIGID
  1478.       GOTO 100
  1479.  3800 CONTINUE
  1480. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1481. C     Search  for Hann-window parameter:                               !
  1482. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1483.       IF(CONTROL.NE.'HANNWINDOW') GOTO 3900
  1484.       WRITE(CINTERN,'(A15)') CREST
  1485.       READ(CINTERN,'(I15)')  IHANN
  1486.       IF(IHANN.GT.1) IHANN=1
  1487.       GOTO 100
  1488.  3900 CONTINUE
  1489. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1490. C     Search  for quick look adjustment parameter:                     !
  1491. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1492.       IF(CONTROL.NE.'QUICKLOOKA') GOTO 4000
  1493.       WRITE(CINTERN,'(A15)') CREST
  1494.       READ(CINTERN,'(I15)')  IQUICK
  1495.       GOTO 100
  1496.  4000 CONTINUE
  1497. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1498. C     Search  for pole tide correction parameter:                      !
  1499. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1500.       IF(CONTROL.NE.'POLTIDECOR') GOTO 4100
  1501.       WRITE(CINTERN,'(A15)') CREST
  1502.       READ(CINTERN,'(F15.5)')  DPOLTC
  1503.       GOTO 100
  1504.  4100 CONTINUE
  1505. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1506. C     Search for length of day tide correction parameter:              !
  1507. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1508.       IF(CONTROL.NE.'LODTIDECOR') GOTO 4200
  1509.       WRITE(CINTERN,'(A15)') CREST
  1510.       READ(CINTERN,'(F15.5)') DLODTC
  1511.       GOTO 100
  1512.  4200 CONTINUE
  1513. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1514. C     Search for prediction span:                                      !
  1515. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1516.       IF(CONTROL.NE.'PREDICSPAN') GOTO 4300
  1517.       WRITE(CINTERN,'(A15)') CREST
  1518.       READ(CINTERN,'(I15)')  ISPANH
  1519.       GOTO 100
  1520.  4300 CONTINUE
  1521. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1522. C     Search  for tidal parameters:                                    !
  1523. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1524.       IF(CONTROL.NE.'TIDALPARAM') GOTO 4400
  1525.       IGR=IGR+1
  1526.       WRITE(CINTERN,'(A45)')   CREST
  1527. C      READ(CINTERN,'(4F10.4,1X,A4)') DFRA(IGR),DFRE(IGR),DG0(IGR),
  1528.       READ(CINTERN,'(2F10.4,2F9.3,A5)') DFRA(IGR),DFRE(IGR),DG0(IGR),
  1529.      1 DPHI0(IGR),CNSY(IGR)
  1530.       GOTO 100
  1531.  4400 CONTINUE
  1532. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1533. C     Unknown control parameter name:                                  !
  1534. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1535. C      WRITE(IUN16,17005) CONTROL
  1536.       GOTO 100
  1537.  5000 CONTINUE
  1538.       NGR=IGR
  1539.       NF=IF
  1540.       IF(IPRINT.EQ.0) RETURN
  1541. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1542. C     Print first part of control parameters:                          !  
  1543. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1544.       NH=IH
  1545.       DO 5010 IH=1,NH
  1546.  5010 WRITE(IUN16,17114) CHEAD(IH)
  1547.       WRITE(IUN16,17111) IDTSEC,DLAT,DLON,DH,DGRAV,DAZ,DAMIN
  1548. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1549. C     Print second part of control parameters:                         !  
  1550. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1551.       WRITE(IUN16,17112) IC,IR,ITY,ITM,ITD,ITH,IMODEL
  1552.       DO 5020 IGR=1,NGR
  1553.  5020 WRITE(IUN16,17113) DFRA(IGR),DFRE(IGR),DG0(IGR),DPHI0(IGR),
  1554.      1 CNSY(IGR)
  1555.       RETURN
  1556. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1557. C     Format statements:                                               !
  1558. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1559. 17001 FORMAT(A75)
  1560. 17002 FORMAT(1X,A75)
  1561. 17003 FORMAT(' control parameter is: ',A10)
  1562. 17004 FORMAT(' numerical parameter is: ',A10)
  1563. 17005 FORMAT(' *** unknown control parameter:',A10)
  1564. 17006 FORMAT(' CREST=',A15)
  1565. 17111 FORMAT(/
  1566.      1 6x,'sample interval                              :',I10,' s'/
  1567.      2 6x,'stations latitude  in degree                 :',F10.4/
  1568.      3 6x,'stations longitude in degree                 :',F10.4/
  1569.      4 6x,'stations height    in meter                  :',F10.3/
  1570.      5 6x,'stations gravity   in m/s**2                 :',F10.4/
  1571.      6 6x,'stations azimuth from north in degree        :',F10.4/
  1572.      7 6x,'truncation of tidal waves at (m**2/s**2)     :',D10.3)
  1573. 17112 FORMAT(
  1574.      1 6x,'earth tide component                         : ',I10/
  1575.      2 6x,'print tidal component development (1=yes)    : ',I10/
  1576.      3 6x,'initial epoch for tidal development          : ',I4,I3,I3,I3/
  1577.      4 6x,'tidal potential catalogue                    : ',I10/)
  1578. 17113 FORMAT(6x,'wave group : ',2F10.6,2F10.4,1X,A4)
  1579. 17114 FORMAT(1X,A64)
  1580.       END
  1581. C
  1582.       SUBROUTINE ETGCON(IUN16,IPRINT,DLAT,DLON,DH,DGRAV,DAZ,IC,DGK,DPK)
  1583. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1584. C                                                                      !
  1585. C     Routine ETGCON, version 1997.03.03 Fortran 90.                   !
  1586. C     corrected 2005.06.28 (B.Ducarme)                                 !
  1587. C     The routine ETGCON computes the geodetic coefficients for        !
  1588. C     the tidal potential developments, Hartmann and Wenzel            !
  1589. C     normalization.                                                   !
  1590. C                                                                      !
  1591. C     All variables with D as first character are DOUBLE PRECISION.    !
  1592. C                                                                      !
  1593. C     Input parameter description:                                     !
  1594. C     ----------------------------                                     !
  1595. C                                                                      !
  1596. C     IUN16:       formatted line printer unit.                        !
  1597. C     DLAT:        ellipsoidal latitude in degree, referring to        !
  1598. C                  geodetic reference system GRS80.                    !
  1599. C     DLON:        ellipsoidal longitude in degree, referring to       !
  1600. C                  geodetic reference system GRS80, positiv east of    !
  1601. C                  Greenwhich.                                         !
  1602. C     DH:          ellipsoidal height in meter, referring to geodetic  !
  1603. C                  reference system GRS80.                             !
  1604. C     DGRAV:       gravity in m/s**2. If DGRAV less than  9.50 m/s**2, !
  1605. C                  DGRAV will be overwritten by normal gravity         !
  1606. C                  referring to geodetic reference system 1980.        !
  1607. C     DAZ:         azimuth in degree from north direction counted      !
  1608. C                  clockwise (necessary for tidal tilt only).          !
  1609. C     IC:          Earth tide component to be computed.                !
  1610. C                  IC=-1: tidal potential, geodetic coefficients       !
  1611. C                         in m**2/s**2.                                !
  1612. C                  IC= 0: vertical tidal acceleration (gravity tide),  !
  1613. C                         geodetic coefficients in nm/s**2 (positive   !
  1614. C                         down).                                       !
  1615. C                  IC= 1: horizontal tidal acceleration (tidal tilt)   !
  1616. C                         in azimuth DAZ, geodetic coefficients in     !
  1617. C                         mas = arc sec/1000.                          !
  1618. C                  IC= 2: vertical tidal displacement, geodetic        !
  1619. C                         coefficients in mm.                          !
  1620. C                  IC= 3: horizontal tidal displacement in azimuth     !
  1621. C                         DAZ, geodetic coefficients in mm.            !
  1622. C                  IC= 4: vertical tidal strain, geodetic coefficients !
  1623. C                         in 10**-9 = nstr.                            !
  1624. C                  IC= 5: horizontal tidal strain in azimuth DAZ,      !
  1625. C                         geodetic coefficients in 10**-9 = nstr.      !
  1626. C                  IC= 6: areal tidal strain, geodetic coefficients    !
  1627. C                         in 10**-9 = nstr.                            !
  1628. C                  IC= 7: shear tidal strain, geodetic coefficients    !
  1629. C                         in 10**-9 = nstr.                            !
  1630. C                  IC= 8: volume tidal strain, geodetic coefficients   !
  1631. C                         in 10**-9 = nstr.                            !
  1632. C                  IC= 9: ocean tides, geodetic coefficients in        !
  1633. C                         millimeter.                                  !
  1634. C                                                                      !
  1635. C     Output parameter description:                                    !
  1636. C     -----------------------------                                    !
  1637. C                                                                      !
  1638. C     DGK:         array (1...25) of geodetic coefficients.            !
  1639. C                  The geodetic coefficient of degree L and order M    !
  1640. C                  is stored in DGK(J) with J=L*(L+1)/2+M-2.           !
  1641. C     DPK:         array (1...25) of phases in degree.                 !
  1642. C                  The phase for degree L and order M is stored in     !
  1643. C                  DPK(J) with J=L*(L+1)/2+M-2.                        !
  1644. C                                                                      !
  1645. C     Used routines:                                                   !
  1646. C     --------------                                                   !
  1647. C                                                                      !
  1648. C     ETLOVE: computes latitude dependent elastic parameters.          !
  1649. C     ETLEGN: computes fully normalized Legendre functions and their   !
  1650. C             derivatives.                                             !
  1651. C                                                                      !
  1652. C     Numerical accuracy:                                              !
  1653. C     -------------------                                              !
  1654. C                                                                      !
  1655. C     The routine has been tested under operation system MS-DOS and    !
  1656. C     UNIX in double precision (8 byte words = 15 digits) using        !
  1657. C     different compilers.                                             !
  1658. C                                                                      !
  1659. C     References:                                                      !
  1660. C                                                                      !
  1661. C     Wilhelm, H. and W. Zuern (1984): Tidal forcing field.            !
  1662. C           In: Landolt-Boernstein, Zahlenwerte und Funktionen aus     !
  1663. C           Naturwissenschaften und Technik, New series, group V,      !
  1664. C           Vol. 2, Geophysics of the Solid Earth, the Moon and the    !
  1665. C           Planets, Berlin 1984.                                      !
  1666. C                                                                      !
  1667. C     Zuern, W. and  H. Wilhelm (1984): Tides of the solid Earth.      !
  1668. C           In: Landolt-Boernstein, Zahlenwerte und Funktionen aus     !
  1669. C           Naturwissenschaften und Technik, New series, group V, Vol. !
  1670. C           2, Geophysics of the Solid Earth, the Moon and the Planets,!
  1671. C           Berlin 1984.                                               !
  1672. C                                                                      !
  1673. C     Routine creation:  1988.01.29 by Hans-Georg Wenzel,              !
  1674. C                        Black Forest Observatory,                     !
  1675. C                        Universitaet Karlsruhe,                       !
  1676. C                        Englerstr. 7,                                 !
  1677. C                        D-76128 KARLSRUHE,                            !
  1678. C                        Germany.                                      !
  1679. C                        Tel.: 0721-6082307,                           !
  1680. C                        FAX:  0721-694552.                            !
  1681. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  1682. C                                                                      !
  1683. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1684.       IMPLICIT DOUBLE PRECISION (D)
  1685.       IMPLICIT INTEGER (I-N)
  1686.       CHARACTER CUNIT(11)*8
  1687.       DOUBLE PRECISION DGK(25),DPK(25),DGX(25),DGY(25),DGZ(25)
  1688.       DOUBLE PRECISION DP0(25),DP1(25)
  1689. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1690. C     COMMON /LOVE/ contains gravimeter factors, LOVE-numbers, SHIDA-  !
  1691. C     numbers and tilt factors for degree 2...4 at latitude DLAT:      !
  1692. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1693.       DIMENSION DGLAT(12),DHLAT(12),DKLAT(12),DLLAT(12),DTLAT(12)
  1694.       COMMON /LOVE/ DOM0,DOMR,DGLAT,DGR,DHLAT,DHR,DKLAT,DKR,DLLAT,DLR,
  1695.      1 DTLAT,DTR
  1696. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1697. C     COMMON /CONST/:                                                  !
  1698. C     DPI...        3.1415....                                         !
  1699. C     DPI2...       2.D0*DPI                                           !
  1700. C     DRAD...       DPI/180.D0                                         !
  1701. C     DRO...        180.D0/DPI                                         !
  1702. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1703.       COMMON /CONST/ DPI,DPI2,DRAD,DRO
  1704.       COMMON /UNITS/ CUNIT,IC2
  1705.       SAVE
  1706. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1707. C     Definition of parameters of Geodetic Reference System 1980.      !
  1708. C     DEA  is major semi axis in meter.                                !
  1709. C     DEE  is square of first excentricity (without dimension).        !
  1710. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1711.       DATA DEA/6378136.3D0/,DEE/6.69439795140D-3/
  1712.       IF(IPRINT.GT.0) WRITE(IUN16,17000) DEA,DEE
  1713. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1714. C     DCLAT is cos and DSLAT is sin of ellipsoidal latitude.           !
  1715. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1716.       DCLAT=DCOS(DLAT*DRAD)
  1717.       DSLAT=DSIN(DLAT*DRAD)
  1718. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1719. C     Compute normal gravity in m/s**2:                                !
  1720. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1721.       IF(DGRAV.LT.9.50D0) DGRAV=9.78032677D0*(1.D0+0.001931851353D0*
  1722.      1 DSLAT**2)/DSQRT(1.D0-DEE*DSLAT**2)-0.3086D-5*DH
  1723. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1724. C     Compute ellipsoidal curvature radius DN in meter.                !
  1725. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1726.       DN=DEA/DSQRT(1.D0-DEE*DSLAT**2)
  1727. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1728. C     Compute geocentric latitude DPSI in degree:                      !
  1729. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1730.       DPSI=DRO*DATAN(((DN*(1.D0-DEE)+DH)*DSLAT)/((DN+DH)*DCLAT))
  1731.       DTHET=90.D0-DPSI
  1732.       DCT=DCOS(DTHET*DRAD)
  1733.       DST=DSIN(DTHET*DRAD)
  1734. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1735. C     Compute fully normalized spherical harmonics:                    !
  1736. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1737.       CALL ETLEGN(DCT,DST,LMAX,DP0,DP1)
  1738. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1739. C     Compute geocentric radius DR in meter:                           !
  1740. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1741.       DR=DSQRT((DN+DH)**2*DCLAT**2+(DN*(1.D0-DEE)+DH)**2*DSLAT**2)
  1742.       IF(IPRINT.GT.0) WRITE(IUN16,17001) DLAT,DPSI,DLON,DH,DGRAV,DR,IC,
  1743.      1 DAZ
  1744. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1745. C     DGRAV*10.**9:nm/s**2,DRO*3600.*10.**3:radian to mas              !
  1746. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1747.       DF=DRO*3.600D-3/DGRAV
  1748. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1749. C     Compute latitude dependent elastic parameters from Wahr-Dehant-  !
  1750. C     Zschau model:                                                    !
  1751. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1752.       CALL ETLOVE(IUN16,IPRINT,DLAT,DH)
  1753. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1754. C     DCPSI is cos and DSPSI is sin of geocentric latitude.            !
  1755. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1756.       DCPSI=DCOS(DPSI*DRAD)
  1757.       DSPSI=DSIN(DPSI*DRAD)
  1758. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1759. C     Compute spherical geodetic coefficients.                         !
  1760. C     DGK contains coefficients for potential              in m**2/s**2!
  1761. C     DGX contains coefficients for north    accelerations in nm/s**2. !
  1762. C     DGY contains coefficients for east     accelerations in nm/s**2. !
  1763. C     DGZ contains coefficients for vertical accelerations in nm/s**2. !
  1764. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1765.       DRDA=DR/DEA
  1766.       DO 10 LI=2,LMAX
  1767.       DRDADL=DRDA**LI
  1768.       DO 10 MI=0,LI
  1769.       J=LI*(LI+1)/2+MI-2
  1770.       DGK(J)=      DRDADL*DP0(J)
  1771.       DGX(J)=-1.D0*DRDADL/DR*DP1(J)*1.D9
  1772.       DGY(J)=      DRDADL*DBLE(MI)/(DR*DST)*DP0(J)*1.D9
  1773.       DGZ(J)=      DRDADL*DBLE(LI)/DR*DP0(J)*1.D9
  1774.    10 CONTINUE
  1775.       DO 20 I=1,25
  1776.    20 DPK(I)=0.D0
  1777. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1778. C     Compute geodetic coefficients for tidal acceleration vector      !
  1779. C     orientated to ellipsoidal coordinate system stored in            !
  1780. C     DGX (north), DGY (east) and DGZ (upwards), all in nm/s**2.       !
  1781. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1782.       DCDLAT=DCLAT*DCPSI+DSLAT*DSPSI
  1783.       DSDLAT=DSLAT*DCPSI-DCLAT*DSPSI
  1784.       DO 50 I=1,25
  1785.       DUMMY =DCDLAT*DGX(I)-DSDLAT*DGZ(I)
  1786.       DGZ(I)=(DSDLAT*DGX(I)+DCDLAT*DGZ(I))
  1787.       DGX(I)=DUMMY
  1788.    50 CONTINUE
  1789.       IC2=IC+2
  1790.       DCAZ=DCOS(DAZ*DRAD)
  1791.       DSAZ=DSIN(DAZ*DRAD)
  1792.       GOTO(100,200,300,400,500,600,700,800,900,1000,1100),IC2
  1793. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1794. C     IC=-1, compute geodetic coefficients for tidal potential         !
  1795. C     (m**2/s**2).                                                     !
  1796. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1797.   100 CONTINUE
  1798.       GOTO 2000
  1799.   200 CONTINUE
  1800. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1801. C     IC=0, compute geodetic coefficients for vertical component       !
  1802. C           (gravity tide in nm/s**2).                                 !
  1803. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1804.       DO 210 I=1,25
  1805.       DGK(I)=DGZ(I)
  1806.   210 DPK(I)=180.0D0
  1807.       GOTO 2000
  1808. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1809. C     IC=1, compute geodetic coefficients for horizontal component     !
  1810. C           (tidal tilt) in azimuth DAZ, in mas.                       !
  1811. C     DF:mas/(nm/s**2), DGX(I),DGY(I): nm/s**2                         !
  1812. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1813.   300 CONTINUE
  1814.       DO 310 I=1,12
  1815.       DGK(I)=DSQRT((DGX(I)*DCAZ)**2+(DGY(I)*DSAZ)**2)*DF
  1816.       DPK(I)=0.D0
  1817.       IF(DGX(I)*DCAZ.EQ.0.D0.AND.DGY(I)*DSAZ.EQ.0.D0) GOTO 310
  1818.       DPK(I)=DRO*DATAN2(DGY(I)*DSAZ,DGX(I)*DCAZ)
  1819.   310 CONTINUE
  1820.       GOTO 2000
  1821. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1822. C     IC=2, compute geodetic coefficients for vertical displacement    !
  1823. C           in mm.                                                     !
  1824. C     DGK(I):m**2/s**2, DGRAV:m/s**2, 10**3 conversion to mm           !
  1825. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1826.   400 CONTINUE
  1827.       DFAK=1.D3/DGRAV
  1828.       DO 410 I=1,12
  1829.       DGK(I)=DGK(I)*DHLAT(I)*DFAK
  1830.   410 DPK(I)=0.0D0
  1831.       WRITE(IUN16,*) '*****The component',IC,' has never been tested !'
  1832.       GOTO 2000
  1833. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1834. C     IC=3, compute geodetic coefficients for horizontal displacement  !
  1835. C           in azimuth DAZ in mm.                                      !
  1836. C     DGRAV*10.**9:nm/s**2,10.**3:conversion to mm (corr. 2004.02.18)  !
  1837. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1838.   500 CONTINUE
  1839.       DFAK=1.D-6*DR/DGRAV
  1840.       DO 510 I=1,12
  1841.       DGK(I)=DSQRT((DGX(I)*DCAZ)**2+(DGY(I)*DSAZ)**2)*DLLAT(I)*DFAK
  1842.       DPK(I)=0.D0
  1843.       IF(DGX(I)*DCAZ.EQ.0.D0.AND.DGY(I)*DSAZ.EQ.0.D0) GOTO 510
  1844.       DPK(I)=DRO*DATAN2(DGY(I)*DSAZ,DGX(I)*DCAZ)
  1845.   510 CONTINUE
  1846.       WRITE(IUN16,*) '*****The component',IC,' has never been tested !'
  1847.       GOTO 2000
  1848. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1849. C     IC=4, compute geodetic coefficients for vertical strain at the   !
  1850. C           Earth's deformed surface in 10**-9 units = nstr.           !
  1851. C           We use a spherical approximation for the vertical strain,  !
  1852. C           i.e. eps(rr) , and a POISSON ratio of 0.25 (see ZUERN and  !
  1853. C           WILHELM 1984, p. 282).                                     !
  1854. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1855.   600 CONTINUE
  1856.       DPOISS=0.25D0
  1857.       DFAK=1.D9*DPOISS/(DPOISS-1.D0)
  1858.       DO 610 I=1,3
  1859.   610 DGK(I)=DGK(I)*DFAK*(2.D0*DHLAT(I)-2.D0*3.D0*DLLAT(I))/(DGRAV*DR)
  1860.       DO 620 I=4,7
  1861.   620 DGK(I)=DGK(I)*DFAK*(2.D0*DHLAT(I)-3.D0*4.D0*DLLAT(I))/(DGRAV*DR)
  1862.       DO 630 I=8,12
  1863.   630 DGK(I)=DGK(I)*DFAK*(2.D0*DHLAT(I)-4.D0*5.D0*DLLAT(I))/(DGRAV*DR)
  1864.       DO 640 I=1,12
  1865.   640 DPK(I)=0.0D0
  1866.       GOTO 2000
  1867. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1868. C     IC=5, compute geodetic coefficients for horizontal strain        !
  1869. C           in azimuth DAZ, in 10**-9 units.                           !
  1870. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1871.   700 CONTINUE
  1872.       DTHETA=(90.D0-DPSI)*DRAD
  1873.       DAZR=(DAZ+180.D0)*DRAD
  1874.       DCAZ =DCOS(DAZR)
  1875.       DSAZ =DSIN(DAZR)
  1876.       DSAZ2=DSIN(2.D0*DAZR)
  1877.       DCSTS=-0.5D0*DSIN(2.D0*DAZR)
  1878.       DCT=DSPSI
  1879.       DST=DCPSI
  1880.       DCT2=DCT*DCT
  1881.       DST2=DST*DST
  1882.       DCC2=DCOS(2.D0*DPSI*DRAD)
  1883.       DC2T=-DCC2
  1884.       DCOTT =1.D0/DTAN(DTHETA)
  1885.       DCOTT2=1.D0/DTAN(2.D0*DTHETA)
  1886.       DFAK=1.D9/(DR*DGRAV)
  1887. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1888. C     Real part is stored in DGX, imaginary part is stored in DGY.     !
  1889. C     Formulas were given by Dr. W. Zuern, BFO Schiltach (personal     !
  1890. C     communication) and tested against horizontal strain computed     !
  1891. C     (with lower precision) by program ETIDEL (made by Bilham).       !
  1892. C     Results agreed to 0.3 % and 0.1 degree for most of the waves,    !
  1893. C     except for 2N2 and L2 (deviation of 3 %).                        !
  1894. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1895.       DGX(1)=(DHLAT(1)-(6.D0*DLLAT(1)*DC2T)/(3.D0*DCT2-1.D0))*DCAZ**2
  1896.      1      +(DHLAT(1)-(6.D0*DLLAT(1)*DCT2)/(3.D0*DCT2-1.D0))*DSAZ**2
  1897.       DGY(1)=0.D0
  1898.       DGX(2)=(DHLAT(2)-4.D0*DLLAT(2))*DCAZ**2+(DHLAT(2)-DLLAT(2)/DST2
  1899.      1 +2.D0*DLLAT(2)*DCOTT*DCOTT2)*DSAZ**2
  1900.       DGY(2)=2.D0*DLLAT(2)*(2.D0*DCOTT2-DCOTT)*DCSTS/DST
  1901.       DGX(3)=(DHLAT(3)+2.D0*DLLAT(3)*(DCOTT*DCOTT-1.D0))*DCAZ**2
  1902.      1 +(DHLAT(3)-4.D0*DLLAT(3)/DST2+2.D0*DLLAT(3)*DCOTT*DCOTT)*DSAZ**2
  1903.       DGY(3)=4.D0*DLLAT(3)*DCOTT*DCSTS/DST
  1904.       DGX(4)=(DHLAT(4)+DLLAT(4)*(33.D0-45.D0*DCT2)/(5.D0*DCT2-3.D0))*
  1905.      1 DCAZ**2+(DHLAT(4)-DLLAT(4)*(1.D0+10.D0*DCT2/(5.D0*DCT2-3.D0)))*
  1906.      2 DSAZ**2
  1907.       DGY(4)=0.D0
  1908.       DGX(5)=(DHLAT(5)-DLLAT(5)*(1.D0+10.D0*(1.D0-4.D0*DCT2)/
  1909.      1 (1.D0-5.D0*DCT2)))*DCAZ**2+(DHLAT(5)+DLLAT(5)*
  1910.      2 (DCOTT*DCOTT-1.D0/DST2-10.D0*DCT2/(5.D0*DCT2-1.D0)))*DSAZ**2
  1911.       DGY(5)=-20.D0*DLLAT(5)*DCT*DCSTS/(5.D0*DCT2-1.D0)
  1912.       DGX(6)=(DHLAT(6)+DLLAT(6)*(2.D0*DCOTT*DCOTT-7.D0))*DCAZ**2
  1913.      1 +(DHLAT(6)+DLLAT(6)*(2.D0*DCOTT*DCOTT-1.D0-4.D0/DST2))*DSAZ**2
  1914.       DGY(6)=-4.D0*DLLAT(6)*(DCOTT-1.D0/DCOTT)*DCSTS/DST
  1915.       DGX(7)=(DHLAT(7)+DLLAT(7)*(6.D0*DCOTT*DCOTT-3.D0))*DCAZ**2
  1916.      1 +(DHLAT(7)+DLLAT(7)*(3.D0*DCOTT*DCOTT-9.D0/DST2))*DSAZ**2
  1917.       DGY(7)=12.D0*DLLAT(7)*DCOTT*DCSTS/DST
  1918.       DGX(8)=(DHLAT(8)-4.D0*DLLAT(8)*(4.D0-3.D0*(5.D0*DCT2-1.D0)/
  1919.      1 (35.D0*DCT2*DCT2-30.D0*DCT2+3.D0)))*DCAZ**2+
  1920.      2 (DHLAT(8)-4.D0*DLLAT(8)*(1.D0+3.D0*(5.D0*DCT2-1.D0)/
  1921.      3 (35.D0*DCT2*DCT2-30.D0*DCT2+3.D0)))*DSAZ**2
  1922.       DGY(8)=0.D0
  1923.       DGX(9)=  (DHLAT(9)-2.D0*DLLAT(9)*(8.D0-3.D0/(7.D0*DCT2-3.D0)))*
  1924.      1 DCAZ**2+(DHLAT(9)-2.D0*DLLAT(9)*(2.D0+3.D0/(7.D0*DCT2-3.D0)))*
  1925.      2 DSAZ**2
  1926.       DGY(9)=DLLAT(9)*3.D0/DCT*(1.D0+2.D0/(7.D0*DCT2-3.D0))*DSAZ2
  1927.       DGX(10)=(DHLAT(10)-4.D0*DLLAT(10)*(4.D0+3.D0*DCT2/
  1928.      1 (7.D0*DCT2**2-8.D0*DCT2+1.D0)))*DCAZ**2
  1929.      2       +(DHLAT(10)-4.D0*DLLAT(10)*(1.D0-3.D0*DCT2/
  1930.      2 (7.D0*DCT2**2-8.D0*DCT2+1.D0)))*DSAZ**2
  1931.       DGY(10)=-DLLAT(10)*6.D0*DCT/DST**2*(1.D0-4.D0/(7.D0*DCT2-1.D0))*
  1932.      1 DSAZ2
  1933.       DGX(11)=(DHLAT(11)-2.D0*DLLAT(11)*(8.D0-3.D0/DST2))*DCAZ**2
  1934.      1       +(DHLAT(11)-2.D0*DLLAT(11)*(2.D0+3.D0/DST2))*DSAZ**2
  1935.       DGY(11)= DLLAT(11)*3.D0/DCT*(3.D0-2.D0/DST2)*DSAZ2
  1936.       DGX(12)=(DHLAT(12)-4.D0*DLLAT(12)*(4.D0-3.D0/DST2))*DCAZ**2
  1937.      1       +(DHLAT(12)-4.D0*DLLAT(12)*(1.D0+3.D0/DST2))*DSAZ**2
  1938.       DGY(12)= DLLAT(12)*12.D0*DCT/DST2*DSAZ2
  1939.       DO 710 I=1,12
  1940.       DGK(I)=DGK(I)*DSQRT(DGX(I)**2+DGY(I)**2)*DFAK
  1941.   710 DPK(I)=DPK(I)+DATAN2(DGY(I),DGX(I))*DRO
  1942.       GOTO 2000
  1943. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1944. C     IC=6, compute geodetic coefficients for areal strain             !
  1945. C           in 10**-9 units = nstr.                                    !
  1946. C           We use a spherical approximation for the aereal strain,    !
  1947. C           i.e. eps(t,t) + eps(l,l), (see ZUERN and WILHELM 1984,     !
  1948. C           p. 282).                                                   !
  1949. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1950.   800 CONTINUE
  1951.       DO 810 I=1,3
  1952.   810 DGK(I)=DGK(I)*(2.D0*DHLAT(I)-2.D0*3.D0*DLLAT(I))/(DGRAV*DR)*1.D9
  1953.       DO 820 I=4,7
  1954.   820 DGK(I)=DGK(I)*(2.D0*DHLAT(I)-3.D0*4.D0*DLLAT(I))/(DGRAV*DR)*1.D9
  1955.       DO 830 I=8,12
  1956.   830 DGK(I)=DGK(I)*(2.D0*DHLAT(I)-4.D0*5.D0*DLLAT(I))/(DGRAV*DR)*1.D9
  1957.       DO 840 I=1,12
  1958.   840 DPK(I)=0.0D0
  1959.       GOTO 2000
  1960. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1961. C     IC=7, compute geodetic coefficients for shear tidal strain       !
  1962. C           at the Earth's deformed surface in 10**-9 units = nstr.    !
  1963. C           We use a spherical approximation, i.e. eps(t,l)            !
  1964. C     Attention: this component has never been tested !!!!             !
  1965. C     corr. 2005/06/29                                                 !
  1966. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1967.   900 CONTINUE
  1968.       DTHETA=(90.D0-DPSI)*DRAD
  1969. c      DAZR=(DAZ+180.D0)*DRAD
  1970. c      DCAZ =DCOS(DAZR)
  1971. c      DSAZ =DSIN(DAZR)
  1972. c      DSAZ2=DSIN(2.D0*DAZR)
  1973. c      DCSTS=-0.5D0*DSIN(2.D0*DAZR)
  1974.       DCT=DSPSI
  1975.       DST=DCPSI
  1976.       DCT2=DCT*DCT
  1977.       DST2=DST*DST
  1978.       DCC2=DCOS(2.D0*DPSI*DRAD)
  1979.       DC2T=-DCC2
  1980.       DCOTT =1.D0/DTAN(DTHETA)
  1981.       DCOTT2=1.D0/DTAN(2.D0*DTHETA)
  1982.       DFAK=1.D9/(DR*DGRAV)
  1983.       DGY(1)=0.D0
  1984. c      DGY(2)=2.D0*DLLAT(2)*(2.D0*DCOTT2-DCOTT)*DCSTS/DST
  1985.       DGY(2)=2.D0*DLLAT(2)*(2.D0*DCOTT2-DCOTT)/DST
  1986. c      DGY(3)=4.D0*DLLAT(3)*DCOTT*DCSTS/DST
  1987.       DGY(3)=4.D0*DLLAT(3)*DCOTT/DST
  1988.       DGY(4)=0.D0
  1989. c      DGY(5)=-20.D0*DLLAT(5)*DCT*DCSTS/(5.D0*DCT2-1.D0)
  1990.       DGY(5)=-20.D0*DLLAT(5)*DCT/(5.D0*DCT2-1.D0)
  1991. c      DGY(6)=-4.D0*DLLAT(6)*(DCOTT-1.D0/DCOTT)*DCSTS/DST
  1992.       DGY(6)=-4.D0*DLLAT(6)*(DCOTT-1.D0/DCOTT)/DST
  1993. c      DGY(7)=12.D0*DLLAT(7)*DCOTT*DCSTS/DST
  1994.       DGY(7)=12.D0*DLLAT(7)*DCOTT/DST
  1995.       DGY(8)=0.D0
  1996. c      DGY(9)=DLLAT(9)*3.D0/DCT*(1.D0+2.D0/(7.D0*DCT2-3.D0))*DSAZ2
  1997.       DGY(9)=DLLAT(9)*3.D0/DCT*(1.D0+2.D0/(7.D0*DCT2-3.D0))
  1998. c      DGY(10)=-DLLAT(10)*6.D0*DCT/DST**2*(1.D0-4.D0/(7.D0*DCT2-1.D0))*
  1999. c     1 DSAZ2
  2000.       DGY(10)=-DLLAT(10)*6.D0*DCT/DST**2*(1.D0-4.D0/(7.D0*DCT2-1.D0))
  2001. c      DGY(11)=DLLAT(11)*3.D0/DCT*(3.D0-2.D0/DST2)*DSAZ2
  2002.       DGY(11)=DLLAT(11)*3.D0/DCT*(3.D0-2.D0/DST2)
  2003. c      DGY(12)=DLLAT(12)*12.D0*DCT/DST2*DSAZ2
  2004.       DGY(12)=DLLAT(12)*12.D0*DCT/DST2
  2005.       DO 910 I=1,12
  2006.       DGK(I)=DGK(I)*DGY(I)*DFAK
  2007.   910 DPK(I)=0.D0
  2008.       WRITE(IUN16,*) ' ***** The shear strain has never been tested !'
  2009.       GOTO 2000
  2010. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2011. C     IC=8, compute geodetic coefficients for volume strain            !
  2012. C           at the Earth's deformed surface in 10**-9 units = nstr.    !
  2013. C           We use a spherical approximation, i.e. eps(t,t)+eps(l,l).  !
  2014. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2015.  1000 CONTINUE
  2016.       DPOISS=0.25D0
  2017.       DFAK=1.D9*(1.D0-2.D0*DPOISS)/(1.D0-DPOISS)
  2018.       DO 1010 I=1,3
  2019.  1010 DGK(I)=DGK(I)*DFAK*(2.D0*DHLAT(I)-2.D0*3.D0*DLLAT(I))/(DGRAV*DR)
  2020.       DO 1020 I=4,7
  2021.  1020 DGK(I)=DGK(I)*DFAK*(2.D0*DHLAT(I)-3.D0*4.D0*DLLAT(I))/(DGRAV*DR)
  2022.       DO 1030 I=8,12
  2023.  1030 DGK(I)=DGK(I)*DFAK*(2.D0*DHLAT(I)-4.D0*5.D0*DLLAT(I))/(DGRAV*DR)
  2024.       DO 1040 I=1,12
  2025.  1040 DPK(I)=0.0D0
  2026.       GOTO 2000
  2027. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2028. C     IC=9, compute geodetic coefficients for static ocean tides in mm.!
  2029. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2030.  1100 CONTINUE
  2031.       DFAK=1.D3/DGRAV
  2032.       DO 1110 I=1,25
  2033.       DGK(I)=DGK(I)*DFAK
  2034.  1110 DPK(I)=0.0D0
  2035.  2000 CONTINUE
  2036. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2037. C     Print geodetic coefficients:                                     !
  2038. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2039.       IF(IPRINT.EQ.0) RETURN
  2040.       WRITE(IUN16,17003) IC,DAZ,(DGK(I),CUNIT(IC2),DPK(I),I=1,12)
  2041.       if(ic.gt.0.and.ic.lt.9)go to 5000
  2042.       WRITE(IUN16,17004)        (DGK(I),CUNIT(IC2),DPK(I),I=13,25)
  2043.  5000 CONTINUE
  2044.       IF(IPRINT.GT.0) WRITE(IUN16,17005)
  2045.       RETURN
  2046. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2047. C     Format statements:                                               !
  2048. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2049. 17000 FORMAT('      Routine ETGCON, version 1997.03.03.'//
  2050.      1'      Computation of geodetic coefficients'//
  2051.      3'      Parameters of Geodetic Reference System 1980:'/
  2052.      4'      Major semi axis                  ',F12.0,'  m'/
  2053.      5'      1. excentricity                  ',F12.8/)
  2054. 17001 FORMAT('      Station parameters:'//
  2055.      1'      Latitude                       ',F12.6,' deg'/
  2056.      2'      Geocentric latitude            ',F12.6,' deg'/
  2057.      3'      Longitude                      ',F12.6,' deg'/
  2058.      4'      Height                         ',F12.3,' m'/
  2059.      5'      Gravity                        ',F12.6,' m/s**2'/
  2060.      6'      Geocentric radius              ',F12.3,' m'/
  2061.      7'      Component of observations      ',I12/
  2062.      8'      Azimuth from north direction   ',F12.6,' deg'//)
  2063. 17003 FORMAT(/'      Geodetic coefficients and phases for component',I4/
  2064.      1'      azimuth:',F12.6,' degree'//
  2065.      2'      GC 2,0',F14.8,2X,A8,2X,F14.6,' deg'/
  2066.      3'      GC 2,1',F14.8,2X,A8,2X,F14.6,' deg'/
  2067.      4'      GC 2,2',F14.8,2X,A8,2X,F14.6,' deg'/
  2068.      5'      GC 3,0',F14.8,2X,A8,2X,F14.6,' deg'/
  2069.      6'      GC 3,1',F14.8,2X,A8,2X,F14.6,' deg'/
  2070.      7'      GC 3,2',F14.8,2X,A8,2X,F14.6,' deg'/
  2071.      8'      GC 3,3',F14.8,2X,A8,2X,F14.6,' deg'/
  2072.      9'      GC 4,0',F14.8,2X,A8,2X,F14.6,' deg'/
  2073.      *'      GC 4,1',F14.8,2X,A8,2X,F14.6,' deg'/
  2074.      1'      GC 4,2',F14.8,2X,A8,2X,F14.6,' deg'/
  2075.      2'      GC 4,3',F14.8,2X,A8,2X,F14.6,' deg'/
  2076.      3'      GC 4,4',F14.8,2X,A8,2X,F14.6,' deg')
  2077. 17004 FORMAT(
  2078.      1'      GC 5,0',F14.8,2X,A8,2X,F14.6,' deg'/
  2079.      2'      GC 5,1',F14.8,2X,A8,2X,F14.6,' deg'/
  2080.      3'      GC 5,2',F14.8,2X,A8,2X,F14.6,' deg'/
  2081.      4'      GC 5,3',F14.8,2X,A8,2X,F14.6,' deg'/
  2082.      5'      GC 5,4',F14.8,2X,A8,2X,F14.6,' deg'/
  2083.      6'      GC 5,5',F14.8,2X,A8,2X,F14.6,' deg'/
  2084.      7'      GC 6,0',F14.8,2X,A8,2X,F14.6,' deg'/
  2085.      8'      GC 6,1',F14.8,2X,A8,2X,F14.6,' deg'/
  2086.      9'      GC 6,2',F14.8,2X,A8,2X,F14.6,' deg'/
  2087.      *'      GC 6,3',F14.8,2X,A8,2X,F14.6,' deg'/
  2088.      1'      GC 6,4',F14.8,2X,A8,2X,F14.6,' deg'/
  2089.      2'      GC 6,5',F14.8,2X,A8,2X,F14.6,' deg'/
  2090.      3'      GC 6,6',F14.8,2X,A8,2X,F14.6,' deg'/)
  2091. 17005 FORMAT(/6x,'***** Routine ETGCON finished the execution.'/)
  2092.       END
  2093. C
  2094.       SUBROUTINE ETGREN(IUN16,DJULD,ITY,ITM,ITD,DTH,NERR)
  2095. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2096. C                                                                      !
  2097. C     Routine ETGREN, version 1996.05.25 Fortran 90.                   !
  2098. C                                                                      !
  2099. C     The routine ETGREN computes Gregorian date from given Julian     !
  2100. C     date. ETGREN is a modified version of routine CALDAT given in    !
  2101. C     Fortran by                                                       !
  2102. C     Press, W.H., S.A. Teukolsky, W.T. Vetterling and B.P. Flannery   !
  2103. C     (1992):  Numerical recipes in FORTRAN: the art of scientific     !
  2104. C              computing. Second edition, Cambridge University Press   !
  2105. C              1992.                                                   !
  2106. C                                                                      !
  2107. C     The routine has been tested and found to be correct between      !
  2108. C     years -3000 and +3000.                                           !
  2109. C                                                                      !
  2110. C     Input parameter description:                                     !
  2111. C     ----------------------------                                     !
  2112. C                                                                      !
  2113. C     DJULD:       Julian date (DOUBLE PRECISION).                     !
  2114. C                                                                      !
  2115. C     Output parameter description:                                    !
  2116. C     -----------------------------                                    !
  2117. C                                                                      !
  2118. C     ITY:         year   (INTEGER).                                   !
  2119. C     ITM:         month  (INTEGER).                                   !
  2120. C     ITD:         day    (INTEGER).                                   !
  2121. C     DTH:         hour   (DOUBLE PRECISION).                          !
  2122. C     NERR:        error code, counts the number of errors which       !
  2123. C                  happened during the execution of routine ETGREN.    !
  2124. C                                                                      !
  2125. C     Execution time:                                                  !
  2126. C     ---------------                                                  !
  2127. C                                                                      !
  2128. C     2.47 microsec per call on a Pentium 100 MHz using Lahey LF90     !
  2129. C     compiler.                                                        !
  2130. C                                                                      !
  2131. C     Routine creation:  1995.11.04 by Hans-Georg Wenzel,              !
  2132. C                        Black Forest Observatory,                     !
  2133. C                        Universitaet Karlsruhe,                       !
  2134. C                        Englerstr. 7,                                 !
  2135. C                        D-76128 KARLSRUHE,                            !
  2136. C                        Germany.                                      !
  2137. C                        Tel.: 0721-6082301.                           !
  2138. C                        FAX:  0721-694552.                            !
  2139. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  2140. C     Last modification: 1996.05.25 by Hans-Georg Wenzel,              !
  2141. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2142.       IMPLICIT DOUBLE PRECISION (D)
  2143.       IMPLICIT INTEGER (I-N)
  2144.       SAVE
  2145.       DATA DGREG/2299160.499999D0/
  2146.       NERR=0
  2147.       IF(DJULD.LT.625307.D0.OR.DJULD.GT.2817153.D0) THEN
  2148.         NERR=1
  2149.         WRITE(IUN16,17050)  DJULD
  2150.       ENDIF
  2151.       JULIAN=INT(DJULD)
  2152.       DTH=12.D0
  2153.       DFRAC=DJULD-DBLE(JULIAN)
  2154.       DTH=DTH+DFRAC*24.D0
  2155.       IF(DTH.GE.23.9999D0) THEN
  2156.          DTH=DTH-24.D0
  2157.          JULIAN=JULIAN+1
  2158.       ENDIF
  2159.       IF(DJULD.GT.DGREG)  THEN
  2160. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2161. C     Cross over from Gregorian calendar procudes this correction:     !
  2162. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2163.          JALPHA=INT(((JULIAN-1867216)-0.25D0)/36524.25D0)
  2164.          JA=JULIAN+1+JALPHA-INT(0.25D0*DBLE(JALPHA))
  2165.       ELSE
  2166.          JA=JULIAN
  2167.       ENDIF
  2168.       JB=JA+1524
  2169.       JC=INT(6680.D0+((JB-2439870)-122.1D0)/365.25D0)
  2170.       JD=365*JC+INT(0.25D0*DBLE(JC))
  2171.       JE=INT((JB-JD)/30.6001D0)
  2172.       ITD=JB-JD-INT(30.6001D0*DBLE(JE))
  2173. C
  2174.       ITM=JE-1
  2175.       IF(ITM.GT.12) ITM=ITM-12
  2176.       ITY=JC-4715
  2177.       IF(ITM.GT.2) ITY=ITY-1
  2178.       RETURN
  2179. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2180. C     Format statements:                                               !
  2181. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2182. 17050 FORMAT(/' *****Error in routine ETGREN.FOR, version 1996.05.25.'/
  2183.      1' *****Julian date is:',F20.6/
  2184.      1' *****Year is less -3000 or greater +3000.'/
  2185.      2' *****Routine ETGREN has not been tested for this case.'/
  2186.      3' *****Routine ETGREN continues the execution.'/)
  2187.       END
  2188. C
  2189.       SUBROUTINE ETJULN(IUN16,ITY,ITM,ITD,DTH,DJULD)
  2190. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2191. C                                                                      !
  2192. C     Routine ETJULN, version 1996.05.25 Fortran 90.                   !
  2193. C                                                                      !
  2194. C     The routine ETJULN computes the Julian date and the modified     !
  2195. C     Julian date. ETJULN is a modified version of routine MJD given   !
  2196. C     in PASCAL by Montenbruck and Pfleger (see below).                !
  2197. C                                                                      !
  2198. C     The routine is valid for every date since year -4713.            !
  2199. C     Comparison with reference values between years -1410 and +3200   !
  2200. C     from JPL was successfully.                                       !  
  2201. C                                                                      !
  2202. C     Reference: Montenbruck, O. and T. Pfleger (1989): Astronomie mit !
  2203. C                dem Personal Computer. Springer Verlag, Berlin 1989.  !
  2204. C                                                                      !
  2205. C     Input parameter description:                                     !
  2206. C     ----------------------------                                     !
  2207. C                                                                      !
  2208. C     ITY:         Year   (INTEGER).                                   !
  2209. C     ITM:         Month  (INTEGER).                                   !
  2210. C     ITD:         Day    (INTEGER).                                   !
  2211. C     DTH:         Hour   (DOUBLE PRECISION).                          !
  2212. C                                                                      !
  2213. C     Output parameter description:                                    !
  2214. C     -----------------------------                                    !
  2215. C                                                                      !
  2216. C     DJULD:       Julian date (DOUBLE PRECISION).                     !
  2217. C                  16. April   -1410, 0.00 H is DJULD = 1206160.5D0    !
  2218. C                  31. January -1100, 0.00 H is DJULD = 1319312.5D0    !
  2219. C                  24. January -0800, 0.00 H is DJULD = 1428880.5D0    !
  2220. C                  17. January -0500, 0.00 H is DJULD = 1538448.5D0    !
  2221. C                  10. January -0200, 0.00 H is DJULD = 1648016.5D0    !
  2222. C                  03. January   100, 0.00 H is DJULD = 1757584.5D0    !
  2223. C                  29. February  400, 0.00 H is DJULD = 1867216.5D0    !
  2224. C                  20. December  699, 0.00 H is DJULD = 1976720.5D0    !
  2225. C                  15. February 1000, 0.00 H is DJULD = 2086352.5D0    !
  2226. C                  08. February 1300, 0.00 H is DJULD = 2195920.5D0    !
  2227. C                  11. February 1600, 0.00 H is DJULD = 2305488.5D0    !
  2228. C                  06. February 1900, 0.00 H is DJULD = 2415056.5D0    !
  2229. C                  01. January  1988, 0.00 H is DJULD = 2447161.5D0    !
  2230. C                  01. February 1988, 0.00 H is DJULD = 2447192.5D0    !
  2231. C                  29. February 1988, 0.00 H is DJULD = 2447220.5D0    !
  2232. C                  01. March    1988, 0.00 H is DJULD = 2447221.5D0    !
  2233. C                  01. February 2200, 0.00 H is DJULD = 2524624.5D0    !
  2234. C                  27. January  2500, 0.00 H is DJULD = 2634192.5D0    !
  2235. C                  23. January  2800, 0.00 H is DJULD = 2743760.5D0    !
  2236. C                  22. December 3002, 0.00 H is DJULD = 2817872.5D0    !
  2237. C                                                                      !
  2238. C     To obtain the modified Julian date, subtract 2400000.5 from      !
  2239. C     DJULD.                                                           !
  2240. C                                                                      !
  2241. C     Execution time:                                                  !
  2242. C     ---------------                                                  !
  2243. C                                                                      !
  2244. C     2.42 microsec per call on a Pentium 100 MHz using Lahex LF90     !
  2245. C     compiler.                                                        !
  2246. C                                                                      !
  2247. C     Routine creation:  1992.09.19 by Hans-Georg Wenzel,              !
  2248. C                        Black Forest Observatory,                     !
  2249. C                        Universitaet Karlsruhe,                       !
  2250. C                        Englerstr. 7,                                 !
  2251. C                        D-76128 KARLSRUHE,                            !
  2252. C                        Germany.                                      !
  2253. C                        Tel.: 0721-6082301.                           !
  2254. C                        FAX:  0721-694552.                            !
  2255. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  2256. C     Last modification: 1996.05.25 by Hans-Georg Wenzel.              !
  2257. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2258.       IMPLICIT DOUBLE PRECISION (D)
  2259.       SAVE
  2260.       ITYY=ITY
  2261.       IF(ITM.LT.1) GOTO 5000
  2262.       IF(ITM.GT.12) GOTO 5010
  2263.       ITMM=ITM
  2264.       DA=10000.0D0*ITYY+100.0D0*ITMM+ITD
  2265.       IF(ITMM.LE.2) THEN
  2266.          ITMM=ITMM+12
  2267.          ITYY=ITYY-1
  2268.       END IF
  2269.       IF(DA.LE.15821004.1D0) THEN
  2270.          DB=-2+(ITYY+4716)/4-1179
  2271.       ELSE
  2272.          DB=ITYY/400-ITYY/100+ITYY/4
  2273.       ENDIF
  2274.       DA=365.0D0*DBLE(ITYY)-679004.0D0
  2275.       DJULD=DA+DB+INT(30.6001D0*(ITMM+1))+DBLE(ITD)+DTH/24.D0
  2276.      1 +2400000.5D0
  2277.       RETURN
  2278.  5000 WRITE(IUN16,17050) ITY,ITM,ITD,DTH
  2279.       STOP
  2280.  5010 WRITE(IUN16,17051) ITY,ITM,ITD,DTH
  2281.       STOP
  2282. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2283. C     Format statements:                                               !
  2284. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2285. 17050 FORMAT(/' *****Error in routine ETJULN, version 1996.05.25.'/
  2286.      1' *****Month is less 1:',2X,3I4,F12.3/
  2287.      2' *****Routine ETJULN stops the execution.'/)
  2288. 17051 FORMAT(/' *****Error in routine ETJULN, version 1996.05.25.'/
  2289.      1' *****Month is greater 12:',2X,3I4,F12.3/
  2290.      2' *****Routine ETJULN stops the execution.'/)
  2291.       END
  2292. C
  2293.       SUBROUTINE ETLEGN(DCT,DST,LMAX,DP0,DP1)
  2294. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2295. C                                                                      !
  2296. C     Routine ETLEGN, version 1996.05.25 Fortran 90.                   !
  2297. C                                                                      !
  2298. C     The routine computes the fully normalized Legendre functions     !
  2299. C     and their derivatives complete to degree and order 6 by explicit !
  2300. C     formulas.                                                        !
  2301. C                                                                      !
  2302. C     Input parameter description:                                     !
  2303. C     ----------------------------                                     !
  2304. C                                                                      !
  2305. C     DCT:         DOUBLE PRECISION COS of polar distance theta, for   !
  2306. C                  which the fully normalized associated Legendre      !
  2307. C                  functions will be computed.                         !
  2308. C     DST:         DOUBLE PRECISION SIN of polar distance theta, for   !
  2309. C                  which the fully normalized associated Legendre      !
  2310. C                  functions will be computed.                         !
  2311. C                                                                      !      
  2312. C     Output parameter desription:                                     !
  2313. C     -----------------------------                                    !
  2314. C                                                                      !
  2315. C     LMAX:        Maximum degree and order, for which the fully       !
  2316. C                  normalized associated Legendre functions will be    !
  2317. C                  computed. LMAX is equal to 6.                       !
  2318. C     DP0:         DOUBLE PRECISION array of fully normalized Legendre !
  2319. C                  functions. The fully normalized Legendre function   !
  2320. C                  of degree L and order M is stored in                !
  2321. C                  DP0(J) WITH J=L*(L+1)/2+M+1.                        !
  2322. C     DP1:         DOUBLE PRECISION array of first derivatives of the  !
  2323. C                  fully normalized Legendre functions to polar        !
  2324. C                  distance theta. The first derivative of fully       !
  2325. C                  normalized Legendre function of degree L and order  !
  2326. C                  M is stored in DP1(J) WITH J=L*(L+1)/2+M-2.         !
  2327. C                                                                      !
  2328. C     Example for theta = 30 degree:                                   !
  2329. C                                                                      !
  2330. C      J    L    M    DP0(L+1,M+1)        DP1(L+1,M*1)                 !
  2331. C                                                                      !
  2332. C      1    2    0    1.39754248593737    2.90473750965556             !
  2333. C      2    2    1   -1.67705098312484    1.93649167310371             !  
  2334. C      3    2    2    0.48412291827593   -1.67705098312484             !
  2335. C      4    3    0    0.85923294280422    5.45686207907072             !
  2336. C      5    3    1   -2.22775461507770    0.35078038001005             !
  2337. C      6    3    2    1.10926495933118   -3.20217211436237             !
  2338. C      7    3    3   -0.26145625829190    1.35856656995526             !
  2339. C      8    4    0    0.07031250000000    7.30708934443120             !  
  2340. C      9    4    1   -2.31070453947492   -3.55756236768943             !
  2341. C     10    4    2    1.78186666957014   -3.63092188706945             !
  2342. C     11    4    3   -0.67928328497763    3.13747509950278             !
  2343. C     12    4    4    0.13865811991640   -0.96065163430871             !
  2344. C     13    5    0   -0.74051002865529    7.19033890096581             !
  2345. C     14    5    1   -1.85653752113519   -8.95158333012718             !
  2346. C     15    5    2    2.29938478949397   -1.85857059805883             !
  2347. C     16    5    3   -1.24653144252643    4.78747153809058             !
  2348. C     17    5    4    0.39826512815546   -2.52932326844337             !  
  2349. C     18    5    5   -0.07271293151948    0.62971245879506             !  
  2350. C     19    6    0   -1.34856068213155    4.35442243247701             !
  2351. C     20    6    1   -0.95021287641141  -14.00557979016896             !
  2352. C     21    6    2    2.47470311782905    2.56294916449777             !
  2353. C     22    6    3   -1.85592870532597    5.20453026842398             !
  2354. C     23    6    4    0.81047568870385   -4.55019988574613             !
  2355. C     24    6    5   -0.22704605589841    1.83519142087945             !
  2356. C     25    6    6    0.03784100931640   -0.39325530447417             !
  2357. C                                                                      !
  2358. C     Execution time:                                                  !
  2359. C     ---------------                                                  !
  2360. C                                                                      !
  2361. C     0.00006 sec per call of ETLEGN on 80486 DX4 100MHZ with NDEG=6.  !
  2362. C                                                                      !
  2363. C     Program creation:  1995.03.23 by Hans-Georg Wenzel,              !
  2364. C                        Geodaetisches Institut,                       !
  2365. C                        Universitaet Karlsruhe,                       !
  2366. C                        Englerstr. 7,                                 !
  2367. C                        D-76128 KARLSRUHE,                            !
  2368. C                        Germany.                                      !
  2369. C                        Tel.: 0721-6082301.                           !
  2370. C                        FAX:  0721-694552.                            !
  2371. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  2372. C     Last modification: 1996.05.25 by Hans-Georg Wenzel.              !
  2373. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2374.       IMPLICIT DOUBLE PRECISION (D)
  2375.       DOUBLE PRECISION DP0(25),DP1(25)
  2376.       SAVE
  2377.       LMAX=6
  2378.       DST2=DST*DST
  2379.       DCT2=DCT*DCT
  2380.       DST3=DST2*DST
  2381.       DCT3=DCT2*DCT
  2382.       DST4=DST3*DST
  2383.       DCT4=DCT3*DCT
  2384.       DST5=DST4*DST
  2385.       DCT5=DCT4*DCT
  2386.       DST6=DST5*DST
  2387.       DCT6=DCT5*DCT
  2388. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2389. C     Compute fully normalized Legendre functions:                     !
  2390. C     Degree 2:                                                        !
  2391. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2392.       DP0(01)= DSQRT(5.D0/4.D0)*(3.D0*DCT2-1.D0)
  2393.       DP0(02)= DSQRT(15.D0)*DCT*DST
  2394.       DP0(03)= DSQRT(15.D0/4.D0)*DST2
  2395. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2396. C     Degree 3:                                                        !
  2397. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
  2398.       DP0(04)= DSQRT(7.D0/4.D0)*DCT*(5.D0*DCT2-3.D0)
  2399.       DP0(05)= DSQRT(21.D0/8.D0)*DST*(5.D0*DCT2-1.D0)
  2400.       DP0(06)= DSQRT(105.D0/4.D0)*DST2*DCT
  2401.       DP0(07)= DSQRT(35.D0/8.D0)*DST3
  2402. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2403. C     Degree 4:                                                        !
  2404. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2405.       DP0(08)= 3.D0/8.D0*(3.D0-30.D0*DCT2+35.D0*DCT4)
  2406.       DP0(09)= DSQRT(45.D0/8.D0)*DST*DCT*(7.D0*DCT2-3.D0)
  2407.       DP0(10)= DSQRT(45.D0/16.D0)*(-1.D0+8.D0*DCT2-7.D0*DCT4)
  2408.       DP0(11)= DSQRT(315.D0/8.D0)*DST3*DCT
  2409.       DP0(12)= DSQRT(315.D0/64.D0)*DST4
  2410. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2411. C     Degree 5:                                                        !
  2412. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2413.       DP0(13)= DSQRT(11.D0/64.D0)*DCT*(15.D0-70.D0*DCT2+63.D0*DCT4)
  2414.       DP0(14)= DSQRT(165.D0/64.D0)*DST*(1.D0-14.D0*DCT2+21.D0*DCT4)
  2415.       DP0(15)= DSQRT(1155.D0/16.D0)*DCT*(-1.D0+4.D0*DCT2-3.D0*DCT4)
  2416.       DP0(16)= DSQRT(385.D0/128.D0)*DST3*(9.D0*DCT2-1.D0)
  2417.       DP0(17)= DSQRT(3465.D0/64.D0)*DCT*DST4
  2418.       DP0(18)= DSQRT(693.D0/128.D0)*DST5
  2419. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2420. C     Degree 6:                                                        !
  2421. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2422.       DP0(19)= DSQRT(13.D0/256.D0)*(-5.D0+105.D0*DCT2-315.D0*DCT4
  2423.      1           +231.D0*DCT6)
  2424.       DP0(20)= DSQRT(273.D0/64.D0)*DST*DCT*(5.D0-30.D0*DCT2
  2425.      1           +33.D0*DCT4)
  2426.       DP0(21)= DSQRT(2730.D0/1024.D0)*(1.D0-19.D0*DCT2+51.D0*DCT4
  2427.      1           -33.D0*DCT6)
  2428.       DP0(22)= DSQRT(2730.D0/256.D0)*DST3*DCT*(-3.D0+11.D0*DCT2)
  2429.       DP0(23)= DSQRT(819.D0/256.D0)*(-1.D0+13.D0*DCT2-23.D0*DCT4
  2430.      1           +11.D0*DCT6)
  2431.       DP0(24)= DSQRT(18018.D0/256.D0)*DST5*DCT
  2432.       DP0(25)= DSQRT(6006.D0/1024.D0)*DST6
  2433. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2434. C     Compute derivations with respect to theta:                       !
  2435. C     Degree 2:                                                        !
  2436. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2437.       DP1(01)=-DSQRT(45.D0)*DST*DCT
  2438.       DP1(02)= DSQRT(15.D0)*(1.D0-2.D0*DST2)
  2439.       DP1(03)= DSQRT(15.D0)*DST*DCT
  2440. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2441. C     Degree 3:                                                        !
  2442. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2443.       DP1(04)=-DSQRT(63.D0/4.D0)*DST*(5.D0*DCT2-1.D0)
  2444.       DP1(05)= DSQRT(21.D0/8.D0)*DCT*(4.D0-15.D0*DST2)
  2445.       DP1(06)=-DSQRT(105.D0/4.D0)*DST*(1.D0-3.D0*DCT2)
  2446.       DP1(07)= DSQRT(315.D0/8.D0)*DST2*DCT
  2447. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2448. C     Degree 4:                                                        !
  2449. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2450.       DP1(08)=-15.D0/2.D0*(7.D0*DCT2-3.D0)*DST*DCT
  2451.       DP1(09)= DSQRT(45.D0/8.D0)*(3.D0-27.D0*DCT2+28.D0*DCT4)
  2452.       DP1(10)=-DSQRT(45.D0)*(4.D0-7.D0*DCT2)*DST*DCT
  2453.       DP1(11)= DSQRT(315.D0/8.D0)*DST2*(4.D0*DCT2-1.D0)
  2454.       DP1(12)= DSQRT(315.D0/4.D0)*DST3*DCT
  2455. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2456. C     Degree 5:                                                        !
  2457. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
  2458.       DP1(13)=-DSQRT(2475.D0/64.D0)*DST*(1.D0-14.D0*DCT2+21.D0*DCT4)
  2459.       DP1(14)= DSQRT(165.D0/64.D0)*DCT*(29.D0-126.D0*DCT2
  2460.      1            +105.D0*DCT4)
  2461.       DP1(15)=-DSQRT(1155.D0/16.D0)*DST*(-1.D0+12.D0*DCT2-15.D0*DCT4)
  2462.       DP1(16)= DSQRT(3465.D0/128.D0)*DST2*DCT*(15.D0*DCT2-7.D0)
  2463.       DP1(17)=-DSQRT(3465.D0/64.D0)*DST*(1.D0-6.D0*DCT2+5.D0*DCT4)
  2464.       DP1(18)= DSQRT(17325.D0/128.D0)*DCT*DST4
  2465. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2466. C     Degree 6:                                                        !
  2467. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
  2468.       DP1(19)=-DSQRT(5733.D0/64.D0)*DST*DCT*(5.D0-30.D0*DCT2
  2469.      1            +33.D0*DCT4)
  2470.       DP1(20)=-DSQRT(273.D0/64.D0)*(5.D0-100.D0*DCT2+285.D0*DCT4
  2471.      1            -198.D0*DCT6)
  2472.       DP1(21)=-DSQRT(1365.D0/128.D0)*DST*DCT*(-19.D0+102.D0*DCT2
  2473.      1            -99.D0*DCT4)
  2474.       DP1(22)= DSQRT(12285.D0/128.D0)*DST2*(1.D0-15.D0*DCT2
  2475.      1            +22.D0*DCT4)
  2476.       DP1(23)=-DSQRT(819.D0/64.D0)*DCT*DST*(13.D0-46.D0*DCT2
  2477.      1            +33.D0*DCT4)
  2478.       DP1(24)= DSQRT(9009.D0/128.D0)*DST4*(6.D0*DCT2-1.D0)
  2479.       DP1(25)= DSQRT(27027.D0/128.D0)*DST5*DCT
  2480.       RETURN
  2481.       END
  2482. C
  2483.       SUBROUTINE ETLOVE(IUN16,IPRINT,DLAT,DELV)
  2484. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2485. C                                                                      !
  2486. C     Routine ETLOVE, version 1996.05.25 Fortran 90.                   !
  2487. C                                                                      !
  2488. C     The routine computes latitude dependent LOVE-numbers DH, DK,     !
  2489. C     SHIDA-numbers DL, gravimeter factors DG and tilt factors DT      !
  2490. C     using the so-called Wahr-Dehant-Zschau model.                    !
  2491. C                                                                      !
  2492. C     Body tide amplitude factors for Wahr-Dehant-Zschau model.        !  
  2493. C     The NDFW resonance is approximated by                            !
  2494. C                                                                      !  
  2495. C     G(RES) = GLAT - GR*(DOM - DOM0)/(DOMR - DOM).                    !
  2496. C                                                                      !
  2497. C     similar equations hold for the other parameters.                 !
  2498. C                                                                      !  
  2499. C     Gravimetric amplitude factors, LOVE numbers h and k for degree   !
  2500. C     0...3 have been taken from Dehant (1987), Table 7, 8 and 9       !
  2501. C     for an elliptical, uniformly rotating, oceanless Earth with      !
  2502. C     liquid outer core and inelastic mantle (PREM Earth model with    !
  2503. C     inelastic mantle from Zschau) and for the fourth degree from     !
  2504. C     Dehant et. al (1989), Table 6. The resonance factors GR have     !
  2505. C     been computed to fit the difference between body tide amplitude  !
  2506. C     factors at O1 and PSI1 from Dehant (1987), PREM model with       !
  2507. C     elastic mantle (Table 1...3). The NDFW resonance frequency is    !
  2508. C     15.073729 degree per hour = 1.004915267 CPD UT, taken from       !
  2509. C     Wahr (1981) (because it is not given in Dehant's papers).        !
  2510. C                                                                      !
  2511. C     Input parameter description:                                     !
  2512. C     ----------------------------                                     !
  2513. C                                                                      !
  2514. C     IUN16:       formatted line printer unit.                        !
  2515. C     IPRINT:      printout parameter. For IPRINT=1, the computed      !
  2516. C                  Love- and Shida- number s will be printed.          !
  2517. C     DLAT:        ellipsoidal latitude in degree.                     !
  2518. C     DELV:        ellipsoidal height in meter.                        !
  2519. C                                                                      !
  2520. C     Description of COMMON /LOVE/:                                    !
  2521. C     -----------------------------                                    !
  2522. C                                                                      !
  2523. C     DOM0:        frequency of O1 in degree per hour.                 !
  2524. C     DOMR:        frequency of the FCN eigenfrequency in degree per   !
  2525. C                  hour.                                               !
  2526. C     DGLAT:       array(1..12) containing the gravimetric factors at  !
  2527. C                  latitude DLAT.                                      !
  2528. C     DGR:         resonance factor for gravimetric factors.           !
  2529. C     DHLAT:       array(1..12) containing the Love-numbers h at       !
  2530. C                  latitude DLAT.                                      !
  2531. C     DHR:         resonance factor for the Love-number h(2,1).        !
  2532. C     DKLAT:       array(1..12) containing the Love-numbers k at       !
  2533. C                  latitude DLAT.                                      !
  2534. C     DKR:         resonance factor for the Love-number k(2,1).        !
  2535. C     DLLAT:       array(1..12) containing the Shida-numbers l at      !
  2536. C                  latitude DLAT.                                      !
  2537. C     DLR:         resonance factor for the Shida-number l(2,1).       !  
  2538. C     DTLAT:       array(1..12) containing the tilt factors at         !
  2539. C                  latitude DLAT.                                      !
  2540. C                                                                      !  
  2541. C     Reference:                                                       !
  2542. C     ----------                                                       !
  2543. C                                                                      !
  2544. C     Dehant, V. (1987): Tidal parameters for an inelastic Earth.      !
  2545. C        Physics of the Earth and Planetary Interiors, 49, 97-116,     !
  2546. C        1987.                                                         !
  2547. C                                                                      !
  2548. C     Wahr, J.M. (1981): Body tides on an elliptical, rotating,        !
  2549. C        elastic and oceanless earth. Geophysical Journal of the Royal !
  2550. C        Astronomical Society, vol. 64, 677-703, 1981.                 !
  2551. C                                                                      !
  2552. C     Zschau, J. and R. Wang (1987): Imperfect elasticity in the       !
  2553. C        Earth's mantle. Implications for earth tides and long period  !
  2554. C        deformations. Proceedings of the 9th International Symposium  !
  2555. C        on Earth Tides, New York 1987, pp. 605-629, editor J.T. Kuo,  !
  2556. C        Schweizerbartsche Verlagsbuchhandlung, Stuttgart 1987.        !
  2557. C                                                                      !
  2558. C     Routine creation:  1993.07.03 by Hans-Georg Wenzel,              !
  2559. C                        Black Forest Observatory,                     !
  2560. C                        Universitaet Karlsruhe,                       !
  2561. C                        Englerstr. 7,                                 !
  2562. C                        D-76128 KARLSRUHE,                            !
  2563. C                        Germany.                                      !
  2564. C                        Tel: 0049-721-6082307,                        !
  2565. C                        FAX: 0049-721-694552.                         !
  2566. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  2567. C     Last modification: 1996.05.25 by Hans-Georg Wenzel.              !
  2568. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2569.       IMPLICIT DOUBLE PRECISION (D)
  2570. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2571. C     The following DIMENSION statement is concerning the elastic      !
  2572. C     Earth model for the different degree and order constituents.     !
  2573. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2574.       DOUBLE PRECISION DG0(12),DGP(12),DGM(12)
  2575.       DOUBLE PRECISION DH0(12),DHP(12),DHM(12)
  2576.       DOUBLE PRECISION DK0(12),DKP(12),DKM(12)
  2577.       DOUBLE PRECISION DL0(12),DLP(12),DLM(12)
  2578.       DOUBLE PRECISION DLATP(12),DLATM(12)
  2579. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2580. C     COMMON /LOVE/ contains gravimeter factors, Love-numbers, Shida-  !
  2581. C     numbers and tilt factors for degree 2...4 at latitude DLAT:      !
  2582. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2583.       DIMENSION DGLAT(12),DHLAT(12),DKLAT(12),DLLAT(12),DTLAT(12)
  2584.       COMMON /LOVE/ DOM0,DOMR,DGLAT,DGR,DHLAT,DHR,DKLAT,DKR,DLLAT,DLR,
  2585.      1 DTLAT,DTR
  2586. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2587. C     COMMON /CONST/:                                                  !
  2588. C     DPI...        3.1415....    DPI2...       2.D0*DPI               !
  2589. C     DRAD...       DPI/180.D0    DRO...        180.D0/DPI             !
  2590. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2591.       COMMON /CONST/ DPI,DPI2,DRAD,DRO
  2592.       SAVE
  2593. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2594. C     The following DATA statements are concerning the elastic         !
  2595. C     Earth model for the different degree and order constituents.     !
  2596. C     The latitude dependency is not given for all constituents in     !
  2597. C     the Wahr-Dehant-Zschau model !!!!!!                              !
  2598. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2599.       DATA DG0/1.1576D0,1.1542D0,1.1600D0,1.0728D0,1.0728D0,1.0728D0,
  2600.      1 1.0728D0,1.0363D0,1.0363D0,1.0363D0,1.0363D0,1.0363D0/
  2601.       DATA DGP/-0.0016D0,-0.0018D0,-0.0010D0,0.D0,0.D0,0.D0,-0.0010D0,
  2602.      1 0.D0,0.D0,0.D0,0.D0,-0.000315D0/
  2603.       DATA DGM/0.0054D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  2604.      1 0.D0,0.D0/
  2605.       DATA DH0/0.6165D0,0.6069D0,0.6133D0,0.2946D0,0.2946D0,0.2946D0,
  2606.      1 0.2946D0,0.1807D0,0.1807D0,0.1807D0,0.1807D0,0.1807D0/
  2607.       DATA DHP/0.0007D0,0.0007D0,0.0005D0,0.D0,0.D0,0.D0,0.0003D0,
  2608.      1 0.D0,0.D0,0.D0,0.D0,0.00015D0/
  2609.       DATA DHM/0.0018D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  2610.      1 0.D0,0.D0/
  2611.       DATA DK0/0.3068D0,0.3009D0,0.3034D0,0.0942D0,0.0942D0,0.0942D0,
  2612.      1 0.0942D0,0.0427D0,0.0427D0,0.0427D0,0.0427D0,0.0427D0/
  2613.       DATA DKP/0.0015D0,0.0014D0,0.0009D0,0.D0,0.D0,0.D0,0.0007D0,
  2614.      1 0.D0,0.D0,0.D0,0.D0,0.00066D0/
  2615.       DATA DKM/-0.0004D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  2616.      1 0.D0,0.D0/
  2617. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2618. C     Shida-numbers:                                                   !
  2619. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2620.       DATA DL0/ 0.0840D0,0.0841D0,0.0852D0,0.0149D0,0.0149D0,0.0149D0,
  2621.      1 0.0149D0,0.0100D0,0.0100D0,0.0100D0,0.0100D0,0.0100D0/
  2622.       DATA DLP/-0.002D0,-0.002D0,-0.001D0,0.0000D0,0.0000D0,0.0000D0,
  2623.      1 0.0000D0,0.0000D0,0.0000D0,0.0000D0,0.0000D0,0.0000D0/
  2624.       DATA DLM/ 0.0000D0,0.0000D0,0.0000D0,0.0000D0,0.0000D0,0.0000D0,
  2625.      1 0.0000D0,0.0000D0,0.0000D0,0.0000D0,0.0000D0,0.0000D0/
  2626.       DATA DLATP/0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  2627.      1 0.D0,0.D0/
  2628.       DATA DLATM/0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  2629.      1 0.D0,0.D0/
  2630. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2631. C     Definition of parameters of Geodetic Reference System 1980.      !
  2632. C     DEA  is major semi axis in meter.                                !
  2633. C     DEE  is square of first excentricity (without dimnension).       !
  2634. C     DEGM is geocentric gravitational constant in m*3/s**2.           !
  2635. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2636.       DATA DEA/6378137.00D0/,DEE/6.69438002290D-3/
  2637. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2638. C     Define resonance frequency and resonance factors:                !
  2639. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2640.       DOMR=15.073729D0
  2641.       DOM0=13.943036D0
  2642.       DGR =-0.000625D0
  2643.       DHR =-0.002505D0
  2644.       DKR =-0.001261D0
  2645.       DLR =0.0000781D0
  2646. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2647. C     DCLAT is cos and DSLAT is sin of ellipsoidal latitude.           !
  2648. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2649.       DCLAT=DCOS(DLAT*DRAD)
  2650.       DSLAT=DSIN(DLAT*DRAD)
  2651. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2652. C     Compute ellipsoidal curvature radius DN in meter.                !
  2653. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2654.       DN=DEA/DSQRT(1.D0-DEE*DSLAT**2)
  2655. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2656. C     Compute geocentric latitude DPSI in degree:                      !
  2657. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2658.       DPSI=DRO*DATAN(((DN*(1.D0-DEE)+DELV)*DSLAT)/((DN+DELV)*DCLAT))
  2659.       DTHET=90.D0-DPSI
  2660.       DCT=DCOS(DTHET*DRAD)
  2661.       DCT2=DCT*DCT
  2662.       DLATP(1)=0.335410D0*(35.D0*DCT2*DCT2-30.D0*DCT2+3.D0)/
  2663.      1 (3.D0*DCT2-1.D0)
  2664.       DLATM(1) =0.894427D0/(3.D0*DCT2-1.D0)
  2665.       DLATP(2) =0.612372D0*(7.D0*DCT2-3.D0)
  2666.       DLATP(3) =0.866025D0*(7.D0*DCT2-1.D0)
  2667.       DLATP(7) =0.829156D0*(9.D0*DCT2-1.D0)
  2668.       DLATP(12)=0.806226D0*(11.D0*DCT2-1.D0)
  2669. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2670. C     Compute latitude dependent gravimeter factors DG:                !
  2671. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2672.       DO 110 I=1,12
  2673.   110 DGLAT(I)=DG0(I)+DGP(I)*DLATP(I)+DGM(I)*DLATM(I)
  2674. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2675. C     Compute latitude dependent LOVE-numbers DH (for vertical         !
  2676. C     displacement):                                                   !
  2677. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2678.       DO 120 I=1,12
  2679.   120 DHLAT(I)=DH0(I)+DHP(I)*DLATP(I)+DHM(I)*DLATM(I)
  2680. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2681. C     Compute latitude dependent LOVE-numbers DK:                      !
  2682. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2683.       DO 130 I=1,12
  2684.   130 DKLAT(I)=DK0(I)+DKP(I)*DLATP(I)+DKM(I)*DLATM(I)
  2685. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2686. C     Compute latitude dependent SHIDA-numbers DL:                     !
  2687. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2688.       DO 140 I=1,12
  2689.   140 DLLAT(I)=DL0(I)+DLP(I)*DLATP(I)+DLM(I)*DLATM(I)
  2690. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2691. C     Compute latitude dependent tilt factors DT:                      !
  2692. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2693.       DO 150 I=1,12
  2694.       DTLAT(I)=1.D0+DK0(I)-DH0(I)+DLATP(I)*(DKP(I)-DHP(I))+
  2695.      1 DLATM(I)*(DKM(I)-DHM(I))
  2696.   150 CONTINUE
  2697.       DTR=DKR-DHR
  2698.       IF(IPRINT.EQ.0) RETURN
  2699. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2700. C     Print out of parameters:                                         !
  2701. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2702.       WRITE(IUN16,17001) DOM0,DOMR,DGR,DHR,DKR,DLR,DTR
  2703.       I=0
  2704.       WRITE(IUN16,17002) DLAT
  2705.       DO 300 L=2,4
  2706.       WRITE(IUN16,17004)
  2707.       DO 300 M=0,L
  2708.       I=I+1
  2709.       WRITE(IUN16,17003)  L,M,DGLAT(I),DHLAT(I),DKLAT(I),DLLAT(I),
  2710.      1 DTLAT(I)
  2711.   300 CONTINUE
  2712. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2713. C     Format statements:                                               !
  2714. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2715. 17001 FORMAT(/6x,'Routine ETLOVE, version 1996.05.25.'/
  2716.      1 6x,'Latitude dependent parameters for an elliptical, rotating,'/
  2717.      2 6x,'inelastic and oceanless Earth from Wahr-Dehant-Zschau model.'
  2718.      3 //
  2719.      4 6x,'frequency of wave O1:',F10.6,' deg per hour'/
  2720.      5 6x,'resonance frequency :',F10.6,' deg per hour'//
  2721.      6 6x,'resonance factor for G:',F10.6/
  2722.      7 6x,'resonance factor for h:',F10.6/
  2723.      8 6x,'resonance factor for k:',F10.6/
  2724.      9 6x,'resonance factor for l:',F10.6/
  2725.      * 6x,'resonance factor for T:',F10.6/)
  2726. 17002 FORMAT(//
  2727.      1 6x,'Latitude dependent elastic parameters'//
  2728.      2 6x,'ellipsoidal latitude:',F10.4,' deg'//
  2729.      3 6x,'G    is gravimetric factor delta'/
  2730.      4 6x,'h    is LOVE-number  h'/
  2731.      5 6x,'k    is LOVE-number  k'/
  2732.      6 6x,'l    is SHIDA-number l'/
  2733.      7 6x,'T    is tilt factor gamma'//
  2734.      8 6x,'degree  order         G         h         k         l',
  2735.      9'         T')
  2736. 17003 FORMAT(6x,2I7,5F10.6)
  2737. 17004 FORMAT(' ')
  2738.       RETURN
  2739.       END
  2740. C
  2741.       SUBROUTINE ETPHAS(IUN16,IPRINT,IMODEL,DLON,DJULD)
  2742. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2743. C                                                                      !
  2744. C     Routine ETPHAS, version 1996.08.03 Fortran 90.                   !
  2745. C                                                                      !
  2746. C     The routine ETPHAS computes phases and frequencies for the tidal !
  2747. C     waves using different tidal potential catalogues which use       !
  2748. C     the Hartmann and Wenzel (1995) normalization.                    !
  2749. C                                                                      !
  2750. C     All variables with D as first character are DOUBLE PRECISION.    !
  2751. C                                                                      !
  2752. C     Input parameter description:                                     !
  2753. C     ----------------------------                                     !
  2754. C                                                                      !
  2755. C     IUN16:       Formatted line printer unit.                        !
  2756. C     IPRINT:      Printout parameter.                                 !
  2757. C                  for IPRINT = 0, nothing will be printed.            !
  2758. C                  for IPRINT = 1, a short list will be printed.       !
  2759. C                  for IPRINT = 2, a long list will be printed         !
  2760. C                  (including the tidal potential development).        !
  2761. C     IMODEL:      Parameter for selecting the tidal potential         !
  2762. C                  development.                                        !
  2763. C                  IMODEL = 1: Doodson (1921) tidal potential develop- !
  2764. C                              ment with 378 waves.                    !
  2765. C                  IMODEL = 2: Cartwright-Taylor-Edden (1973) tidal    !
  2766. C                              potential development with 505 waves.   !
  2767. C                  IMODEL = 3: Buellesfeld (1985) tidal potential      !
  2768. C                              development with 656 waves.             !
  2769. C                  IMODEL = 4: Tamura (1987) tidal potential develop-  !
  2770. C                              ment with 1200 waves.                   !
  2771. C                  IMODEL = 5: Xi (1989) tidal potential catalogue     !
  2772. C                              2933 waves.                             !      
  2773. C                  IMODEL = 6: Roosbeek (1995) tidal potential         !
  2774. C                              catalogue with ?? waves.                !
  2775. C                  IMODEL = 7: Hartmann and Wenzel (1995) tidal        !
  2776. C                              potential catalogue with 12935 waves.   !
  2777. C     DLON:        Ellipsoidal longitude referring to Geodetic         !
  2778. C                  Reference System 1980 in degree, positive east of   !
  2779. C                  Greenwhich.                                         !
  2780. C     DJULD:       Julian date of the initial epoch of tidal force     !
  2781. C                  development.                                        !
  2782. C                                                                      !
  2783. C     Output parameter description:                                    !
  2784. C     -----------------------------                                    !
  2785. C                                                                      !
  2786. C     There are no output parameters. The computes phases are trans-   !
  2787. C     to the calling program unit by COMMON /TIDWAVE/.                 !
  2788. C                                                                      !
  2789. C     COMMON /TIDWAVE/: contains tidal waves                           !
  2790. C                                                                      !  
  2791. C     NW:          Number of defined tidal waves.                      !
  2792. C     IWNR:        INTEGER array (1:12935) of wave numbers.            !
  2793. C     IAARG:       INTEGER array (1:12935,1:12) of astronomical        !
  2794. C                  argument numbers.                                   !
  2795. C     DX0:         DOUBLE PRECISION array (1:12935) of cos-coeffi-     !
  2796. C                  cients of the tidal component in units of the tidal !
  2797. C                  component.                                          !
  2798. C     DX1:         DOUBLE PRECISION array (1:12935) of time deriva-    !
  2799. C                  tives of cos-coefficients of the tidal component.   !
  2800. C     DY0:         DOUBLE PRECISION array (1:12935) of sin-coeffi-     !
  2801. C                  cients of the tidal component in units of the tidal !
  2802. C                  component.                                          !
  2803. C     DY1:         DOUBLE PRECISION array (1:12935) of time deriva-    !
  2804. C                  tives of sin-coefficients of the tidal component.   !
  2805. C                                                                      !
  2806. C                  component  unit of     unit of                      !
  2807. C                  IC         DX0,DY0     DX1,DY1                      !
  2808. C                  -1         m**2/s**2   m**2/s**2 per Julian century !
  2809. C                   0         nm/s**2     nm/s**2   per Julina century !
  2810. C                   1         mas         mas       per Julian century !
  2811. C                   2         mm          mm        per Julian century !
  2812. C                   3         mm          mm        per Julian century !
  2813. C                   4         nstr        nstr      per Julian cenrury !
  2814. C                   5         nstr        nstr      per Julian century !
  2815. C                   6         nstr        nstr      per Julian century !
  2816. C                   7         nstr        nstr      per Julian century !
  2817. C                   8         nstr        nstr      per Julian century !
  2818. C                   9         mm          mm        per Julian century !
  2819. C                                                                      !
  2820. C     DTHPH:       DOUBLE PRECISION array (1:12935) of tidal phases    !
  2821. C                  in radians at initial epoch.                        !
  2822. C     DTHFR:       DOUBLE PRECISION array (1:12935) of tidal           !
  2823. C                  frequencies in radian per hour.                     !
  2824. C     DBODY:       DOUBLE PRECISION array (1:12935) of body tide       !
  2825. C                  amplitude factors for tidal gravity and tidal tilt. !
  2826. C                  In order to compute the body tide, the coefficients !
  2827. C                  DX0, DX1, DY0 and DY1 have to be multiplied by      !
  2828. C                  DBODY.                                              !
  2829. C                                                                      !
  2830. C     Used routines:                                                   !
  2831. C     --------------                                                   !
  2832. C                                                                      !
  2833. C     ETASTN: computes astronomical elements.                          !
  2834. C     ETJULN: computes Julian date.                                    !
  2835. C     ETDDTA: computes the difference TDT minus UTC (called by ETASTN).!
  2836. C     ETPOLC: computes the difference DUT1 = UT1 - UTC.                !
  2837. C                                                                      !
  2838. C     Numerical accuracy:                                              !
  2839. C     -------------------                                              !
  2840. C                                                                      !
  2841. C     The routine has been tested under operation systems UNIX and     !
  2842. C     MS-DOS with 15 digits in DOUBLE PRECISION.                       !
  2843. C                                                                      !
  2844. C     Routine creation:  1988.04.27 by Hans-Georg Wenzel,              !
  2845. C                        Black Forest Observatory,                     !
  2846. C                        Universitaet Karlsruhe,                       !
  2847. C                        Englerstr. 7,                                 !
  2848. C                        D-76128 KARLSRUHE 1,                          !
  2849. C                        Germany.                                      !
  2850. C                        Tel: 0049-721-6082307,                        !
  2851. C                        FAX: 0049-721-694552.                         !
  2852. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  2853. C     Last modification: 1996.08.04 by Hans-Georg Wenzel.              !
  2854. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2855.       IMPLICIT DOUBLE PRECISION (D)
  2856.       IMPLICIT INTEGER (I-N)
  2857.       CHARACTER CMODEL(7)*20
  2858.       DOUBLE PRECISION DAS(11),DASP(11)
  2859.       COMMON /TIDPHAS/ DPK(25)
  2860. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2861. C     The following DIMENSION statement is concerning the number of    !
  2862. C     waves of the tidal potential development, which is 12935.        !
  2863. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2864.       COMMON /TIDWAVE/ NW,IWNR(12935),IAARG(12935,12),DX0(12935),
  2865.      1 DX1(12935),DY0(12935),DY1(12935),DTHPH(12935),DTHFR(12935),
  2866.      2 DBODY(12935)
  2867. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2868. C     COMMON /CONST/:                                                  !
  2869. C     DPI...        3.1415....                                         !
  2870. C     DPI2...       2.D0*DPI                                           !
  2871. C     DRAD...       DPI/180.D0                                         !
  2872. C     DRO...        180.D0/DPI                                         !
  2873. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2874.       COMMON /CONST/ DPI,DPI2,DRAD,DRO
  2875.       SAVE
  2876.       DATA IUN30/30/,IUN31/31/
  2877.       DATA CMODEL/'Doodson 1921 ',
  2878.      1 'CTED 1973           ','Buellesfeld 1985    ',
  2879.      2 'Tamura 1987         ','Xi 1989             ',
  2880.      3 'Roosbeek 1995       ','Hartmann+Wenzel 1995'/
  2881.       IF(IPRINT.GT.0) WRITE(IUN16,17001) CMODEL(IMODEL)
  2882.  1000 CONTINUE
  2883. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2884. C     Interpolate DUT1:                                                !
  2885. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2886.       CALL ETPOLC(IUN16,IUN30,IUN31,IPRINT,DJULD,DCLAT,DSLAT,
  2887.      1 DCLON,DSLON,DPOLX,DPOLY,DUT1,DTAI,DLOD,DGPOL,DGPOLP,DGLOD,NERR)
  2888. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2889. C     Compute astronomical elements for initial epoch:                 !
  2890. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2891.       CALL ETASTN(IUN16,IPRINT,IMODEL,DLON,DJULD,DUT1,DAS,DASP,DDT0)
  2892. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2893. C     Compute phases and frequencies:                                  !
  2894. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2895.       DO 1110 IW=1,NW
  2896.       DC2=0.D0
  2897.       DC3=0.D0
  2898.       DO 1140 J=1,11
  2899.       DC2=DC2+DBLE(IAARG(IW,J))*DAS(J)
  2900.  1140 DC3=DC3+DBLE(IAARG(IW,J))*DASP(J)
  2901.       LI=IAARG(IW,12)
  2902.       JCOF=(LI+1)*LI/2-2+IAARG(IW,1)
  2903.       DC2=DC2+DPK(JCOF)
  2904.  1160 DC2=DMOD(DC2,360.D0)
  2905.       IF(DC2.GE.0.D0) GOTO 1170
  2906.       DC2=DC2+360.D0
  2907.       GOTO 1160
  2908.  1170 DTHPH(IW)=DC2*DRAD
  2909.       DTHFR(IW)=DC3*DRAD
  2910.  1110 CONTINUE
  2911.       IF(IPRINT.EQ.0) RETURN
  2912.       WRITE(IUN16,17002) NW
  2913.       WRITE(IUN16,17003)
  2914.       RETURN
  2915. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2916. C     Format statements:                                               !
  2917. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2918. 17001 FORMAT(' Routine ETPHAS, version 1996.08.04.'//
  2919.      1' Tidal component development from tidal potential development.'//
  2920.      2 1X,A13,' tidal potential development is used.'/)
  2921. 17002 FORMAT(//' Routine ETPHAS, version 1996.08.04.'/
  2922.      1'New phases and frequencies computes for',I6,' waves.')
  2923. 17003 FORMAT(///' ***** Routine ETPHAS finished execution.'/)
  2924.       END
  2925. C
  2926.       SUBROUTINE ETPOLC(IUN16,IUN30,IUN31,IPRINT,DJULD,DCLAT,DSLAT,
  2927.      1 DCLON,DSLON,DPOLX,DPOLY,DUT1,DTAI,DLOD,DGPOL,DGPOLP,DGLOD,NERR)
  2928. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2929. C                                                                      !
  2930. C     Routine ETPOLC, version 1996.05.25 Fortran 90.                   !
  2931. C                                                                      !
  2932. C     The routine ETPOLC returns pole coordinates and correction DUT1  !
  2933. C     read from either formatted file on IUN30 or unformatted direct   !
  2934. C     access file on IUN31. In case that direct access file IUN31 does !
  2935. C     not exist, it will be established by routine ETPOLC with file    !
  2936. C     /home/hwz/eterna34/commdat/etpolut1.uft.                                  !
  2937. C                                                                      !
  2938. C     All variables with D as first character are DOUBLE PRECISION.    !
  2939. C                                                                      !
  2940. C     Input parameter description:                                     !
  2941. C     ----------------------------                                     !
  2942. C                                                                      !
  2943. C     IUN16:       Formatted line printer unit.                        !
  2944. C     IUN30:       Formatted file containing pole coordinates, DUT1    !
  2945. C                  and DTAI (e.g. file etpolut1.dat).                  !
  2946. C     IUN31:       Unformatted direct access file containing pole      !
  2947. C                  coordinates, DUT1 and DTAI. This file will be       !
  2948. C                  opened as file etpolut1.uft during the execution of !
  2949. C                  routine ETPOLC with STATUS=OLD if it exists and     !
  2950. C                  with STATUS=NEW, if it does not exist. If the       !
  2951. C                  file does not yet exist, etpolut1.uft will be       !
  2952. C                  established during the  execution of routine        !
  2953. C                  ETPOLC.                                             !
  2954. C     IPRINT:      Printout parameter.                                 !
  2955. C                  for IPRINT = 0, nothing will be printed.            !
  2956. C                  for IPRINT = 1, a short list will be printed.       !
  2957. C                  for IPRINT = 2, a long list will be printed         !
  2958. C     DJULD:       Julian date of the epoch, for which pole            !
  2959. C                  coordinates, DUT1 and DTAI will be returned.        !
  2960. C     DCLAT:       COS of latitude.                                    !
  2961. C     DSLAT:       SIN of latitude.                                    !
  2962. C     DCLON:       COS of longitude.                                   !
  2963. C     DSLON:       SIN of longitude.                                   !
  2964. C                                                                      !
  2965. C     Output parameter description:                                    !
  2966. C     -----------------------------                                    !
  2967. C                                                                      !
  2968. C     DPOLX:       X-pole coordinate in arc sec.                       !
  2969. C     DPOLY:       Y-pole coordinate in arc sec.                       !
  2970. C     DUT1:        Difference UT1 minus UTC in sec.                    !
  2971. C     DTAI:        Difference TAI minus UT1 in sec.                    !
  2972. C     DLOD:        Length of day - 86400 sec in sec.                   !
  2973. C     DGPOL:       Pole tide in nm/s**2 for a rigid earth.             !
  2974. C     DGPOLP:      Time derivative of pole tide for a rigid earth in   !
  2975. C                  nm/s**2 per day.                                    !  
  2976. C     DGLOD:       Gravity variation due to variation of the earth's   !
  2977. C                  rotation in nm/s**2.                                !
  2978. C     NERR:        Error code, counts the number of errors which       !
  2979. C                  happened during the actual call of routine ETPOLC.  !
  2980. C                  For NERR > 0, the output parameters DPOLX, DPOLY,   !
  2981. C                  DUT1, DTAI, DLOD, DGPOL, DGPOLP do not contain      !
  2982. C                  valid information (all set to zero).                !
  2983. C                  For NERR=0, the output parameters DPOLX, DPOLY,     !
  2984. C                  DUT1 and DTAI contain valid information.            !
  2985. C                                                                      !
  2986. C     Execution time:                                                  !
  2987. C     ---------------                                                  !
  2988. C                                                                      !
  2989. C     3.02 microsec per call on a 100 MHz Pentium using Lahey LF90     !
  2990. C     compiler if the file ETPOLC.UFT exists already.                  !
  2991. C                                                                      !
  2992. C     Routine creation:  1993.08.31 by Hans-Georg Wenzel,              !
  2993. C                        Black Forest Observatory,                     !
  2994. C                        Universitaet Karlsruhe,                       !
  2995. C                        Englerstr. 7,                                 !
  2996. C                        D-76128 KARLSRUHE,                            !
  2997. C                        Germany.                                      !
  2998. C                        Tel: 0049-721-6082307,                        !
  2999. C                        FAX: 0049-721-694552.                         !
  3000. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  3001. C     Last modification: 1996.05.25 by Hans-Georg Wenzel.              !
  3002. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3003.       IMPLICIT DOUBLE PRECISION (D)
  3004.       IMPLICIT INTEGER (I-N)
  3005.       CHARACTER CHEAD(8)*10,CENDH*10
  3006. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3007. C     COMMON /CONST/: to be initialzed by BLOCK DATA before the call   !
  3008. C                     of routine ETPOLC:                               !
  3009. C     DPI...        3.1415....                                         !
  3010. C     DPI2...       2.D0*DPI                                           !
  3011. C     DRAD...       DPI/180.D0                                         !
  3012. C     DRO...        180.D0/DPI                                         !
  3013. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3014.       COMMON /CONST/ DPI,DPI2,DRAD,DRO
  3015.       SAVE
  3016.       DATA DOM/7.292115D-5/,DA/6378137.D0/
  3017.       DATA CENDH/'C*********'/,ISTART/1/,IMJDO/0/
  3018.       NERR=0
  3019.       IF(ISTART.EQ.0) GOTO 1000
  3020. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3021. C     Test, whether there exist already unformatted file ETPOLUT1.UFT: !
  3022. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3023. C HP-UNIX: OPEN(UNIT=IUN31,FILE='../commdat/etpolut1.uft',
  3024. C HP-UNIX:    1 FORM='UNFORMATTED',STATUS='OLD',ACCESS='DIRECT',RECL=80,ERR=11)
  3025. C MS-DOS:
  3026.       OPEN(UNIT=IUN31,FILE='/home/hwz/eterna34/commdat/etpolut2.uft',
  3027.      1 FORM='UNFORMATTED',STATUS='OLD',ACCESS='DIRECT',RECL=32,ERR=11)
  3028.       WRITE(*,'(A$)')' FILE etpolut2.uft is existing '
  3029.       READ(IUN31,REC=1) IFIRST,ILAST
  3030.       write(*,*)ifirst,ilast
  3031.       ISTART=0
  3032.       GOTO 1000
  3033. C HP-UNIX:   11 OPEN(UNIT=IUN31,FILE='../commdat/etpolut2.uft',
  3034. C HP-UNIX:     1 FORM='UNFORMATTED',STATUS='NEW',ACCESS='DIRECT',RECL=80)
  3035. C MS-DOS:
  3036.    11 OPEN(UNIT=IUN31,FILE='/home/hwz/eterna34/commdat/etpolut2.uft',
  3037.      1 FORM='UNFORMATTED',STATUS='NEW',ACCESS='DIRECT',RECL=32)
  3038. c      REWIND IUN31
  3039. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3040. C     Read file header of tidal potential file on unit IUN30:          !
  3041. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3042.       IF(IPRINT.EQ.0) GOTO 10
  3043.       WRITE(IUN16,17001)
  3044.    10 CONTINUE
  3045.       READ(IUN30,17002)                  (CHEAD(I),I=1,8)
  3046.       WRITE(IUN16,17003)                 (CHEAD(I),I=1,8)
  3047.   100 READ(IUN30,17002)                  (CHEAD(I),I=1,8)
  3048.       IF(IPRINT.GT.1) WRITE(IUN16,17003) (CHEAD(I),I=1,8)
  3049.       IF(CHEAD(1).NE.CENDH) GOTO 100
  3050. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3051. C     Read data:                                                       !
  3052. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3053.       IREC=2
  3054.       ILAST=0
  3055.   200 READ(IUN30,17004) IDAT,ITIM,DMODJI,DPOLX,DPOLY,DUT1,DTAI
  3056.       IF(IDAT.EQ.99999999) GOTO 300
  3057.       IF(IREC.EQ.2) IFIRST=DMODJI
  3058.       WRITE(IUN31,REC=IREC) DPOLX,DPOLY,DUT1,DTAI
  3059.       IF(IPRINT.GT.1) WRITE(IUN16,17005) IDAT,ITIM,IREC,DMODJI,DPOLX,
  3060.      1 DPOLY,DUT1,DTAI
  3061.       ILAST=IREC
  3062.       IREC=IREC+1
  3063.       GOTO 200
  3064.   300 CONTINUE
  3065.       WRITE(IUN31,REC=1) IFIRST,ILAST
  3066.       write(*,*)ifirst,ilast
  3067.       ISTART=0
  3068. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3069. C     Read pole coordinates, DUT1 and DTAI from direct access unit     !
  3070. C     IUN31:                                                           !
  3071. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3072.  1000 DMODJD=DJULD-2400000.5D0
  3073.       IMJD=DMODJD
  3074. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3075. C     DT is time difference referring to central sample point in days: !
  3076. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3077.       DT=DMODJD-DBLE(IMJD)
  3078.       DT2=DT*DT
  3079.       IREC=IMJD-IFIRST+2
  3080.       IF(IREC.LT.2) THEN
  3081.         DPOLX=0.D0
  3082.         DPOLY=0.D0
  3083.         DUT1 =0.D0
  3084.         DTAI =0.D0
  3085.         DLOD =0.D0
  3086.         DGPOL=0.D0
  3087.         DGPOLP=0.D0
  3088.         NERR=1
  3089.         RETURN
  3090.       ENDIF
  3091.       IF(IREC.GT.ILAST-1) THEN
  3092. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3093. C     Use pole coordinates and DUT1 from last tabulated day:           !
  3094. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3095.         READ(IUN31,REC=ILAST)   DPOLX,DPOLY,DUT1,DTAI
  3096.         DLOD =0.D0
  3097.         DGPOL=DOM**2*DA*2.D0*DCLAT*DSLAT*(DPOLX*DCLON-DPOLY*DSLON)*
  3098.      1  DRAD/3600.D0*1.D9
  3099.         DGPOLP=0.D0
  3100.         NERR=1
  3101.         RETURN
  3102.       ENDIF
  3103.       IF(IMJD.EQ.IMJDO) GOTO 1100
  3104.       READ(IUN31,REC=IREC-1) DPOLX1,DPOLY1,DUT12,DTAI1
  3105.       READ(IUN31,REC=IREC)   DPOLX2,DPOLY2,DUT12,DTAI2
  3106.       READ(IUN31,REC=IREC+1) DPOLX3,DPOLY3,DUT13,DTAI3
  3107.       IMJDO=IMJD
  3108. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3109. C     Quadratic interpolation for pole coordinates and DTAI:           !
  3110. C     Linear interpolation for DUT1:                                   !
  3111. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3112.  1100 DPOLXA0=DPOLX2
  3113.       DPOLXA1=(DPOLX3-DPOLX1)*0.5D0
  3114.       DPOLXA2=(DPOLX1-2.D0*DPOLX2+DPOLX3)*0.5D0
  3115. C
  3116.       DPOLYA0=DPOLY2
  3117.       DPOLYA1=(DPOLY3-DPOLY1)*0.5D0
  3118.       DPOLYA2=(DPOLY1-2.D0*DPOLY2+DPOLY3)*0.5D0
  3119. C      
  3120.       DTAIA0=DTAI2
  3121.       DTAIA1=(DTAI3-DTAI1)*0.5D0
  3122.       DTAIA2=(DTAI1-2.D0*DTAI2+DTAI3)*0.5D0
  3123. C
  3124.       DUT10=DUT12
  3125.       DDUT1=DUT13-DUT12
  3126.       IF(DDUT1.GT. 0.9D0) DDUT1=DDUT1-1.D0
  3127.       IF(DDUT1.LT.-0.9D0) DDUT1=DDUT1+1.D0
  3128.       DLOD = DTAIA1+2.D0*DTAIA2*DT
  3129.       DGLOD=2.D0*DLOD*DOM**2*DA*DCLAT*DCLAT*1.D9/86400.D0
  3130. C
  3131.       DPOLX=DPOLXA0+DT*DPOLXA1+DT2*DPOLXA2
  3132.       DPOLY=DPOLYA0+DT*DPOLYA1+DT2*DPOLYA2
  3133.       DUT1 =DUT10  +DT*DDUT1      
  3134.       DTAI =DTAIA0 +DT*DTAIA1 +DT2*DTAIA2
  3135. C
  3136.       DGPOL=DOM**2*DA*2.D0*DCLAT*DSLAT*(DPOLX*DCLON-DPOLY*DSLON)*
  3137.      1 DRAD/3600.D0*1.D9
  3138.       DPOLXP=DPOLXA1+2.D0*DPOLXA2*DT
  3139.       DPOLYP=DPOLYA1+2.D0*DPOLYA2*DT
  3140.       DGPOLP=DOM**2*DA*2.D0*DCLAT*DSLAT*(DPOLXP*DCLON-DPOLYP*DSLON)*
  3141.      1 DRAD/3600.D0*1.D9
  3142.       RETURN
  3143. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3144. C     Format statements:                                               !
  3145. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3146. 17001 FORMAT(' Routine ETPOLC, version 1996.05.25.'//
  3147.      1' Pole coordinates, DUT1, DTAI and pole tides from IERS data.'//)
  3148. 17002 FORMAT(8A10)
  3149. 17003 FORMAT(1X,8A10)
  3150. 17004 FORMAT(I8,1X,I6,F10.3,5F10.5)
  3151. 17005 FORMAT(I9,1X,2I6,F10.3,5F10.5)
  3152.       END
  3153. C
  3154.       SUBROUTINE ETPOTS(IUN14,IUN16,IUN24,IPRINT,IMODEL,DLAT,DLON,DH,
  3155.      1 DGRAV,DAZ,IC,DJULD,DAMIN)
  3156. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3157. C                                                                      !
  3158. C     Routine ETPOTS, version 1996.08.05 Fortran 90.                   !
  3159. C                                                                      !
  3160. C     The routine ETPOTS computes amplitudes, phases, frequencies and  !
  3161. C     body tide amplitude factors for a number of different Earth tide !
  3162. C     components using different tidal potential catalogues which use  !
  3163. C     the Hartmann and Wenzel (1995) normalization.                    !
  3164. C                                                                      !
  3165. C     Attention: This routine has finally not been tested for vertical !
  3166. C                and horizontal displacements and for shear tidal      !
  3167. C                strain !!!!                                           !
  3168. C                                                                      !
  3169. C     All variables with D as first character are DOUBLE PRECISION.    !
  3170. C                                                                      !
  3171. C     Input parameter description:                                     !
  3172. C     ----------------------------                                     !
  3173. C                                                                      !
  3174. C     IUN14:       Formatted unit, on which the tidal potential        !
  3175. C                  development has to be stored before the execution   !
  3176. C                  of routine ETPOTS  (e.g. file hw95s.dat).           !
  3177. C     IUN16:       Formatted line printer unit.                        !
  3178. C     IUN24:       Unformatted copy of IUN14. This unit will be opened !
  3179. C                  e.g. as file hw95s.uft during the execution of      !
  3180. C                  routine ETPOTS with STATUS=OLD if it exists and     !
  3181. C                  with STATUS=NEW, if it does not exist. If the file  !
  3182. C                  does not yet exist, it will be established during   !
  3183. C                  the execution of routine ETPOTS.                    !
  3184. C     IPRINT:      Printout parameter.                                 !
  3185. C                  for IPRINT = 0, nothing will be printed.            !
  3186. C                  for IPRINT = 1, a short list will be printed.       !
  3187. C                  for IPRINT = 2, a long list will be printed         !
  3188. C                  (including the tidal potential development).        !
  3189. C     IMODEL:      Parameter for selecting the tidal potential         !
  3190. C                  development.                                        !
  3191. C                  IMODEL = 1: Doodson (1921) tidal potential develop- !
  3192. C                              ment with 378 waves.                    !
  3193. C                  IMODEL = 2: Cartwright-Taylor-Edden (1973) tidal    !
  3194. C                              potential development with 505 waves.   !
  3195. C                  IMODEL = 3: Buellesfeld (1985) tidal potential      !
  3196. C                              development with 656 waves.             !
  3197. C                  IMODEL = 4: Tamura (1987) tidal potential develop-  !
  3198. C                              ment with 1200 waves.                   !
  3199. C                  IMODEL = 5: Xi (1989) tidal potential catalogue     !
  3200. C                              2933 waves.                             !      
  3201. C                  IMODEL = 6: Roosbeek (1995) tidal potential         !
  3202. C                              catalogue with ?? waves.                !
  3203. C                  IMODEL = 7: Hartmann and Wenzel (1995) tidal        !
  3204. C                              potential catalogue with 12935 waves.   !
  3205. C     DLAT:        Ellipsoidal latitude  referring to Geodetic         !
  3206. C                  Reference System 1980 in degree.                    !
  3207. C     DLON:        Ellipsoidal longitude referring to Geodetic         !
  3208. C                  Reference System 1980 in degree, positive east of   !
  3209. C                  Greenwhich.                                         !
  3210. C     DH:          Ellipsoidal height referring to Geodetic Reference  !
  3211. C                  System 1980 in meter.                               !
  3212. C     DGRAV:       Gravity in m/s**2. If the gravity is input below    !
  3213. C                  1 m/s**2, the gravity will be replaced by the       !
  3214. C                  computed normal gravity for reference system GRS80. !
  3215. C     DAZ:         Azimuth in degree from north direction (only valid  !
  3216. C                  for tidal tilt, horizontal displacement, and        !
  3217. C                  horizontal strain).                                 !
  3218. C     IC:          Earth tide component to be computed.                !
  3219. C                  IC=-1: tidal potential in m**2/s**2.                !
  3220. C                  IC= 0: vertical tidal acceleration (gravity tide),  !
  3221. C                         in nm/s**2 (positive downwards).             !
  3222. C                  IC= 1: horizontal tidal acceleration (tidal tilt)   !
  3223. C                         in azimuth DAZ in mas = arc sec/1000.        !
  3224. C                  IC= 2: vertical tidal displacement, geodetic        !
  3225. C                         coefficients in mm (positive upwards).       !
  3226. C                  IC= 3: horizontal tidal displacement in azimuth     !
  3227. C                         DAZ in mm.                                   !
  3228. C                  IC= 4: vertical tidal strain in 10**-9 = nstr.      !
  3229. C                  IC= 5: horizontal tidal strain in azimuth DAZ       !
  3230. C                         in 10**-9 = nstr.                            !
  3231. C                  IC= 6: areal  tidal strain in 10**-9 = nstr.        !
  3232. C                  IC= 7: shear  tidal strain in 10**-9 = nstr.        !
  3233. C                  IC= 8: volume tidal strain in 10**-9 = nstr.        !
  3234. C                  IC= 9: ocean tides, geodetic coefficients in        !
  3235. C                         millimeter.                                  !
  3236. C     DJULD:       Julian date of the initial epoch of tidal force     !
  3237. C                  development.                                        !
  3238. C     DAMIN:       Truncation parameter for the amplitude of tidal     !
  3239. C                  waves to be used in m**2/s**2. Only tidal waves     !
  3240. C                  with amplitudes greater or equal DAMIN will be      !
  3241. C                  used.                                               !  
  3242. C                                                                      !
  3243. C                  Rms error of gravity tides compited from HW95 tidal !
  3244. C                  potential catalogue versus amaplitude threshold,    !
  3245. C                  as computed from comparison with benchmark gravity  !
  3246. C                  tide series BFDE403A                                !
  3247. C                                                                      !
  3248. C          DAMIN    no. of      rms error  min. error    max.error     !
  3249. C    [m**2/s**2]     waves      [nm/s**2]  [nm/s**2]     [nm/s**2]     !
  3250. C                                                                      !
  3251. C     1.00*10**-1      11    88.403330     -321.492678   297.866988    !
  3252. C     3.16*10**-2      28    27.319455     -108.174675   109.525103    !
  3253. C     1.00*10**-2      45    14.449139      -62.286861    67.322802    !
  3254. C     3.16*10**-3      85     6.020159      -32.560229    28.931931    !
  3255. C     1.00*10**-3     158     2.249690      -14.587415    11.931120    !
  3256. C     3.16*10**-4     268     0.978419       -6.780051     5.934767    !
  3257. C     1.00*10**-4     441     0.436992       -3.049676     2.943019    !
  3258. C     3.16*10**-5     768     0.173071       -1.331572     1.242490    !
  3259. C     1.00*10**-5   1 273     0.068262       -0.520909     0.484510    !
  3260. C     3.16*10**-6   2 052     0.029229       -0.217114     0.229504    !
  3261. C     1.00*10**-6   3 359     0.011528       -0.099736     0.085920    !
  3262. C     3.16*10**-7   5 363     0.004706       -0.038247     0.035942    !
  3263. C     1.00*10**-7   8 074     0.001999       -0.019407     0.017684    !
  3264. C     3.16*10**-8  10 670     0.001391       -0.012350     0.012287    !
  3265. C     1.00*10**-8  12 234     0.001321       -0.010875     0.011307    !
  3266. C                                                                      !
  3267. C     Output parameter description:                                    !
  3268. C     -----------------------------                                    !
  3269. C                                                                      !
  3270. C     There are no output parameters. The computed arrays are trans-   !
  3271. C     ferred to the calling program unit by COMMON /TIDWAVE/.          !
  3272. C                                                                      !
  3273. C     COMMON /TIDWAVE/: contains tidal waves                           !
  3274. C                                                                      !  
  3275. C     NW:          Number of defined tidal waves.                      !
  3276. C     IWNR:        INTEGER array (1:12935) of wave numbers.            !
  3277. C     IAARG:       INTEGER array (1:12935,1:12) of astronomical        !
  3278. C                  argument numbers.                                   !
  3279. C     DX0:         DOUBLE PRECISION array (1:12935) of cos-coeffi-     !
  3280. C                  cients of the tidal component in units of the tidal !
  3281. C                  component.                                          !
  3282. C     DX1:         DOUBLE PRECISION array (1:12935) of time deriva-    !
  3283. C                  tives of cos-coefficients of the tidal component.   !
  3284. C     DY0:         DOUBLE PRECISION array (1:12935) of sin-coeffi-     !
  3285. C                  cients of the tidal component in units of the tidal !
  3286. C                  component.                                          !
  3287. C     DY1:         DOUBLE PRECISION array (1:12935) of time deriva-    !
  3288. C                  tives of sin-coefficients of the tidal component.   !
  3289. C                                                                      !
  3290. C                  component  unit of     unit of                      !
  3291. C                  IC         DX0,DY0     DX1,DY1                      !
  3292. C                  -1         m**2/s**2   m**2/s**2 per Julian century !
  3293. C                   0         nm/s**2     nm/s**2   per Julina century !
  3294. C                   1         mas         mas       per Julian century !
  3295. C                   2         mm          mm        per Julian century !
  3296. C                   3         mm          mm        per Julian century !
  3297. C                   4         nstr        nstr      per Julian cenrury !
  3298. C                   5         nstr        nstr      per Julian century !
  3299. C                   6         nstr        nstr      per Julian century !
  3300. C                   7         nstr        nstr      per Julian century !
  3301. C                   8         nstr        nstr      per Julian century !
  3302. C                   9         mm          mm        per Julian century !
  3303. C                                                                      !
  3304. C     DTHPH:       DOUBLE PRECISION array (1:12935) of tidal phases    !
  3305. C                  in radians at initial epoch.                        !
  3306. C     DTHFR:       DOUBLE PRECISION array (1:12935) of tidal           !
  3307. C                  frequencies in radian per hour.                     !
  3308. C     DBODY:       DOUBLE PRECISION array (1:12935) of body tide       !
  3309. C                  amplitude factors for tidal gravity and tidal tilt. !
  3310. C                  In order to compute the body tide, the coefficients !
  3311. C                  DX0, DX1, DY0 and DY1 have to be multiplied by      !
  3312. C                  DBODY.                                              !
  3313. C                                                                      !
  3314. C     Used routines:                                                   !
  3315. C     --------------                                                   !
  3316. C                                                                      !
  3317. C     ETASTN: computes astronomical elements.                          !
  3318. C     ETGCON: computes geodetic coefficients.                          !
  3319. C     ETJULN: computes Julian date.                                    !
  3320. C     ETLOVE: computes latitude dependent elastic parameters (called   !
  3321. C             ETGCOF).                                                 !
  3322. C     ETDDTA: computes the difference TDT minus UTC (called by ETASTN).!
  3323. C     ETPOLC: computes the difference DUT1 = UT1 - UTC.                !
  3324. C                                                                      !
  3325. C     Numerical accuracy:                                              !
  3326. C     -------------------                                              !
  3327. C                                                                      !
  3328. C     The routine has been tested under operation systems UNIX and     !
  3329. C     MS-DOS with 15 digits in DOUBLE PRECISION.                       !
  3330. C                                                                      !
  3331. C     Routine creation:  1988.04.27 by Hans-Georg Wenzel,              !
  3332. C                        Black Forest Observatory,                     !
  3333. C                        Universitaet Karlsruhe,                       !
  3334. C                        Englerstr. 7,                                 !
  3335. C                        D-76128 KARLSRUHE 1,                          !
  3336. C                        Germany.                                      !
  3337. C                        Tel: 0049-721-6082307,                        !
  3338. C                        FAX: 0049-721-694552.                         !
  3339. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  3340. C     Last modification: 1996.08.05 by Hans-Georg Wenzel.              !
  3341. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3342.       IMPLICIT DOUBLE PRECISION (D)
  3343.       IMPLICIT INTEGER (I-N)
  3344.       LOGICAL LEX24
  3345.       CHARACTER CHEAD(8)*10,CENDH*10,CUNIT(11)*8
  3346.       CHARACTER CMODEL(7)*20,CFFILE(7)*64,CUFILE(7)*64
  3347.       CHARACTER CBOD*2,CWAVE*4
  3348.       INTEGER NS(11)
  3349.       DOUBLE PRECISION DAS(11),DASP(11),DGK(25),DPK(25)
  3350.       COMMON /TIDPHAS/ DPK
  3351. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3352. C     The following DIMENSION statement is concerning the number of    !
  3353. C     waves of the tidal potential development, which is 12935.        !
  3354. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3355.       COMMON /TIDWAVE/ NW,IWNR(12935),IAARG(12935,12),DX0(12935),
  3356.      1 DX1(12935),DY0(12935),DY1(12935),DTHPH(12935),DTHFR(12935),
  3357.      2 DBODY(12935)
  3358. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3359. C     The following DIMENSION statement is concerning the elastic      !
  3360. C     Earth model for the different degree and order constituents.     !
  3361. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3362.       DOUBLE PRECISION DELTA(25)
  3363.       COMMON /UNITS/ CUNIT,IC2
  3364. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3365. C     COMMON /CONST/:                                                  !
  3366. C     DPI...        3.1415....                                         !
  3367. C     DPI2...       2.D0*DPI                                           !
  3368. C     DRAD...       DPI/180.D0                                         !
  3369. C     DRO...        180.D0/DPI                                         !
  3370. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3371.       COMMON /CONST/ DPI,DPI2,DRAD,DRO
  3372. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3373. C     COMMON /LOVE/ contains gravimeter factors, LOVE-numbers, SHIDA-  !
  3374. C     numbers and tilt factors for degree 2...4 at latitude DLAT:      !
  3375. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3376.       DIMENSION DGLAT(12),DHLAT(12),DKLAT(12),DLLAT(12),DTLAT(12)
  3377.       COMMON /LOVE/ DOM0,DOMR,DGLAT,DGR,DHLAT,DHR,DKLAT,DKR,DLLAT,DLR,
  3378.      1 DTLAT,DTR
  3379.       SAVE
  3380.       DATA MAXNW/12935/
  3381.       DATA CENDH/'C*********'/
  3382.       DATA IUN30/30/,IUN31/31/
  3383.       DATA CMODEL/'Doodson 1921 ',
  3384.      1 'CTED 1973           ','Buellesfeld 1985    ',
  3385.      2 'Tamura 1987         ','Xi 1989             ',
  3386.      3 'Roosbeek 1995       ','Hartmann+Wenzel 1995'/
  3387. C HP-UNIX:
  3388. C HP-UNIX:      DATA CFFILE/ '../commdat/doodsehw.dat',
  3389. C HP-UNIX:     2             '../commdat/cted73hw.dat',
  3390. C HP-UNIX:     3             '../commdat/buellehw.dat',
  3391. C HP-UNIX:     4             '../commdat/tamurahw.dat',
  3392. C HP-UNIX:     5             '../commdat/xi1989hw.dat',
  3393. C HP-UNIX:     6             '../commdat/ratgp95.dat',
  3394. C HP-UNIX:     7             '../commdat/hw95s.dat'/
  3395. C HP-UNIX:      DATA CUFILE/ '../commdat/doodsehw.uft',
  3396. C HP-UNIX:     2             '../commdat/cted73hw.uft',
  3397. C HP-UNIX:     3             '../commdat/buellehw.uft',
  3398. C HP-UNIX:     4             '../commdat/tamurahw.uft',
  3399. C HP-UNIX:     5             '../commdat/xi1989hw.uft',
  3400. C HP-UNIX:     6             '../commdat/ratgp95.uft',
  3401. C HP-UNIX:     7             '../commdat/hw95s.uft'/
  3402. C MS-DOS:
  3403.       DATA CFFILE/ '/home/hwz/eterna34/commdat/doodsehw.dat',
  3404.      2             '/home/hwz/eterna34/commdat/cted73hw.dat',
  3405.      3             '/home/hwz/eterna34/commdat/buellehw.dat',
  3406.      4             '/home/hwz/eterna34/commdat/tamurahw.dat',
  3407.      5             '/home/hwz/eterna34/commdat/xi1989hw.dat',
  3408.      6             '/home/hwz/eterna34/commdat/ratgp95.dat',
  3409.      7             '/home/hwz/eterna34/commdat/hw95s.dat'/
  3410.       DATA CUFILE/ '/home/hwz/eterna34/commdat/doodseh2.uft',
  3411.      2             '/home/hwz/eterna34/commdat/cted73h2.uft',
  3412.      3             '/home/hwz/eterna34/commdat/buelleh2.uft',
  3413.      4             '/home/hwz/eterna34/commdat/tamurah2.uft',
  3414.      5             '/home/hwz/eterna34/commdat/xi1989h2.uft',
  3415.      6             '/home/hwz/eterna34/commdat/ratgp952.uft',
  3416.      7             '/home/hwz/eterna34/commdat/hw95s2.uft'/
  3417.       IF(IPRINT.GT.0) WRITE(IUN16,17001) CMODEL(IMODEL)
  3418.       OPEN(UNIT=IUN14,FILE=CFFILE(IMODEL),FORM='FORMATTED',
  3419.      1 STATUS='OLD')
  3420.       REWIND(IUN14)
  3421. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3422. C     Test, whether there exist already the unformatted tidal          !
  3423. C     potential catalogue file:                                        !
  3424. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3425.       OPEN(UNIT=IUN24,FILE=CUFILE(IMODEL),FORM='UNFORMATTED',
  3426.      1 STATUS='OLD',ERR=11)
  3427.       LEX24=.TRUE.
  3428.       WRITE(*,17002)CUFILE(IMODEL)
  3429.       REWIND IUN24
  3430.       GOTO 12
  3431.    11 OPEN(UNIT=IUN24,FILE=CUFILE(IMODEL),FORM='UNFORMATTED',
  3432.      1 STATUS='NEW')
  3433.       LEX24=.FALSE.
  3434.       REWIND IUN14
  3435.    12 CONTINUE
  3436. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3437. C     Compute geodetic coefficients and body tide amplitude factors    !
  3438. C     for the WAHR-DEHANT-ZSCHAU model. The NDFW resonance is          !
  3439. C     approximated by                                                  !
  3440. C                                                                      !  
  3441. C     G0 - GR*(DOM - DOM0)/(DOMR - DOM),                               !
  3442. C                                                                      !
  3443. C     similar equations hold for the other components.                 !
  3444. C                                                                      !
  3445. C     Gravimetric amplitude factors, LOVE numbers h and k for zero to  !
  3446. C     third degree tidal potential have been taken from DEHANT 1987,   !
  3447. C     table 7, 8 and 9 for elliptical, uniformly rotating, oceanless   !
  3448. C     Earth with liquid outer core and inelastic mantle (PREM Earth    !
  3449. C     model with inelastic mantle from ZSCHAU) and for the fourth      !
  3450. C     degree from DEHANT et al. 1989, table 6). The resonance factors  !
  3451. C     GR have been computed to fit the difference between body tide    !
  3452. C     amplitude factors at waves O1 and PSI1 from DEHANT 1987, PREM    !
  3453. C     model with elastic mantle (table 1...3). The NDFW resonance      !
  3454. C     frequency is 15.073729 degree per hour  = 1.004915267 CPD UT,    !
  3455. C     taken from WAHR 1981 (because it is not given in any of DEHANT's !
  3456. C     papers).                                                         !
  3457. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3458.       CALL ETGCON(IUN16,IPRINT,DLAT,DLON,DH,DGRAV,DAZ,IC,DGK,DPK)
  3459.       IC2=IC+2
  3460. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3461. C     Define default body tide amplitude factors for components        !
  3462. C     IC=2...9.                                                        !
  3463. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3464.       DO 50 I=1,25
  3465.    50 DELTA(I)=1.D0
  3466.       DELTAR=0.D0
  3467.       GOTO (100,200,300),IC2
  3468.       GOTO 1000
  3469. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3470. C     IC=-1, compute body tide amplitude factors for tidal potential:  !
  3471. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3472.   100 CONTINUE
  3473.       DO 110 I=1,12
  3474.   110 DELTA(I)=DKLAT(I)
  3475.       DELTAR=DKR
  3476.       GOTO 1000
  3477. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3478. C     IC=0, compute body tide amplitude factors for vertical component !
  3479. C     (gravity tides):                                                 !
  3480. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3481.   200 CONTINUE
  3482.       DO 210 I=1,12
  3483.   210 DELTA(I)=DGLAT(I)
  3484.       DELTAR=DGR
  3485.       GOTO 1000
  3486. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3487. C     IC=1: compute body tide amplitude factors for horizontal         !
  3488. C     component (tidal tilt):                                          !
  3489. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3490.   300 CONTINUE
  3491.       DO 310 I=1,12
  3492.   310 DELTA(I)=DTLAT(I)
  3493.       DELTAR=DKR-DHR
  3494.  1000 CONTINUE
  3495.       DT2000=(DJULD-2451544.D0)/36525.0D0
  3496. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3497. C     Interpolate DUT1:                                                !
  3498. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3499.       CALL ETPOLC(IUN16,IUN30,IUN31,IPRINT,DJULD,DCLAT,DSLAT,
  3500.      1 DCLON,DSLON,DPOLX,DPOLY,DUT1,DTAI,DLOD,DGPOL,DGPOLP,DGLOD,NERR)
  3501. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3502. C     Compute astronomical elements for initial epoch:                 !
  3503. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3504.       CALL ETASTN(IUN16,IPRINT,IMODEL,DLON,DJULD,DUT1,DAS,DASP,DDT0)
  3505.       IC2=IC+2
  3506. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3507. C     Read file header of tidal potential file on unit IUN14:          !
  3508. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3509.       IF(LEX24) THEN
  3510.           READ(IUN24) (CHEAD(I),I=1,8)
  3511.       ELSE
  3512.           READ(IUN14,17028)  (CHEAD(I),I=1,8)
  3513.           WRITE(IUN24) (CHEAD(I),I=1,8)
  3514.       ENDIF
  3515.       WRITE(IUN16,17029) (CHEAD(I),I=1,8)
  3516.  1100 CONTINUE
  3517.       IF(LEX24) THEN
  3518.           READ(IUN24)  (CHEAD(I),I=1,8)
  3519.       ELSE
  3520.           READ(IUN14,17028)  (CHEAD(I),I=1,8)
  3521.           WRITE(IUN24) (CHEAD(I),I=1,8)
  3522.       ENDIF
  3523.       IF(IPRINT.EQ.2) WRITE(IUN16,17029) (CHEAD(I),I=1,8)
  3524.       IF(CHEAD(1).NE.CENDH) GOTO 1100
  3525. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3526. C     Compute tidal development for the specific component from tidal  !
  3527. C     potential development:                                           !
  3528. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3529.       IW=1
  3530.       NWFILE=0
  3531.       NAMPL=0
  3532.       NTRUNC=0
  3533.  1110 CONTINUE
  3534.  1120 CONTINUE
  3535. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3536. C     Read tidal potential catalogue either from formatted or from     !
  3537. C     unformatted file. The format of the files is described in        !
  3538. C     Hartmann and Wenzel (1995a).                                     !
  3539. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3540.       IF(LEX24) THEN
  3541.           READ(IUN24) NRI,CBOD,LI,(NS(J),J=1,11),DFR,DC0I,DS0I,DC1I,
  3542.      1    DS1I,CWAVE
  3543.       ELSE
  3544.           READ(IUN14,17006,END=2000) NRI,CBOD,LI,(NS(J),J=1,11),DFR,
  3545.      1    DC0I,DS0I,DC1I,DS1I,CWAVE
  3546.           WRITE(IUN24) NRI,CBOD,LI,(NS(J),J=1,11),DFR,DC0I,DS0I,DC1I,
  3547.      1    DS1I,CWAVE
  3548.       ENDIF
  3549.       IF(NRI.GT.MAXNW) GOTO 2000
  3550.       NWFILE=NWFILE+1
  3551. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3552. C     Truncation of the tidal potential catalogue:                     !
  3553. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3554.       DAM=DSQRT(DC0I**2+DS0I**2)*1.D-10
  3555.       IF(DAM.LT.DAMIN) THEN
  3556.          NTRUNC=NTRUNC+1
  3557.          GOTO 1110
  3558.       ENDIF
  3559.       IF(IW.EQ.1) GOTO 1130
  3560. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3561. C     Check if the astronomical arguments are identical to those of    !
  3562. C     the last stored wave (for Hartmann and Wenzel 1995 potential):   !
  3563. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3564.       IDIFF=(LI-IAARG(IW-1,12))**2
  3565.       DO 1125 J=1,11
  3566.  1125 IDIFF=IDIFF+(NS(J)-IAARG(IW-1,J))**2
  3567.       IF(IDIFF.GT.0) GOTO 1130
  3568. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3569. C     Astronomical arguments are identical to those of last stored     !
  3570. C     wave. We will add up the coefficients for these two waves:       !
  3571. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3572.       IF(IW-1.GT.1) IWNR(IW-1)=NRI
  3573.       JCOF=(LI+1)*LI/2-2+NS(1)
  3574.       DX0(IW-1)=DX0(IW-1)+DC0I*DGK(JCOF)*1.D-10
  3575.       DY0(IW-1)=DY0(IW-1)+DS0I*DGK(JCOF)*1.D-10
  3576.       DX1(IW-1)=DX1(IW-1)+DC1I*DGK(JCOF)*1.D-10
  3577.       DY1(IW-1)=DY1(IW-1)+DS1I*DGK(JCOF)*1.D-10
  3578.       GOTO 1110
  3579.  1130 NAMPL=NAMPL+1
  3580.       DC2=0.D0
  3581.       DC3=0.D0
  3582.       IAARG(IW,12)=LI
  3583.       DO 1140 J=1,11
  3584.       IAARG(IW,J)=NS(J)
  3585.       DC2=DC2+DBLE(NS(J))*DAS(J)
  3586.  1140 DC3=DC3+DBLE(NS(J))*DASP(J)
  3587.       JCOF=(LI+1)*LI/2-2+NS(1)
  3588.       DC2=DC2+DPK(JCOF)
  3589.       IWNR(IW)=NRI
  3590.       DX0(IW)=DC0I*DGK(JCOF)*1.D-10
  3591.       DY0(IW)=DS0I*DGK(JCOF)*1.D-10
  3592.       DX1(IW)=DC1I*DGK(JCOF)*1.D-10
  3593.       DY1(IW)=DS1I*DGK(JCOF)*1.D-10
  3594.       DBODY(IW)=DELTA(JCOF)
  3595.       IF(JCOF.EQ.2) DBODY(IW)=DELTA(JCOF)+DELTAR*(DC3-DOM0)/(DOMR-DC3)
  3596.  1160 DC2=DMOD(DC2,360.D0)
  3597.       IF(DC2.GE.0.D0) GOTO 1170
  3598.       DC2=DC2+360.D0
  3599.       GOTO 1160
  3600.  1170 CONTINUE
  3601.       DTHPH(IW)=DC2*DRAD
  3602.       DTHFR(IW)=DC3*DRAD
  3603.       IF(IPRINT.EQ.2) THEN
  3604.          DXTI=DX0(IW)+DX1(IW)*DT2000
  3605.          DYTI=DY0(IW)+DY1(IW)*DT2000
  3606.          DTHAM=DSQRT(DXTI**2+DYTI**2)
  3607.          WRITE(IUN16,17011) IW,CBOD,LI,NS(1),DTHAM,DC2,DC3,CWAVE,
  3608.      1   DBODY(IW)
  3609.       ENDIF
  3610.       IW=IW+1
  3611.       IF(IW.GT.MAXNW) GOTO 5000
  3612.       GOTO 1110
  3613.  2000 CONTINUE
  3614.       NW=IW-1
  3615.       CLOSE(IUN14)
  3616.       IF(IPRINT.EQ.0) RETURN
  3617.       WRITE(IUN16,17010) NWFILE,NTRUNC,NW
  3618.       WRITE(IUN16,17030)
  3619.       RETURN
  3620.  5000 CONTINUE
  3621.       WRITE(IUN16,17050) NW,MAXNW
  3622.       STOP
  3623. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3624. C     Format statements:                                               !
  3625. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3626. 17001 FORMAT(//6X,'Routine ETPOTS, version 1996.08.05.'/
  3627.      1 6x,'Tidal waves from tidal potential catalogue.'/
  3628.      2 6X,A20,' tidal potential catalogue is used.'/)
  3629. 17002 FORMAT(A30,' is existing')
  3630. 17006 FORMAT(I6,1X,A2,I2,11I3,F12.8,2F12.0,2F10.0,1X,A4)
  3631. 17008 FORMAT(1X,I4,10I2,4F7.5,F8.4,F9.4,F12.8,1X,A4/F7.5,F8.6,F9.6)
  3632. 17010 FORMAT(//6x,' Number of waves read from file is :',I6/
  3633.      1         6x,' Number of waves above limit is    :',I6/
  3634.      1         6x,' Number of waves to be used is     :',I6/)
  3635. 17011 FORMAT(I5,1X,A2,2I3,3F10.5,2X,A6,2X,F10.6)
  3636. 17028 FORMAT(8A10)
  3637. 17029 FORMAT(6X,8A10)
  3638. 17030 FORMAT(///6x,'***** Routine ETPOTS finished execution.'/)
  3639. 17050 FORMAT(/
  3640.      1 6x,'***** Error in routine ETPOTS.'/
  3641.      2 6x,'***** The current number of waves:',I5,' exceeds the ',
  3642.      3 'maximum number of waves:',I5/
  3643.      4 6x,'***** Routine ETPOTS stops the execution.'/)
  3644.       END
  3645. C
  3646.       SUBROUTINE GEOEXT(IUN16,IRESET,DEXTIM,DEXTOT)
  3647. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3648. C                                                                      !
  3649. C     Routine GEOEXT, version 1996.08.05 Fortran 77/90.                !
  3650. C                                                                      !
  3651. C     === MS-DOS version for LAHEY-compiler ===================        !
  3652. C                                                                      !
  3653. C     The routine GEOEXT computes the actual job time and writes       !
  3654. C     the actual execution time on printer output unit IUN6.           !
  3655. C     For the first call of routine GEOEXT, the actual jobtime will    !
  3656. C     be computed (in secs since midnight) and stored. For the next    !
  3657. C     call(s) of routine GEOEXT, the actual jobtime will be computed   !
  3658. C     and the execution time (actual jobtime minus jobtime of the      !
  3659. C     first call of routine GEOEXT) will be printed.                   !
  3660. C                                                                      !
  3661. C     Input parameter description:                                     !
  3662. C     ----------------------------                                     !
  3663. C                                                                      !
  3664. C     IUN16:       formatted printer unit.                             !
  3665. C     IRESET:      DEXTIM will be resetted, if IRESET=1.               !
  3666. C                                                                      !
  3667. C     Output parameter description:                                    !
  3668. C     -----------------------------                                    !
  3669. C                                                                      !
  3670. C     DEXTIM:      actual jobtime in seconds (time elapsed from the    !
  3671. C                  last call of routine GEOEXT with IRESET=1 to the    !
  3672. C                  actual call of routine GEOEXT), double precision.   !
  3673. C     DEXTOT:      total jobtime in seconds (time elapsed from the     !
  3674. C                  first call of routine GEOEXT), double precision.    !  
  3675. C                                                                      !
  3676. C     Used routines:                                                   !
  3677. C     --------------                                                   !
  3678. C                                                                      !
  3679. C     SYSTEM-CLOCK                                                     !
  3680. C                                                                      !
  3681. C     Program creation:  1979.08.30 by Hans-Georg Wenzel,              !
  3682. C                        Black Forest Observatory,                     !
  3683. C                        Universitaet Karlsruhe,                       !
  3684. C                        Englerstr. 7,                                 !
  3685. C                        D-76128 KARLSRUHE,                            !
  3686. C                        Germany.                                      !
  3687. C                        Tel.: 0721-6082301.                           !
  3688. C                        FAX:  0721-694552.                            !
  3689. C                        e-mail: wenzel@gik.bau-verm.uni-karlsruhe.de  !
  3690. C     Last Modification: 1996.08.05 by Hans-Georg Wenzel.              !
  3691. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3692.       IMPLICIT DOUBLE PRECISION (D)
  3693. C MSFOR:      INTEGER*2 IH,IM,IS,IS100
  3694.       DATA IFIRST/1/
  3695.       SAVE DTIME1
  3696.       IF(IRESET.NE.1) GOTO 6003
  3697. C MSFOR:      CALL GETTIM(IH,IM,IS,IS100)
  3698. C MSFOR:      DTIME1=DBLE(IS+IM*60+IH*3600)+0.01*FLOAT(IS100)
  3699. C LAHEY 90:
  3700.       CALL SYSTEM_CLOCK(IC,ICR)
  3701.       DTIME1=DBLE(IC)/DBLE(ICR)
  3702. C UNIX:      DTIME1=DBLE(SECNDS(RDUMMY))
  3703.       WRITE(IUN16,17001)
  3704.       DEXTIM=0.D0
  3705.       DEXTOT=0.D0
  3706.       IF(IFIRST.EQ.1) THEN
  3707.         DTIME0=DTIME1
  3708.         IFIRST=0
  3709.       ENDIF
  3710.       IRESET=0
  3711.       RETURN
  3712.  6003 CONTINUE
  3713. C MSFOR:      CALL GETTIM(IH,IM,IS,IS100)
  3714. C MSFOR:      DTIME2=DBLE(IS+IM*60+IH*3600)+0.01*FLOAT(IS100)
  3715. C LAHEY:
  3716.       CALL SYSTEM_CLOCK(IC,ICR)
  3717.       DTIME2=DBLE(IC)/DBLE(ICR)
  3718. C UNIX: DTIME2=DBLE(SECNDS(RDUMMY))  
  3719.       DEXTIM=DTIME2-DTIME1
  3720.       DEXTOT=DTIME2-DTIME0
  3721.       WRITE(IUN16,17002) DEXTIM
  3722. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3723. C     Format statements:                                               !
  3724. C!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3725. 17001 FORMAT(6x,'First call of routine GEOEXT, version 1996.08.05.')
  3726. 17002 FORMAT(/6x,'Routine GEOEXT. Execution time=',F10.3,' sec'/)
  3727.       RETURN
  3728.       END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement