1 |
C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_getclim.F,v 1.24 2014/10/20 03:13:32 gforget Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "EXF_OPTIONS.h" |
5 |
#ifdef ALLOW_CTRL |
6 |
# include "CTRL_OPTIONS.h" |
7 |
#endif |
8 |
#ifdef ALLOW_ECCO |
9 |
# include "ECCO_OPTIONS.h" |
10 |
#endif |
11 |
|
12 |
subroutine exf_getclim( |
13 |
I mytime, |
14 |
I myiter, |
15 |
I mythid |
16 |
& ) |
17 |
|
18 |
c ================================================================== |
19 |
c SUBROUTINE exf_getclim |
20 |
c ================================================================== |
21 |
c |
22 |
c o Get the climatogy fields for the current time step. The switches |
23 |
c for the inclusion of the individual forcing components have to |
24 |
c be set in EXF_OPTIONS.h . |
25 |
c |
26 |
c A note on surface fluxes: |
27 |
c |
28 |
c The MITgcm-UV vertical coordinate z is positive upward. |
29 |
c This implies that a positive flux is out of the ocean |
30 |
c model. However, the wind stress forcing is not treated |
31 |
c this way. A positive zonal wind stress accelerates the |
32 |
c model ocean towards the east. |
33 |
c |
34 |
c started: Ralf.Giering@FastOpt.de 25-Mai-2000 |
35 |
c |
36 |
c ================================================================== |
37 |
c SUBROUTINE exf_getclim |
38 |
c ================================================================== |
39 |
|
40 |
implicit none |
41 |
|
42 |
c == global variables == |
43 |
#include "EEPARAMS.h" |
44 |
#include "SIZE.h" |
45 |
#include "GRID.h" |
46 |
#ifdef ALLOW_BULK_OFFLINE |
47 |
# include "PARAMS.h" |
48 |
# include "DYNVARS.h" |
49 |
#endif |
50 |
#include "EXF_PARAM.h" |
51 |
#include "EXF_CONSTANTS.h" |
52 |
#include "EXF_FIELDS.h" |
53 |
#if (defined (ALLOW_CTRL) && defined (ECCO_CTRL_DEPRECATED)) |
54 |
# include "CTRL_SIZE.h" |
55 |
# include "ctrl.h" |
56 |
# include "ctrl_dummy.h" |
57 |
# ifdef ALLOW_ECCO |
58 |
# include "ecco_cost.h" |
59 |
# endif |
60 |
#endif |
61 |
|
62 |
c == routine arguments == |
63 |
|
64 |
c mythid - thread number for this instance of the routine. |
65 |
|
66 |
_RL mytime |
67 |
integer myiter |
68 |
integer mythid |
69 |
|
70 |
c == local variables == |
71 |
|
72 |
integer bi, bj, i, j |
73 |
|
74 |
c == end of interface == |
75 |
|
76 |
#ifdef ALLOW_CLIMSST_RELAXATION |
77 |
c Get values of climatological sst fields. |
78 |
call exf_set_gen ( |
79 |
& climsstfile, climsststartdate, climsstperiod, |
80 |
& exf_inscal_climsst, |
81 |
& climsst_exfremo_intercept, climsst_exfremo_slope, |
82 |
& climsst, climsst0, climsst1, climsstmask, |
83 |
#ifdef USE_EXF_INTERPOLATION |
84 |
& climsst_lon0, climsst_lon_inc, climsst_lat0, climsst_lat_inc, |
85 |
& climsst_nlon, climsst_nlat, xC, yC, climsst_interpMethod, |
86 |
#endif |
87 |
& mytime, myiter, mythid ) |
88 |
|
89 |
do bj = mybylo(mythid),mybyhi(mythid) |
90 |
do bi = mybxlo(mythid),mybxhi(mythid) |
91 |
do j = 1,sny |
92 |
do i = 1,snx |
93 |
if (climsst(i,j,bi,bj) .lt. climtempfreeze) then |
94 |
climsst(i,j,bi,bj) = climtempfreeze |
95 |
endif |
96 |
enddo |
97 |
enddo |
98 |
enddo |
99 |
enddo |
100 |
|
101 |
c-- Update the tile edges. |
102 |
_EXCH_XY_RL(climsst, mythid) |
103 |
#endif |
104 |
|
105 |
#if (defined (ALLOW_CTRL) && defined (ECCO_CTRL_DEPRECATED)) |
106 |
# ifdef ALLOW_SST_CONTROL |
107 |
call CTRL_GET_GEN ( |
108 |
& xx_sst_file, xx_sststartdate, xx_sstperiod, |
109 |
& maskc, climsst, xx_sst0, xx_sst1, xx_sst_dummy, |
110 |
& xx_sst_remo_intercept, xx_sst_remo_slope, |
111 |
& wsst, mytime, myiter, mythid ) |
112 |
# endif |
113 |
#endif |
114 |
|
115 |
#ifdef ALLOW_CLIMSSS_RELAXATION |
116 |
c Get values of climatological sss fields. |
117 |
call exf_set_gen ( |
118 |
& climsssfile, climsssstartdate, climsssperiod, |
119 |
& exf_inscal_climsss, |
120 |
& climsss_exfremo_intercept, climsss_exfremo_slope, |
121 |
& climsss, climsss0, climsss1, climsssmask, |
122 |
#ifdef USE_EXF_INTERPOLATION |
123 |
& climsss_lon0, climsss_lon_inc, climsss_lat0, climsss_lat_inc, |
124 |
& climsss_nlon, climsss_nlat, xC, yC, climsss_interpMethod, |
125 |
#endif |
126 |
& mytime, myiter, mythid ) |
127 |
|
128 |
c-- Update the tile edges. |
129 |
_EXCH_XY_RL(climsss, mythid) |
130 |
#endif |
131 |
|
132 |
#if (defined (ALLOW_CTRL) && defined (ECCO_CTRL_DEPRECATED)) |
133 |
# ifdef ALLOW_SSS_CONTROL |
134 |
call CTRL_GET_GEN ( |
135 |
& xx_sss_file, xx_sssstartdate, xx_sssperiod, |
136 |
& maskc, climsss, xx_sss0, xx_sss1, xx_sss_dummy, |
137 |
& xx_sss_remo_intercept, xx_sss_remo_slope, |
138 |
& wsss, mytime, myiter, mythid ) |
139 |
# endif |
140 |
#endif |
141 |
|
142 |
#ifdef ALLOW_CLIMSTRESS_RELAXATION |
143 |
c Get values of climatological ustr fields. |
144 |
call exf_set_uv ( |
145 |
I climustrfile, climustrstartdate, climustrperiod, |
146 |
I exf_inscal_climustr, |
147 |
I climustr_exfremo_intercept, climustr_exfremo_slope, |
148 |
U climustr, climustr0, climustr1, climustrmask, |
149 |
I climvstrfile, climvstrstartdate, climvstrperiod, |
150 |
I exf_inscal_climvstr, |
151 |
I climvstr_exfremo_intercept, climvstr_exfremo_slope, |
152 |
U climvstr, climvstr0, climvstr1, climvstrmask, |
153 |
#ifdef USE_EXF_INTERPOLATION |
154 |
I climustr_lon0, climustr_lon_inc, |
155 |
I climustr_lat0, climustr_lat_inc, |
156 |
I climustr_nlon, climustr_nlat, climustr_interpMethod, |
157 |
I climvstr_lon0, climvstr_lon_inc, |
158 |
I climvstr_lat0, climvstr_lat_inc, |
159 |
I climvstr_nlon, climvstr_nlat, climvstr_interpMethod, |
160 |
I uvInterp_climstr, |
161 |
#endif |
162 |
I mytime, myiter, mythid ) |
163 |
|
164 |
CALL EXCH_UV_XY_RL( climustr, climvstr, .TRUE., myThid ) |
165 |
#endif /* CLIMSTRESS_RELAXATION */ |
166 |
|
167 |
#ifdef ALLOW_BULK_OFFLINE |
168 |
DO bj=myByLo(myThid),myByHi(myThid) |
169 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
170 |
DO j=1-oLy,sNy+oLy |
171 |
DO i=1-oLx,sNx+oLx |
172 |
# ifdef ALLOW_CLIMSST_RELAXATION |
173 |
if ( climsstfile .NE. ' ' .AND. |
174 |
& climsstperiod .NE. 0. ) |
175 |
& theta(i,j,1,bi,bj) = climsst(i,j,bi,bj) |
176 |
# endif |
177 |
# ifdef ALLOW_CLIMSSS_RELAXATION |
178 |
if ( climsssfile .NE. ' ' .AND. |
179 |
& climsssperiod .NE. 0. ) |
180 |
& salt(i,j,1,bi,bj) = climsss(i,j,bi,bj) |
181 |
# endif |
182 |
# ifdef ALLOW_CLIMSTRESS_RELAXATION |
183 |
if ( climustrfile .NE. ' ' .AND. |
184 |
& climustrperiod .NE. 0. ) |
185 |
& uvel(i,j,1,bi,bj) = climustr(i,j,bi,bj) |
186 |
if ( climvstrfile .NE. ' ' .AND. |
187 |
& climvstrperiod .NE. 0. ) |
188 |
& vvel(i,j,1,bi,bj) = climvstr(i,j,bi,bj) |
189 |
# endif |
190 |
if ( myiter .EQ. niter0 ) then |
191 |
if ( maskC(i,j,1,bi,bj) .NE. 0. .AND. |
192 |
& theta(i,j,1,bi,bj) .EQ. 0. ) then |
193 |
print *, 'ph-warn-exf-clim ', i, j, theta(i,j,1,bi,bj) |
194 |
cph STOP 'in exf_getclim' |
195 |
endif |
196 |
endif |
197 |
ENDDO |
198 |
ENDDO |
199 |
ENDDO |
200 |
ENDDO |
201 |
#endif /* ALLOW_BULK_OFFLINE */ |
202 |
|
203 |
RETURN |
204 |
END |