FUNCTION DELDAY(ID1,ID2) c c y2k version: modified, July 1998, hpf c Looking at original delday code, it didn't seem that the century number c even need to be specified, but since it was, I added mods for y2k. c 2 digit years < 50 will have 2000 added, c if >/= 50, will have 1900 added. C C COMPUTES NUMBER OF DAYS BETWEEN TWO POINTS IN TIME C C PROGRAMMED BY PAUL FREITAG JUNE 76 C DIMENSION NDAY(12),ID1(5),ID2(5) DATA NDAY /31,28,31,30,31,30,31,31,30,31,30,31/ real*8 dd1,dd2 C IHR1=ID1(1) C IMIN1=ID1(2) C IDY1=ID1(3) C IMTH1=ID1(4) C IYR1=ID1(5) C IHR2=ID2(1) C IMIN2=ID2(2) C IDY2=ID2(3) C IMTH2=ID2(4) C IYR2=ID2(5) if(id1(5).gt.100) then icen1=0 elseif (id1(5).ge.50) then icen1=1900 elseif (id1(5).lt.50) then icen1=2000 endif if(id2(5).gt.100) then icen2=0 elseif (id2(5).ge.50) then icen2=1900 elseif (id2(5).lt.50) then icen2=2000 endif c print*, icen1,icen2 NDAY(2)=28 IF (MOD(ID1(5)+icen1,4).EQ.0) NDAY(2)=29 DD1=0.0 NM1=ID1(4)-1 IF (NM1.EQ.0) GO TO 15 DO 10 I=1,NM1 DD=NDAY(I) 10 DD1=DD1+DD 15 DD1=DD1+FLOAT(ID1(3))+(FLOAT(ID1(1)))/24.+(FLOAT(ID1(2)))/1440.-1. DD2=0.0 NDYR=ID2(5)+icen2-ID1(5)-icen1 IF (NDYR) 16,40,20 16 ndyr=-ndyr DO 18 I=1,NDYR DPR=365. IF (MOD(icen1+ID1(5)-I,4).EQ.0) DPR=366. 18 DD1=DD1+DPR go to 40 20 DO 30 I=1,NDYR DPR=365. IF (MOD(icen1-1+ID1(5)+I,4).EQ.0) DPR=366. 30 DD2=DD2+DPR 40 NM2=ID2(4)-1 IF (NM2.EQ.0) GO TO 55 NDAY(2)=28 IF (MOD(ID2(5)+icen2,4).EQ.0) NDAY(2)=29 DO 50 I=1,NM2 DD=NDAY(I) 50 DD2=DD2+DD 55 DD2=DD2+FLOAT(ID2(3))+(FLOAT(ID2(1)))/24.+(FLOAT(ID2(2)))/1440.-1. DELDAY=DD2-DD1 RETURN END