6 |
|
|
7 |
subroutine exf_set_uv( |
subroutine exf_set_uv( |
8 |
& uvecfile, uvecstartdate, uvecperiod, |
& uvecfile, uvecstartdate, uvecperiod, |
9 |
|
& uvecstartdate1, uvecstartdate2, |
10 |
& exf_inscal_uvec, uvec, uvec0, uvec1, uvecmask, |
& exf_inscal_uvec, uvec, uvec0, uvec1, uvecmask, |
11 |
& uvec_lon0, uvec_lon_inc, uvec_lat0, uvec_lat_inc, |
& uvec_lon0, uvec_lon_inc, uvec_lat0, uvec_lat_inc, |
12 |
& uvec_nlon, uvec_nlat, |
& uvec_nlon, uvec_nlat, |
13 |
& vvecfile, vvecstartdate, vvecperiod, |
& vvecfile, vvecstartdate, vvecperiod, |
14 |
|
& vvecstartdate1, vvecstartdate2, |
15 |
& exf_inscal_vvec, vvec, vvec0, vvec1, vvecmask, |
& exf_inscal_vvec, vvec, vvec0, vvec1, vvecmask, |
16 |
& vvec_lon0, vvec_lon_inc, vvec_lat0, vvec_lat_inc, |
& vvec_lon0, vvec_lon_inc, vvec_lat0, vvec_lat_inc, |
17 |
& vvec_nlon, vvec_nlat, |
& vvec_nlon, vvec_nlat, |
57 |
c *vec_lon_inc :: scalar x-grid increment for *vec |
c *vec_lon_inc :: scalar x-grid increment for *vec |
58 |
c *vec_lat_inc :: vector y-grid increments for *vec |
c *vec_lat_inc :: vector y-grid increments for *vec |
59 |
|
|
60 |
character*(128) uvecfile |
character*(128) uvecfile, uvecfile0, uvecfile1 |
61 |
_RL uvecstartdate, uvecperiod |
_RL uvecstartdate, uvecperiod |
62 |
|
_RL uvecstartdate1, uvecstartdate2 |
63 |
_RL exf_inscal_uvec |
_RL exf_inscal_uvec |
64 |
_RL uvec (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL uvec (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
65 |
_RL uvec0 (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL uvec0 (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
68 |
_RL uvec_lon0, uvec_lon_inc |
_RL uvec_lon0, uvec_lon_inc |
69 |
_RL uvec_lat0, uvec_lat_inc(MAX_LAT_INC) |
_RL uvec_lat0, uvec_lat_inc(MAX_LAT_INC) |
70 |
INTEGER uvec_nlon, uvec_nlat |
INTEGER uvec_nlon, uvec_nlat |
71 |
character*(128) vvecfile |
character*(128) vvecfile, vvecfile0, vvecfile1 |
72 |
_RL vvecstartdate, vvecperiod |
_RL vvecstartdate, vvecperiod |
73 |
|
_RL vvecstartdate1, vvecstartdate2 |
74 |
_RL exf_inscal_vvec |
_RL exf_inscal_vvec |
75 |
_RL vvec (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL vvec (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
76 |
_RL vvec0 (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL vvec0 (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
92 |
_RL tmp_v (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL tmp_v (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
93 |
integer count0, count1 |
integer count0, count1 |
94 |
integer i, j, bi, bj |
integer i, j, bi, bj |
95 |
integer interp_method |
integer il, interp_method |
96 |
parameter(interp_method=2) |
parameter(interp_method=2) |
97 |
|
integer year0, year1 |
98 |
|
|
99 |
|
c == external == |
100 |
|
|
101 |
|
integer ilnblnk |
102 |
|
external ilnblnk |
103 |
|
|
104 |
c == end of interface == |
c == end of interface == |
105 |
|
|
107 |
|
|
108 |
if ( uvecfile .NE. ' ' .and. vvecfile .NE. ' ' ) then |
if ( uvecfile .NE. ' ' .and. vvecfile .NE. ' ' ) then |
109 |
|
|
|
c some restrictions that can be relaxed later on |
|
|
if ( uvecstartdate .ne. vvecstartdate .or. |
|
|
& uvecperiod .ne. vvecperiod ) then |
|
|
print*,'For useCubedSphereExchange, S/R exf_set_uv.F' |
|
|
print*,'assumes that the u and v wind or wind stress' |
|
|
print*,'files have the same startdate and period.' |
|
|
stop |
|
|
endif |
|
|
|
|
110 |
c get record numbers and interpolation factor |
c get record numbers and interpolation factor |
111 |
call exf_GetFFieldRec( |
call exf_GetFFieldRec( |
112 |
I uvecstartdate, uvecperiod |
I uvecstartdate, uvecperiod |
113 |
|
I , uvecstartdate1, uvecstartdate2 |
114 |
|
I , useExfYearlyFields |
115 |
O , fac, first, changed |
O , fac, first, changed |
116 |
O , count0, count1 |
O , count0, count1, year0, year1 |
117 |
I , mycurrenttime, mycurrentiter, mythid |
I , mycurrenttime, mycurrentiter, mythid |
118 |
& ) |
& ) |
119 |
|
|
120 |
if ( first ) then |
if ( first ) then |
121 |
|
if (useExfYearlyFields) then |
122 |
|
il = ilnblnk( uvecfile ) |
123 |
|
write(uvecfile0(1:128),'(2a,i4.4)') |
124 |
|
& uvecfile(1:il),'_',year0 |
125 |
|
il = ilnblnk( vvecfile ) |
126 |
|
write(vvecfile0(1:128),'(2a,i4.4)') |
127 |
|
& vvecfile(1:il),'_',year0 |
128 |
|
else |
129 |
|
uvecfile0 = uvecfile |
130 |
|
vvecfile0 = vvecfile |
131 |
|
endif |
132 |
c scalar interpolation to (xC,yC) locations |
c scalar interpolation to (xC,yC) locations |
133 |
call exf_interp( uvecfile, exf_iprec |
call exf_interp( uvecfile0, exf_iprec |
134 |
& , tmp_u, count0, xC, yC |
& , tmp_u, count0, xC, yC |
135 |
& , uvec_lon0,uvec_lon_inc |
& , uvec_lon0,uvec_lon_inc |
136 |
& , uvec_lat0,uvec_lat_inc |
& , uvec_lat0,uvec_lat_inc |
137 |
& , uvec_nlon,uvec_nlat,interp_method,mythid |
& , uvec_nlon,uvec_nlat,interp_method,mythid |
138 |
& ) |
& ) |
139 |
call exf_interp( vvecfile, exf_iprec |
call exf_interp( vvecfile0, exf_iprec |
140 |
& , tmp_v, count0, xC, yC |
& , tmp_v, count0, xC, yC |
141 |
& , vvec_lon0,vvec_lon_inc |
& , vvec_lon0,vvec_lon_inc |
142 |
& , vvec_lat0,vvec_lat_inc |
& , vvec_lat0,vvec_lat_inc |
188 |
if (( first ) .or. ( changed )) then |
if (( first ) .or. ( changed )) then |
189 |
call exf_SwapFFields( uvec0, uvec1, mythid ) |
call exf_SwapFFields( uvec0, uvec1, mythid ) |
190 |
call exf_SwapFFields( vvec0, vvec1, mythid ) |
call exf_SwapFFields( vvec0, vvec1, mythid ) |
191 |
|
if (useExfYearlyFields) then |
192 |
|
il = ilnblnk( uvecfile ) |
193 |
|
write(uvecfile1(1:128),'(2a,i4.4)') |
194 |
|
& uvecfile(1:il),'_',year0 |
195 |
|
il = ilnblnk( vvecfile ) |
196 |
|
write(vvecfile1(1:128),'(2a,i4.4)') |
197 |
|
& vvecfile(1:il),'_',year0 |
198 |
|
else |
199 |
|
uvecfile1 = uvecfile |
200 |
|
vvecfile1 = vvecfile |
201 |
|
endif |
202 |
c scalar interpolation to (xC,yC) locations |
c scalar interpolation to (xC,yC) locations |
203 |
call exf_interp( uvecfile, exf_iprec |
call exf_interp( uvecfile1, exf_iprec |
204 |
& , tmp_u, count1, xC, yC |
& , tmp_u, count1, xC, yC |
205 |
& , uvec_lon0,uvec_lon_inc |
& , uvec_lon0,uvec_lon_inc |
206 |
& , uvec_lat0,uvec_lat_inc |
& , uvec_lat0,uvec_lat_inc |
207 |
& , uvec_nlon,uvec_nlat,interp_method,mythid |
& , uvec_nlon,uvec_nlat,interp_method,mythid |
208 |
& ) |
& ) |
209 |
call exf_interp( vvecfile, exf_iprec |
call exf_interp( vvecfile1, exf_iprec |
210 |
& , tmp_v, count1, xC, yC |
& , tmp_v, count1, xC, yC |
211 |
& , vvec_lon0,vvec_lon_inc |
& , vvec_lon0,vvec_lon_inc |
212 |
& , vvec_lat0,vvec_lat_inc |
& , vvec_lat0,vvec_lat_inc |
278 |
|
|
279 |
call exf_set_gen( |
call exf_set_gen( |
280 |
& uvecfile, uvecstartdate, uvecperiod, |
& uvecfile, uvecstartdate, uvecperiod, |
281 |
|
I uvecstartdate1, uvecstartdate2, |
282 |
& exf_inscal_uvec, |
& exf_inscal_uvec, |
283 |
& uvec, uvec0, uvec1, uvecmask, |
& uvec, uvec0, uvec1, uvecmask, |
284 |
& uvec_lon0, uvec_lon_inc, uvec_lat0, uvec_lat_inc, |
& uvec_lon0, uvec_lon_inc, uvec_lat0, uvec_lat_inc, |
286 |
& mycurrenttime, mycurrentiter, mythid ) |
& mycurrenttime, mycurrentiter, mythid ) |
287 |
call exf_set_gen( |
call exf_set_gen( |
288 |
& vvecfile, vvecstartdate, vvecperiod, |
& vvecfile, vvecstartdate, vvecperiod, |
289 |
|
I vvecstartdate1, vvecstartdate2, |
290 |
& exf_inscal_vvec, |
& exf_inscal_vvec, |
291 |
& vvec, vvec0, vvec1, vvecmask, |
& vvec, vvec0, vvec1, vvecmask, |
292 |
& vvec_lon0, vvec_lon_inc, vvec_lat0, vvec_lat_inc, |
& vvec_lon0, vvec_lon_inc, vvec_lat0, vvec_lat_inc, |