1 |
#include "EXF_CPPOPTIONS.h" |
#include "EXF_OPTIONS.h" |
2 |
|
|
3 |
subroutine exf_set_gen( |
subroutine exf_set_gen( |
4 |
& genfile, genstartdate, genperiod, exf_inscal_gen, |
& genfile, genstartdate, genperiod, exf_inscal_gen, |
5 |
& genfld, gen0, gen1, genmask, |
& genfld, gen0, gen1, genmask, |
6 |
#ifdef USE_EXF_INTERPOLATION |
#ifdef USE_EXF_INTERPOLATION |
7 |
& gen_lon0, gen_lon_inc, gen_lat0, gen_lat_inc, |
& gen_lon0, gen_lon_inc, gen_lat0, gen_lat_inc, |
8 |
& gen_nlon, gen_nlat, |
& gen_nlon, gen_nlat, gen_xout, gen_yout, |
9 |
#endif |
#endif |
10 |
& mycurrenttime, mycurrentiter, mythid ) |
& mycurrenttime, mycurrentiter, mythid ) |
11 |
|
|
17 |
c |
c |
18 |
c started: Ralf.Giering@FastOpt.de 25-Mai-2000 |
c started: Ralf.Giering@FastOpt.de 25-Mai-2000 |
19 |
c changed: heimbach@mit.edu 10-Jan-2002 |
c changed: heimbach@mit.edu 10-Jan-2002 |
20 |
c mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002 |
c 20-Dec-2002: mods for pkg/seaice, menemenlis@jpl.nasa.gov |
21 |
c heimbach@mit.edu: totally re-organized exf_set_... |
c heimbach@mit.edu: totally re-organized exf_set_... |
22 |
c replaced all routines by one generic routine |
c replaced all routines by one generic routine |
23 |
|
c 5-Aug-2003: added USE_EXF_INTERPOLATION for arbitrary |
24 |
|
c input grid capability |
25 |
|
|
26 |
c ================================================================== |
c ================================================================== |
27 |
c SUBROUTINE exf_set_gen |
c SUBROUTINE exf_set_gen |
40 |
|
|
41 |
c == routine arguments == |
c == routine arguments == |
42 |
|
|
43 |
integer genstartdate(4) |
_RL genstartdate, genperiod |
|
_RL genperiod |
|
44 |
_RL exf_inscal_gen |
_RL exf_inscal_gen |
45 |
_RL genfld(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL genfld(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
46 |
_RL gen0 (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
_RL gen0 (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
51 |
integer mycurrentiter |
integer mycurrentiter |
52 |
integer mythid |
integer mythid |
53 |
#ifdef USE_EXF_INTERPOLATION |
#ifdef USE_EXF_INTERPOLATION |
54 |
|
c gen_lon_0 ,gen_lat_0 :: longitude and latitude of SouthWest |
55 |
|
c corner of global input grid |
56 |
|
c gen_nlon, gen_nlat :: input x-grid and y-grid size |
57 |
|
c gen_lon_inc :: scalar x-grid increment |
58 |
|
c gen_lat_inc :: vector y-grid increments |
59 |
|
c gen_xout, gen_yout :: coordinates for output grid |
60 |
_RL gen_lon0, gen_lon_inc |
_RL gen_lon0, gen_lon_inc |
61 |
_RL gen_lat0, gen_lat_inc(MAX_LAT_INC) |
_RL gen_lat0, gen_lat_inc(MAX_LAT_INC) |
62 |
INTEGER gen_nlon, gen_nlat |
INTEGER gen_nlon, gen_nlat |
63 |
|
_RS gen_xout (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
64 |
|
_RS gen_yout (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
65 |
#endif |
#endif |
66 |
|
|
67 |
c == local variables == |
c == local variables == |
71 |
_RL fac |
_RL fac |
72 |
|
|
73 |
integer bi, bj |
integer bi, bj |
74 |
integer i, j |
integer i, j, interp_method |
75 |
|
|
76 |
c == end of interface == |
c == end of interface == |
77 |
|
|
87 |
|
|
88 |
if ( first ) then |
if ( first ) then |
89 |
#ifdef USE_EXF_INTERPOLATION |
#ifdef USE_EXF_INTERPOLATION |
90 |
call new_interp( genfile, exf_iprec |
interp_method = 2 |
91 |
& , gen1, count0, xC, yC |
call exf_interp( genfile, exf_iprec |
92 |
|
& , gen1, count0, gen_xout, gen_yout |
93 |
& , gen_lon0,gen_lon_inc |
& , gen_lon0,gen_lon_inc |
94 |
& , gen_lat0,gen_lat_inc |
& , gen_lat0,gen_lat_inc |
95 |
& , gen_nlon,gen_nlat,mythid |
& , gen_nlon,gen_nlat,interp_method,mythid |
96 |
& ) |
& ) |
97 |
#else |
#else |
98 |
call mdsreadfield( genfile, exf_iprec, exf_yftype, 1 |
call mdsreadfield( genfile, exf_iprec, exf_yftype, 1 |
111 |
call exf_SwapFFields( gen0, gen1, mythid ) |
call exf_SwapFFields( gen0, gen1, mythid ) |
112 |
|
|
113 |
#ifdef USE_EXF_INTERPOLATION |
#ifdef USE_EXF_INTERPOLATION |
114 |
call new_interp( genfile, exf_iprec |
interp_method = 2 |
115 |
& , gen1, count1, xC, yC |
call exf_interp( genfile, exf_iprec |
116 |
|
& , gen1, count1, gen_xout, gen_yout |
117 |
& , gen_lon0,gen_lon_inc |
& , gen_lon0,gen_lon_inc |
118 |
& , gen_lat0,gen_lat_inc |
& , gen_lat0,gen_lat_inc |
119 |
& , gen_nlon,gen_nlat,mythid |
& , gen_nlon,gen_nlat,interp_method,mythid |
120 |
& ) |
& ) |
121 |
#else |
#else |
122 |
call mdsreadfield( genfile, exf_iprec, exf_yftype, 1 |
call mdsreadfield( genfile, exf_iprec, exf_yftype, 1 |