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