1 |
heimbach |
1.13 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_set_climsst.F,v 1.12 2004/03/17 23:08:09 dimitri Exp $ |
2 |
heimbach |
1.1 |
|
3 |
edhill |
1.11 |
#include "EXF_OPTIONS.h" |
4 |
heimbach |
1.1 |
|
5 |
|
|
|
6 |
|
|
subroutine exf_set_climsst( |
7 |
heimbach |
1.3 |
O mycurrenttime |
8 |
heimbach |
1.1 |
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 |
heimbach |
1.3 |
c changed: heimbach@mit.edu 08-Feb-2002 |
24 |
dimitri |
1.5 |
c mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002 |
25 |
heimbach |
1.1 |
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 |
heimbach |
1.3 |
#include "exf_clim_fields.h" |
40 |
heimbach |
1.1 |
|
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 |
dimitri |
1.9 |
integer bi, bj, i, j, interp_method |
55 |
heimbach |
1.13 |
integer year0, year1 |
56 |
heimbach |
1.1 |
|
57 |
|
|
c == end of interface == |
58 |
|
|
|
59 |
dimitri |
1.5 |
if ( climsstfile .NE. ' ' ) then |
60 |
|
|
|
61 |
dimitri |
1.12 |
if ( climsstperiod .EQ. 0 ) then |
62 |
|
|
|
63 |
heimbach |
1.2 |
c record numbers are assumed 1 to 12 corresponding to |
64 |
|
|
c Jan. through Dec. |
65 |
dimitri |
1.12 |
call cal_GetMonthsRec( |
66 |
|
|
O fac, first, changed, |
67 |
|
|
O count0, count1, |
68 |
|
|
I mycurrenttime, mycurrentiter, mythid |
69 |
|
|
& ) |
70 |
|
|
|
71 |
|
|
else |
72 |
|
|
|
73 |
heimbach |
1.1 |
c get record numbers and interpolation factor for climsst |
74 |
heimbach |
1.13 |
|
75 |
dimitri |
1.12 |
call exf_GetFFieldRec( |
76 |
|
|
I climsststartdate, climsstperiod |
77 |
heimbach |
1.13 |
I , climsststartdate1, climsststartdate2 |
78 |
|
|
I , .false. |
79 |
dimitri |
1.12 |
O , fac, first, changed |
80 |
heimbach |
1.13 |
O , count0, count1, year0, year1 |
81 |
dimitri |
1.12 |
I , mycurrenttime, mycurrentiter, mythid |
82 |
|
|
& ) |
83 |
|
|
|
84 |
|
|
endif |
85 |
heimbach |
1.1 |
|
86 |
dimitri |
1.5 |
if ( first ) then |
87 |
dimitri |
1.7 |
#ifdef USE_EXF_INTERPOLATION |
88 |
dimitri |
1.9 |
interp_method = 2 |
89 |
dimitri |
1.8 |
call exf_interp( |
90 |
dimitri |
1.7 |
& climsstfile, exf_clim_iprec |
91 |
|
|
& , climsst1, count0, xC, yC |
92 |
|
|
& ,climsst_lon0,climsst_lon_inc |
93 |
|
|
& ,climsst_lat0,climsst_lat_inc |
94 |
dimitri |
1.9 |
& ,climsst_nlon,climsst_nlat,interp_method,mythid ) |
95 |
dimitri |
1.7 |
#else |
96 |
dimitri |
1.5 |
call mdsreadfield( climsstfile, exf_clim_iprec |
97 |
|
|
& , exf_clim_yftype, 1 |
98 |
|
|
& , climsst1, count0, mythid |
99 |
|
|
& ) |
100 |
dimitri |
1.7 |
#endif |
101 |
dimitri |
1.5 |
if (exf_clim_yftype .eq. 'RL') then |
102 |
|
|
call exf_filter_rl( climsst1, climsstmask, mythid ) |
103 |
|
|
else |
104 |
|
|
call exf_filter_rs( climsst1, climsstmask, mythid ) |
105 |
|
|
end if |
106 |
|
|
endif |
107 |
|
|
|
108 |
|
|
if (( first ) .or. ( changed )) then |
109 |
|
|
call exf_SwapFFields( climsst0, climsst1, mythid ) |
110 |
dimitri |
1.7 |
|
111 |
|
|
#ifdef USE_EXF_INTERPOLATION |
112 |
dimitri |
1.10 |
interp_method = 2 |
113 |
dimitri |
1.8 |
call exf_interp( |
114 |
dimitri |
1.7 |
& climsstfile, exf_iprec |
115 |
|
|
& , climsst1, count1, xC, yC |
116 |
|
|
& ,climsst_lon0,climsst_lon_inc |
117 |
|
|
& ,climsst_lat0,climsst_lat_inc |
118 |
dimitri |
1.9 |
& ,climsst_nlon,climsst_nlat,interp_method,mythid ) |
119 |
dimitri |
1.7 |
#else |
120 |
dimitri |
1.5 |
call mdsreadfield( climsstfile, exf_clim_iprec |
121 |
|
|
& , exf_clim_yftype, 1 |
122 |
|
|
& , climsst1, count1, mythid |
123 |
|
|
& ) |
124 |
dimitri |
1.7 |
#endif |
125 |
dimitri |
1.5 |
if (exf_clim_yftype .eq. 'RL') then |
126 |
|
|
call exf_filter_rl( climsst1, climsstmask, mythid ) |
127 |
|
|
else |
128 |
|
|
call exf_filter_rs( climsst1, climsstmask, mythid ) |
129 |
|
|
end if |
130 |
|
|
endif |
131 |
heimbach |
1.1 |
|
132 |
|
|
c Loop over tiles. |
133 |
dimitri |
1.5 |
do bj = mybylo(mythid),mybyhi(mythid) |
134 |
|
|
do bi = mybxlo(mythid),mybxhi(mythid) |
135 |
|
|
do j = 1,sny |
136 |
|
|
do i = 1,snx |
137 |
|
|
|
138 |
|
|
c Set to freezing temperature if less |
139 |
|
|
if (climsst0(i,j,bi,bj) .lt. climtempfreeze) then |
140 |
|
|
climsst0(i,j,bi,bj) = climtempfreeze |
141 |
|
|
endif |
142 |
|
|
if (climsst1(i,j,bi,bj) .lt. climtempfreeze) then |
143 |
|
|
climsst1(i,j,bi,bj) = climtempfreeze |
144 |
|
|
endif |
145 |
|
|
|
146 |
|
|
c Interpolate linearly onto the current time. |
147 |
|
|
climsst(i,j,bi,bj) = exf_inscal_sst * ( |
148 |
|
|
& fac * climsst0(i,j,bi,bj) + |
149 |
|
|
& (exf_one - fac) * climsst1(i,j,bi,bj) ) |
150 |
heimbach |
1.1 |
|
151 |
dimitri |
1.5 |
enddo |
152 |
|
|
enddo |
153 |
heimbach |
1.1 |
enddo |
154 |
dimitri |
1.5 |
enddo |
155 |
|
|
|
156 |
|
|
endif |
157 |
heimbach |
1.1 |
|
158 |
|
|
#endif /* ALLOW_CLIMSST_RELAXATION */ |
159 |
|
|
|
160 |
|
|
end |
161 |
|
|
|
162 |
|
|
|
163 |
|
|
subroutine exf_init_climsst( |
164 |
|
|
I mythid |
165 |
|
|
& ) |
166 |
|
|
|
167 |
|
|
c ================================================================== |
168 |
|
|
c SUBROUTINE exf_init_climsst |
169 |
|
|
c ================================================================== |
170 |
|
|
c |
171 |
|
|
c o |
172 |
|
|
c |
173 |
|
|
c started: Ralf.Giering@FastOpt.de 25-Mai-2000 |
174 |
|
|
c |
175 |
|
|
c ================================================================== |
176 |
|
|
c SUBROUTINE exf_init_climsst |
177 |
|
|
c ================================================================== |
178 |
|
|
|
179 |
|
|
implicit none |
180 |
|
|
|
181 |
|
|
c == global variables == |
182 |
|
|
|
183 |
|
|
#include "EEPARAMS.h" |
184 |
|
|
#include "SIZE.h" |
185 |
|
|
|
186 |
|
|
#include "exf_fields.h" |
187 |
|
|
#include "exf_param.h" |
188 |
|
|
#include "exf_clim_param.h" |
189 |
|
|
#include "exf_clim_fields.h" |
190 |
|
|
|
191 |
|
|
c == routine arguments == |
192 |
|
|
|
193 |
|
|
integer mythid |
194 |
|
|
|
195 |
|
|
#ifdef ALLOW_CLIMSST_RELAXATION |
196 |
|
|
|
197 |
|
|
c == local variables == |
198 |
|
|
|
199 |
|
|
integer bi, bj |
200 |
|
|
integer i, j |
201 |
|
|
|
202 |
|
|
c == end of interface == |
203 |
|
|
|
204 |
|
|
do bj = mybylo(mythid), mybyhi(mythid) |
205 |
|
|
do bi = mybxlo(mythid), mybxhi(mythid) |
206 |
|
|
do j = 1, sny |
207 |
|
|
do i = 1, snx |
208 |
heimbach |
1.6 |
climsst (i,j,bi,bj) = climsstconst |
209 |
heimbach |
1.1 |
climsst0(i,j,bi,bj) = 0. _d 0 |
210 |
|
|
climsst1(i,j,bi,bj) = 0. _d 0 |
211 |
|
|
enddo |
212 |
|
|
enddo |
213 |
|
|
enddo |
214 |
|
|
enddo |
215 |
|
|
|
216 |
|
|
#endif /* ALLOW_CLIMSSST_RELAXATION */ |
217 |
|
|
|
218 |
|
|
end |