1 |
heimbach |
1.1 |
#include "EXF_CPPOPTIONS.h" |
2 |
|
|
|
3 |
|
|
subroutine exf_set_atemp( |
4 |
|
|
O atemp |
5 |
|
|
I , mycurrenttime |
6 |
|
|
I , mycurrentiter |
7 |
|
|
I , mythid |
8 |
|
|
& ) |
9 |
|
|
|
10 |
|
|
c ================================================================== |
11 |
|
|
c SUBROUTINE exf_set_atemp |
12 |
|
|
c ================================================================== |
13 |
|
|
c |
14 |
|
|
c o set external forcing atemp |
15 |
|
|
c |
16 |
|
|
c started: Ralf.Giering@FastOpt.de 25-Mai-2000 |
17 |
|
|
|
18 |
|
|
c ================================================================== |
19 |
|
|
c SUBROUTINE exf_set_atemp |
20 |
|
|
c ================================================================== |
21 |
|
|
|
22 |
|
|
implicit none |
23 |
|
|
|
24 |
|
|
c == global variables == |
25 |
|
|
|
26 |
|
|
#include "EEPARAMS.h" |
27 |
|
|
#include "SIZE.h" |
28 |
|
|
#include "GRID.h" |
29 |
|
|
|
30 |
|
|
#include "exf_param.h" |
31 |
|
|
#include "exf_constants.h" |
32 |
|
|
|
33 |
|
|
common /exfl_atemp_r/ atemp0, atemp1 |
34 |
|
|
_RL atemp0(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
35 |
|
|
_RL atemp1(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
36 |
|
|
|
37 |
|
|
c == routine arguments == |
38 |
|
|
|
39 |
|
|
_RL atemp(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
40 |
|
|
_RL mycurrenttime |
41 |
|
|
integer mycurrentiter |
42 |
|
|
integer mythid |
43 |
|
|
|
44 |
|
|
c == local variables == |
45 |
|
|
|
46 |
|
|
logical first, changed |
47 |
|
|
integer count0, count1 |
48 |
|
|
_RL fac |
49 |
|
|
|
50 |
|
|
integer bi, bj |
51 |
|
|
integer i, j |
52 |
|
|
|
53 |
|
|
c == end of interface == |
54 |
|
|
|
55 |
|
|
c get record numbers and interpolation factor for atemp |
56 |
|
|
call exf_GetFFieldRec( |
57 |
|
|
I atempstartdate, atempperiod |
58 |
|
|
O , fac, first, changed |
59 |
|
|
O , count0, count1 |
60 |
|
|
I , mycurrenttime, mycurrentiter, mythid |
61 |
|
|
& ) |
62 |
|
|
|
63 |
|
|
#ifndef ALLOW_AUTODIFF_TAMC |
64 |
|
|
if ( first ) then |
65 |
|
|
#endif |
66 |
|
|
call mdsreadfield( atempfile, exf_iprec, exf_yftype, 1 |
67 |
|
|
& , atemp1, count0, mythid |
68 |
|
|
& ) |
69 |
|
|
if (exf_yftype .eq. 'RL') then |
70 |
|
|
call exf_filter_rl( atemp1, atempmask, mythid ) |
71 |
|
|
else |
72 |
|
|
call exf_filter_rs( atemp1, atempmask, mythid ) |
73 |
|
|
end if |
74 |
|
|
#ifndef ALLOW_AUTODIFF_TAMC |
75 |
|
|
endif |
76 |
|
|
#endif |
77 |
|
|
|
78 |
|
|
#ifndef ALLOW_AUTODIFF_TAMC |
79 |
|
|
if (( first ) .or. ( changed )) then |
80 |
|
|
#endif |
81 |
|
|
call exf_SwapFFields( atemp0, atemp1, mythid ) |
82 |
|
|
|
83 |
|
|
call mdsreadfield( atempfile, exf_iprec, exf_yftype, 1 |
84 |
|
|
& , atemp1, count1, mythid |
85 |
|
|
& ) |
86 |
|
|
if (exf_yftype .eq. 'RL') then |
87 |
|
|
call exf_filter_rl( atemp1, atempmask, mythid ) |
88 |
|
|
else |
89 |
|
|
call exf_filter_rs( atemp1, atempmask, mythid ) |
90 |
|
|
end if |
91 |
|
|
#ifndef ALLOW_AUTODIFF_TAMC |
92 |
|
|
endif |
93 |
|
|
#endif |
94 |
|
|
|
95 |
|
|
c Loop over tiles. |
96 |
|
|
do bj = mybylo(mythid),mybyhi(mythid) |
97 |
|
|
do bi = mybxlo(mythid),mybxhi(mythid) |
98 |
|
|
do j = 1,sny |
99 |
|
|
do i = 1,snx |
100 |
|
|
|
101 |
|
|
c Interpolate linearly onto the current time. |
102 |
|
|
|
103 |
|
|
atemp(i,j,bi,bj) = fac *atemp0(i,j,bi,bj)+ |
104 |
|
|
& (exf_one - fac) *atemp1(i,j,bi,bj) |
105 |
|
|
|
106 |
|
|
enddo |
107 |
|
|
enddo |
108 |
|
|
enddo |
109 |
|
|
enddo |
110 |
|
|
|
111 |
|
|
end |
112 |
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
subroutine exf_init_atemp( |
116 |
|
|
I mythid |
117 |
|
|
& ) |
118 |
|
|
|
119 |
|
|
c ================================================================== |
120 |
|
|
c SUBROUTINE exf_init_atemp |
121 |
|
|
c ================================================================== |
122 |
|
|
c |
123 |
|
|
c o |
124 |
|
|
c |
125 |
|
|
c started: Ralf.Giering@FastOpt.de 25-Mai-2000 |
126 |
|
|
c |
127 |
|
|
c ================================================================== |
128 |
|
|
c SUBROUTINE exf_init_atemp |
129 |
|
|
c ================================================================== |
130 |
|
|
|
131 |
|
|
implicit none |
132 |
|
|
|
133 |
|
|
c == global variables == |
134 |
|
|
|
135 |
|
|
#include "EEPARAMS.h" |
136 |
|
|
#include "SIZE.h" |
137 |
|
|
|
138 |
|
|
#include "exf_param.h" |
139 |
|
|
|
140 |
|
|
common /exfl_atemp_r/ atemp0, atemp1 |
141 |
|
|
_RL atemp0(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
142 |
|
|
_RL atemp1(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
143 |
|
|
|
144 |
|
|
c == routine arguments == |
145 |
|
|
|
146 |
|
|
integer mythid |
147 |
|
|
|
148 |
|
|
c == local variables == |
149 |
|
|
|
150 |
|
|
integer bi, bj |
151 |
|
|
integer i, j |
152 |
|
|
|
153 |
|
|
c == end of interface == |
154 |
|
|
|
155 |
|
|
do bj = mybylo(mythid), mybyhi(mythid) |
156 |
|
|
do bi = mybxlo(mythid), mybxhi(mythid) |
157 |
|
|
do j = 1, sny |
158 |
|
|
do i = 1, snx |
159 |
|
|
atemp0(i,j,bi,bj) = 0. _d 0 |
160 |
|
|
atemp1(i,j,bi,bj) = 0. _d 0 |
161 |
|
|
enddo |
162 |
|
|
enddo |
163 |
|
|
enddo |
164 |
|
|
enddo |
165 |
|
|
|
166 |
|
|
end |