1 |
heimbach |
1.1.4.1 |
c $Header$ |
2 |
heimbach |
1.1 |
|
3 |
|
|
#include "EXF_CPPOPTIONS.h" |
4 |
|
|
|
5 |
|
|
|
6 |
|
|
subroutine exf_set_climtemp( |
7 |
|
|
O climtemp |
8 |
|
|
I , mycurrenttime |
9 |
|
|
I , mycurrentiter |
10 |
|
|
I , mythid |
11 |
|
|
& ) |
12 |
|
|
|
13 |
|
|
c ================================================================== |
14 |
|
|
c SUBROUTINE exf_set_climtemp |
15 |
|
|
c ================================================================== |
16 |
|
|
c |
17 |
|
|
c o Get the current climatological sea surface salinity field. |
18 |
|
|
c |
19 |
|
|
c started: Christian Eckert eckert@mit.edu 27-Aug-1999 |
20 |
|
|
c |
21 |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Jan-2000 |
22 |
|
|
c |
23 |
|
|
c - Restructured the code in order to create a package |
24 |
|
|
c for the MITgcmUV. |
25 |
|
|
c |
26 |
|
|
c Christian Eckert eckert@mit.edu 12-Feb-2000 |
27 |
|
|
c |
28 |
|
|
c - Changed Routine names (package prefix: exf_) |
29 |
|
|
c |
30 |
|
|
c ================================================================== |
31 |
|
|
c SUBROUTINE exf_set_climtemp |
32 |
|
|
c ================================================================== |
33 |
|
|
|
34 |
|
|
implicit none |
35 |
|
|
|
36 |
|
|
#include "EEPARAMS.h" |
37 |
|
|
#include "SIZE.h" |
38 |
|
|
#include "GRID.h" |
39 |
|
|
|
40 |
|
|
#include "exf_param.h" |
41 |
|
|
#include "exf_constants.h" |
42 |
|
|
#include "exf_clim_param.h" |
43 |
|
|
|
44 |
|
|
c == routine arguments == |
45 |
|
|
|
46 |
|
|
_RL climtemp(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
47 |
|
|
_RL mycurrenttime |
48 |
|
|
integer mycurrentiter |
49 |
|
|
integer mythid |
50 |
|
|
|
51 |
|
|
#ifdef ALLOW_CLIMTEMP_RELAXATION |
52 |
|
|
|
53 |
|
|
c == local variables == |
54 |
|
|
|
55 |
|
|
common /exf_ctemp_r/ climtemp0, climtemp1 |
56 |
|
|
_RL climtemp0(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
57 |
|
|
_RL climtemp1(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
58 |
|
|
|
59 |
|
|
logical first, changed |
60 |
|
|
integer count0, count1 |
61 |
|
|
_RL fac |
62 |
|
|
|
63 |
|
|
integer bi, bj |
64 |
|
|
integer i, j, k |
65 |
|
|
|
66 |
|
|
c == end of interface == |
67 |
|
|
|
68 |
heimbach |
1.1.4.1 |
#ifdef ALLOW_CLIM_CYCLIC |
69 |
|
|
c record numbers are assumed 1 to 12 corresponding to |
70 |
|
|
c Jan. through Dec. |
71 |
|
|
call cal_GetMonthsRec( |
72 |
|
|
O fac, first, changed, |
73 |
|
|
O count0, count1, |
74 |
|
|
I mycurrenttime, mycurrentiter, mythid |
75 |
|
|
& ) |
76 |
|
|
#else |
77 |
heimbach |
1.1 |
c get record numbers and interpolation factor for climtemp |
78 |
|
|
call exf_GetFFieldRec( |
79 |
|
|
I climtempstartdate, climtempperiod |
80 |
|
|
O , fac, first, changed |
81 |
|
|
O , count0, count1 |
82 |
|
|
I , mycurrenttime, mycurrentiter, mythid |
83 |
|
|
& ) |
84 |
heimbach |
1.1.4.1 |
#endif |
85 |
heimbach |
1.1 |
|
86 |
heimbach |
1.1.4.1 |
#ifndef ALLOW_AUTODIFF_TAMC |
87 |
heimbach |
1.1 |
if ( first ) then |
88 |
heimbach |
1.1.4.1 |
#endif |
89 |
heimbach |
1.1 |
call mdsreadfield( climtempfile, exf_clim_iprec |
90 |
|
|
& , exf_clim_yftype, nr |
91 |
|
|
& , climtemp1, count0, mythid |
92 |
|
|
& ) |
93 |
|
|
if (exf_clim_yftype .eq. 'RL') then |
94 |
|
|
call exf_filter_rl( climtemp1, climtempmask, mythid ) |
95 |
|
|
else |
96 |
|
|
call exf_filter_rs( climtemp1, climtempmask, mythid ) |
97 |
|
|
end if |
98 |
heimbach |
1.1.4.1 |
#ifndef ALLOW_AUTODIFF_TAMC |
99 |
heimbach |
1.1 |
endif |
100 |
heimbach |
1.1.4.1 |
#endif |
101 |
heimbach |
1.1 |
|
102 |
heimbach |
1.1.4.1 |
#ifndef ALLOW_AUTODIFF_TAMC |
103 |
heimbach |
1.1 |
if (( first ) .or. ( changed )) then |
104 |
heimbach |
1.1.4.1 |
#endif |
105 |
heimbach |
1.1 |
call exf_SwapFFields_3d( climtemp0, climtemp1, mythid ) |
106 |
|
|
|
107 |
|
|
call mdsreadfield( climtempfile, exf_clim_iprec |
108 |
|
|
& , exf_clim_yftype, nr |
109 |
|
|
& , climtemp1, count1, mythid |
110 |
|
|
& ) |
111 |
|
|
if (exf_clim_yftype .eq. 'RL') then |
112 |
|
|
call exf_filter_rl( climtemp1, climtempmask, mythid ) |
113 |
|
|
else |
114 |
|
|
call exf_filter_rs( climtemp1, climtempmask, mythid ) |
115 |
|
|
end if |
116 |
heimbach |
1.1.4.1 |
#ifndef ALLOW_AUTODIFF_TAMC |
117 |
heimbach |
1.1 |
endif |
118 |
heimbach |
1.1.4.1 |
#endif |
119 |
heimbach |
1.1 |
|
120 |
|
|
c Loop over tiles. |
121 |
|
|
do bj = mybylo(mythid),mybyhi(mythid) |
122 |
|
|
do bi = mybxlo(mythid),mybxhi(mythid) |
123 |
|
|
do k = 1,nr |
124 |
|
|
do j = 1-oly,sny+oly |
125 |
|
|
do i = 1-olx,snx+olx |
126 |
|
|
|
127 |
|
|
c Set to freezing temperature if less |
128 |
heimbach |
1.1.4.1 |
if (climtemp0(i,j,k,bi,bj) .lt. climtempfreeze) then |
129 |
|
|
climtemp0(i,j,k,bi,bj) = climtempfreeze |
130 |
heimbach |
1.1 |
endif |
131 |
heimbach |
1.1.4.1 |
if (climtemp1(i,j,k,bi,bj) .lt. climtempfreeze) then |
132 |
|
|
climtemp1(i,j,k,bi,bj) = climtempfreeze |
133 |
heimbach |
1.1 |
endif |
134 |
|
|
|
135 |
|
|
c Interpolate linearly onto the current time. |
136 |
|
|
climtemp(i,j,k,bi,bj) = |
137 |
|
|
& fac *climtemp0(i,j,k,bi,bj)+ |
138 |
|
|
& (exf_one - fac) *climtemp1(i,j,k,bi,bj) |
139 |
|
|
|
140 |
|
|
enddo |
141 |
|
|
enddo |
142 |
|
|
enddo |
143 |
|
|
enddo |
144 |
|
|
enddo |
145 |
|
|
|
146 |
|
|
#endif /* ALLOW_CLIMTEMP_RELAXATION */ |
147 |
|
|
|
148 |
|
|
end |
149 |
|
|
|
150 |
|
|
|
151 |
|
|
subroutine exf_init_climtemp( |
152 |
|
|
I mythid |
153 |
|
|
& ) |
154 |
|
|
|
155 |
|
|
c ================================================================== |
156 |
|
|
c SUBROUTINE exf_init_climtemp |
157 |
|
|
c ================================================================== |
158 |
|
|
c |
159 |
|
|
c o |
160 |
|
|
c |
161 |
|
|
c started: Ralf.Giering@FastOpt.de 25-Mai-2000 |
162 |
|
|
c |
163 |
|
|
c ================================================================== |
164 |
|
|
c SUBROUTINE exf_init_climtemp |
165 |
|
|
c ================================================================== |
166 |
|
|
|
167 |
|
|
implicit none |
168 |
|
|
|
169 |
|
|
c == global variables == |
170 |
|
|
|
171 |
|
|
#include "EEPARAMS.h" |
172 |
|
|
#include "SIZE.h" |
173 |
|
|
|
174 |
|
|
#include "exf_fields.h" |
175 |
|
|
#include "exf_param.h" |
176 |
|
|
#include "exf_clim_fields.h" |
177 |
|
|
|
178 |
|
|
c == routine arguments == |
179 |
|
|
|
180 |
|
|
integer mythid |
181 |
|
|
|
182 |
|
|
#ifdef ALLOW_CLIMTEMP_RELAXATION |
183 |
|
|
|
184 |
|
|
c == local variables == |
185 |
|
|
|
186 |
|
|
common /exf_ctemp_r/ climtemp0, climtemp1 |
187 |
|
|
_RL climtemp0(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
188 |
|
|
_RL climtemp1(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) |
189 |
|
|
|
190 |
|
|
integer bi, bj |
191 |
|
|
integer i, j, k |
192 |
|
|
|
193 |
|
|
c == end of interface == |
194 |
|
|
|
195 |
|
|
do bj = mybylo(mythid), mybyhi(mythid) |
196 |
|
|
do bi = mybxlo(mythid), mybxhi(mythid) |
197 |
|
|
do k=1,nr |
198 |
|
|
do j = 1, sny |
199 |
|
|
do i = 1, snx |
200 |
|
|
climtemp (i,j,k,bi,bj) = 0. _d 0 |
201 |
|
|
climtemp0(i,j,k,bi,bj) = 0. _d 0 |
202 |
|
|
climtemp1(i,j,k,bi,bj) = 0. _d 0 |
203 |
|
|
enddo |
204 |
|
|
enddo |
205 |
|
|
enddo |
206 |
|
|
enddo |
207 |
|
|
enddo |
208 |
|
|
|
209 |
|
|
#endif /* ALLOW_CLIMTEMP_RELAXATION */ |
210 |
|
|
|
211 |
|
|
end |