1 |
#include "EXF_CPPOPTIONS.h" |
2 |
|
3 |
subroutine exf_set_hfluxa( |
4 |
O hfluxa |
5 |
I , mycurrenttime |
6 |
I , mycurrentiter |
7 |
I , mythid |
8 |
& ) |
9 |
|
10 |
c ================================================================== |
11 |
c SUBROUTINE exf_set_hfluxa |
12 |
c ================================================================== |
13 |
c |
14 |
c o set external forcing hfluxa |
15 |
c |
16 |
c started: Ralf.Giering@FastOpt.de 25-Mai-2000 |
17 |
|
18 |
c ================================================================== |
19 |
c SUBROUTINE exf_set_hfluxa |
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 "exfa_param.h" |
31 |
#include "exf_constants.h" |
32 |
|
33 |
common /exfl_hfluxa_r/ hfluxa0, hfluxa1 |
34 |
_RL hfluxa0(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
35 |
_RL hfluxa1(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
36 |
|
37 |
c == routine arguments == |
38 |
|
39 |
_RL hfluxa(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 hfluxa |
56 |
call exf_GetFFieldRec( |
57 |
I hfluxastartdate, hfluxaperiod |
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( hfluxafile, exf_iprec, exf_yftype, 1 |
67 |
& , hfluxa1, count0, mythid |
68 |
& ) |
69 |
if (exf_yftype .eq. 'RL') then |
70 |
call exf_filter_rl( hfluxa1, hfluxamask, mythid ) |
71 |
else |
72 |
call exf_filter_rs( hfluxa1, hfluxamask, 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( hfluxa0, hfluxa1, mythid ) |
82 |
|
83 |
call mdsreadfield( hfluxafile, exf_iprec, exf_yftype, 1 |
84 |
& , hfluxa1, count1, mythid |
85 |
& ) |
86 |
if (exf_yftype .eq. 'RL') then |
87 |
call exf_filter_rl( hfluxa1, hfluxamask, mythid ) |
88 |
else |
89 |
call exf_filter_rs( hfluxa1, hfluxamask, 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 |
hfluxa(i,j,bi,bj) = fac *hfluxa0(i,j,bi,bj)+ |
104 |
& (exf_one - fac) *hfluxa1(i,j,bi,bj) |
105 |
|
106 |
enddo |
107 |
enddo |
108 |
enddo |
109 |
enddo |
110 |
|
111 |
end |
112 |
|
113 |
|
114 |
|
115 |
subroutine exf_init_hfluxa( |
116 |
I mythid |
117 |
& ) |
118 |
|
119 |
c ================================================================== |
120 |
c SUBROUTINE exf_init_hfluxa |
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_hfluxa |
129 |
c ================================================================== |
130 |
|
131 |
implicit none |
132 |
|
133 |
c == global variables == |
134 |
|
135 |
#include "EEPARAMS.h" |
136 |
#include "SIZE.h" |
137 |
|
138 |
#include "exfa_param.h" |
139 |
|
140 |
common /exfl_hfluxa_r/ hfluxa0, hfluxa1 |
141 |
_RL hfluxa0(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
142 |
_RL hfluxa1(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 |
hfluxa0(i,j,bi,bj) = 0. _d 0 |
160 |
hfluxa1(i,j,bi,bj) = 0. _d 0 |
161 |
enddo |
162 |
enddo |
163 |
enddo |
164 |
enddo |
165 |
|
166 |
end |