Subversion Repositories lagranto.ecmwf

Rev

Rev 3 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 29
Line 156... Line 156...
156
c     Convert <hh.mm> -> <frac> and <frac> -> <hhmm>
156
c     Convert <hh.mm> -> <frac> and <frac> -> <hhmm>
157
c     ---------------------------------------------------------------------------
157
c     ---------------------------------------------------------------------------
158
 
158
 
159
      subroutine hhmm2frac (hhmm,frac)
159
      subroutine hhmm2frac (hhmm,frac)
160
 
160
 
-
 
161
      implicit none
-
 
162
 
161
      real hhmm
163
      real hhmm
162
      real frac
164
      real frac
163
      
165
      
164
      frac=real(int(hhmm))+
166
      frac=real(int(hhmm))+
165
     >     100.*(hhmm-real(int(hhmm)))/60.
167
     >     100.*(hhmm-real(int(hhmm)))/60.
Line 167... Line 169...
167
      end
169
      end
168
 
170
 
169
 
171
 
170
      subroutine frac2hhmm (frac,hhmm)
172
      subroutine frac2hhmm (frac,hhmm)
171
 
173
 
-
 
174
      implicit none
-
 
175
 
172
      real hhmm
176
      real hhmm
173
      real frac
177
      real frac
174
 
178
 
175
      real hh,mm
179
      real hh,mm
-
 
180
      integer changesign
-
 
181
 
-
 
182
      real eps
-
 
183
      parameter (eps=0.00001)
-
 
184
 
-
 
185
      changesign = 0.
-
 
186
      if ( frac.lt.0. ) changesign = 1
-
 
187
 
-
 
188
      if ( changesign.eq.1 ) frac = - frac
176
      
189
      
177
      hh =  real(int(frac))
190
      hh =  real( int(frac+eps) )
178
      mm =  60. * (frac-real(int(frac)))
191
      mm =  real( nint( 60. * (frac-hh) ) )
179
 
192
 
180
      hhmm = hh + 0.01 * mm
193
      hhmm = hh + 0.01 * mm
181
 
194
 
-
 
195
      if ( changesign.eq.1 ) then
-
 
196
          hhmm = -hhmm
-
 
197
          frac = -frac
-
 
198
      endif
-
 
199
 
182
      end
200
      end
183
 
201
 
184
c     ---------------------------------------------------------------------------
202
c     ---------------------------------------------------------------------------
185
c     Time difference between two dates
203
c     Time difference between two dates
186
c     ---------------------------------------------------------------------------
204
c     ---------------------------------------------------------------------------