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