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