OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
get_ut1.f
Go to the documentation of this file.
1  subroutine get_ut1(iyr,iday,ut1c,ier)
2 
3 c Routine to retrieve th UTC-UT1 correction from the utcpole.dat file
4 
5 c Calling Arguments:
6 c
7 c Name Type I/O Description
8 c -------- ---- --- -----------
9 c iyr I*4 I Year
10 c iday I*4 I Day of year
11 c ut1c R*8 O UT1 - UTC (seconds)
12 c ier I*4 O Error return code
13 
14 c By: Frederick S. Patt, SAIC, July 19, 2011
15 c
16 c Notes:
17 c
18 c Modification History:
19 c
20 
21  implicit none
22 
23  real*8 ut1c, utin
24  real*4 tmp1,tmp2,tmp3,tmp4
25  integer*4 iyr,iday,ier
26  integer*4 jd,jdayt,jdayin/0/
27  character*80 utcpolnm,hdr1
28  character*108 hdr2
29  character*1 tab1,tab2,tab3,tab4,tab5
30 
31 c Get path to utcpole.dat file and open file
32  utcpolnm = '$OCVARROOT/modis/utcpole.dat'
33  call filenv (utcpolnm,utcpolnm)
34  print *,utcpolnm
35  open (19, file=utcpolnm, status='old', err=999)
36  read (19, 1001, err=999) hdr1
37  1001 format(a78)
38  read (19, 1002, err=999) hdr2
39  1002 format(a108)
40 
41 c Get truncated Julian day for date
42 
43  jdayt = jd(iyr,1,iday) - 2400000
44 c print *, jdayt
45 
46 c Read file until date is found
47  jdayin = 0
48  do while (jdayin.ne.jdayt)
49  read (19, 1200, end=998) jdayin,tab1,tmp1,tab2,tmp2
50  * ,tab3,tmp3,tab4,tmp4,tab5,utin
51  1200 format (i5,2(a1,f9.6,a1,f8.6),a1,f9.6)
52  end do
53  print *, 'utcpole.dat file record', jdayin, utin
54 
55  ut1c = utin
56 c print *,'UT1C value', ut1c
57  close(19)
58  return
59 
60  998 print *,'End of utcpole file', jdayin, jdayt
61  ier = 1
62  return
63 
64  999 print *,'Error accessing utcpole file'
65  ier = 1
66  return
67  end
68 
#define real
Definition: DbAlgOcean.cpp:26
subroutine filenv(infil, outfil)
Definition: filenv.f:2
Definition: l1czcs.h:62
Definition: jd.py:1