83 |
#endif |
#endif |
84 |
|
|
85 |
c == end of interface == |
c == end of interface == |
|
c print *,'exf_GetFFieldRec: fldstartdate',fldstartdate |
|
|
c print *,'exf_GetFFieldRec: fldperiod',fldperiod |
|
|
c print *,'exf_GetFFieldRec: fac',fac |
|
|
c print *,'exf_GetFFieldRec: first',first |
|
|
c print *,'exf_GetFFieldRec: changed',changed |
|
|
c print *,'exf_GetFFieldRec: count0',count0 |
|
|
c print *,'exf_GetFFieldRec: count1',count1 |
|
86 |
|
|
87 |
c Determine the current date. |
c Determine the current date. |
88 |
call cal_GetDate( myiter, mytime, mydate, mythid ) |
call cal_GetDate( myiter, mytime, mydate, mythid ) |
90 |
c Determine the flux record just before mycurrentdate. |
c Determine the flux record just before mycurrentdate. |
91 |
call cal_TimePassed( fldstartdate, mydate, difftime, mythid ) |
call cal_TimePassed( fldstartdate, mydate, difftime, mythid ) |
92 |
call cal_ToSeconds( difftime, fldsecs, mythid ) |
call cal_ToSeconds( difftime, fldsecs, mythid ) |
93 |
fldsecs = int(fldsecs/fldperiod)*fldperiod |
fldsecs = int((fldsecs+0.5)/fldperiod)*fldperiod |
94 |
fldcount = int(fldsecs/fldperiod) + 1 |
fldcount = int((fldsecs+0.5)/fldperiod) + 1 |
95 |
|
|
96 |
c If using repeating data (e.g. monthly means) then make |
c If using repeating data (e.g. monthly means) then make |
97 |
c fldsecs cycle around |
c fldsecs cycle around |
99 |
fldsecs0=mod(fldsecs,repeatPeriod) |
fldsecs0=mod(fldsecs,repeatPeriod) |
100 |
c print *,'repeat: ',fldsecs |
c print *,'repeat: ',fldsecs |
101 |
c Determine the flux record just after mycurrentdate. |
c Determine the flux record just after mycurrentdate. |
102 |
count0 = int(fldsecs0/fldperiod) + 1 |
count0 = int(fldsecs0+0.5/fldperiod) + 1 |
103 |
fldsecs1 = int((fldsecs+fldperiod)/fldperiod)*fldperiod |
fldsecs1 = int((fldsecs+fldperiod+0.5)/fldperiod)*fldperiod |
104 |
fldsecs1=mod(fldsecs1,repeatPeriod) |
fldsecs1=mod(fldsecs1,repeatPeriod+0.5) |
105 |
c print *,'repeat: ',fldsecs1 |
c print *,'repeat: ',fldsecs1 |
106 |
count1 = int(fldsecs1/fldperiod) + 1 |
count1 = int((fldsecs1+0.5)/fldperiod) + 1 |
107 |
endif |
endif |
108 |
|
|
109 |
c Set switches for reading new records. |
c Set switches for reading new records. |
118 |
call cal_TimePassed( fldstartdate, previousdate, difftime, |
call cal_TimePassed( fldstartdate, previousdate, difftime, |
119 |
& mythid ) |
& mythid ) |
120 |
call cal_ToSeconds( difftime, prevfldsecs, mythid ) |
call cal_ToSeconds( difftime, prevfldsecs, mythid ) |
121 |
prevfldsecs = int(prevfldsecs/fldperiod)*fldperiod |
prevfldsecs = int((prevfldsecs+0.5)/fldperiod)*fldperiod |
122 |
prevfldcount = int(prevfldsecs/fldperiod) + 1 |
prevfldcount = int((prevfldsecs+0.5)/fldperiod) + 1 |
123 |
|
|
124 |
if (fldcount .ne. prevfldcount) then |
if (fldcount .ne. prevfldcount) then |
125 |
changed = .true. |
changed = .true. |