24 |
c replaced all routines by one generic routine |
c replaced all routines by one generic routine |
25 |
c 5-Aug-2003: added USE_EXF_INTERPOLATION for arbitrary |
c 5-Aug-2003: added USE_EXF_INTERPOLATION for arbitrary |
26 |
c input grid capability |
c input grid capability |
27 |
|
c 11-Dec-2006 added time-mean and monthly-mean climatology options |
28 |
|
c genperiod=0 means input file is one time-constant field |
29 |
|
c genperiod=-12 means input file contains 12 monthly means |
30 |
|
|
31 |
c ================================================================== |
c ================================================================== |
32 |
c SUBROUTINE exf_set_gen |
c SUBROUTINE exf_set_gen |
95 |
cph( |
cph( |
96 |
cph-exf-print if (genfile .EQ. hfluxfile) year0 = 3000 |
cph-exf-print if (genfile .EQ. hfluxfile) year0 = 3000 |
97 |
cph) |
cph) |
98 |
|
|
99 |
|
if ( genperiod .eq. 0 ) then |
100 |
|
c genperiod=0 means input file is one time-constant field |
101 |
|
count0 = 1 |
102 |
|
count1 = 1 |
103 |
|
|
104 |
|
elseif ( genperiod .eq. -12 ) then |
105 |
|
c genperiod=-12 means input file contains 12 monthly means |
106 |
|
c record numbers are assumed 1 to 12 corresponding to |
107 |
|
c Jan. through Dec. |
108 |
|
call cal_GetMonthsRec( |
109 |
|
O fac, first, changed, |
110 |
|
O count0, count1, |
111 |
|
I mytime, myiter, mythid |
112 |
|
& ) |
113 |
|
|
114 |
|
elseif ( genperiod .lt. 0 ) then |
115 |
|
print *, 'genperiod is out of range' |
116 |
|
STOP 'ABNORMAL END: S/R EXF_GETFFIELDREC' |
117 |
|
|
118 |
|
else |
119 |
c get record numbers and interpolation factor for gen |
c get record numbers and interpolation factor for gen |
120 |
call exf_GetFFieldRec( |
call exf_GetFFieldRec( |
121 |
I genstartdate, genperiod |
I genstartdate, genperiod |
122 |
I , genstartdate1, genstartdate2 |
I , genstartdate1, genstartdate2 |
123 |
I , useExfYearlyFields |
I , useExfYearlyFields |
124 |
O , fac, first, changed |
O , fac, first, changed |
125 |
O , count0, count1, year0, year1 |
O , count0, count1, year0, year1 |
126 |
I , mytime, myiter, mythid |
I , mytime, myiter, mythid |
127 |
& ) |
& ) |
128 |
|
|
129 |
|
endif |
130 |
|
|
131 |
if ( first ) then |
if ( first ) then |
132 |
if (useExfYearlyFields) then |
if (useExfYearlyFields.and.genperiod.gt.0) then |
133 |
C Complete filename with YR or _YEAR extension |
C Complete filename with YR or _YEAR extension |
134 |
il = ilnblnk( genfile ) |
il = ilnblnk( genfile ) |
135 |
if (twoDigitYear) then |
if (twoDigitYear) then |
147 |
else |
else |
148 |
genfile0 = genfile |
genfile0 = genfile |
149 |
endif |
endif |
150 |
|
|
151 |
|
|
152 |
#ifdef USE_EXF_INTERPOLATION |
#ifdef USE_EXF_INTERPOLATION |
153 |
call exf_interp( genfile0, exf_iprec |
call exf_interp( genfile0, exf_iprec |
154 |
& , gen1, count0, gen_xout, gen_yout |
& , gen1, count0, gen_xout, gen_yout |
172 |
if (( first ) .or. ( changed )) then |
if (( first ) .or. ( changed )) then |
173 |
call exf_SwapFFields( gen0, gen1, mythid ) |
call exf_SwapFFields( gen0, gen1, mythid ) |
174 |
|
|
175 |
if (useExfYearlyFields) then |
if (useExfYearlyFields.and.genperiod.gt.0) then |
176 |
C Complete filename with YR or _YEAR extension |
C Complete filename with YR or _YEAR extension |
177 |
il = ilnblnk( genfile ) |
il = ilnblnk( genfile ) |
178 |
if (twoDigitYear) then |
if (twoDigitYear) then |