1 |
jmc |
1.28 |
C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_getclim.F,v 1.27 2017/02/21 01:04:26 jmc Exp $ |
2 |
jmc |
1.6 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
edhill |
1.3 |
#include "EXF_OPTIONS.h" |
5 |
gforget |
1.24 |
#ifdef ALLOW_CTRL |
6 |
|
|
# include "CTRL_OPTIONS.h" |
7 |
|
|
#endif |
8 |
|
|
#ifdef ALLOW_ECCO |
9 |
|
|
# include "ECCO_OPTIONS.h" |
10 |
|
|
#endif |
11 |
heimbach |
1.1 |
|
12 |
jmc |
1.26 |
SUBROUTINE EXF_GETCLIM( |
13 |
|
|
I myTime, myIter, myThid ) |
14 |
heimbach |
1.1 |
|
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 |
edhill |
1.3 |
c be set in EXF_OPTIONS.h . |
22 |
heimbach |
1.1 |
c |
23 |
|
|
c A note on surface fluxes: |
24 |
|
|
c |
25 |
jmc |
1.14 |
c The MITgcm-UV vertical coordinate z is positive upward. |
26 |
heimbach |
1.1 |
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 |
jmc |
1.26 |
IMPLICIT NONE |
38 |
heimbach |
1.1 |
|
39 |
|
|
c == global variables == |
40 |
|
|
#include "EEPARAMS.h" |
41 |
|
|
#include "SIZE.h" |
42 |
heimbach |
1.8 |
#include "GRID.h" |
43 |
heimbach |
1.11 |
#ifdef ALLOW_BULK_OFFLINE |
44 |
|
|
# include "PARAMS.h" |
45 |
|
|
# include "DYNVARS.h" |
46 |
|
|
#endif |
47 |
heimbach |
1.7 |
#include "EXF_PARAM.h" |
48 |
|
|
#include "EXF_CONSTANTS.h" |
49 |
jmc |
1.6 |
#include "EXF_FIELDS.h" |
50 |
gforget |
1.25 |
#if (defined (ALLOW_CTRL) && defined (ECCO_CTRL_DEPRECATED)) |
51 |
|
|
# include "CTRL_SIZE.h" |
52 |
|
|
# include "ctrl.h" |
53 |
|
|
# include "ctrl_dummy.h" |
54 |
gforget |
1.23 |
# ifdef ALLOW_ECCO |
55 |
|
|
# include "ecco_cost.h" |
56 |
|
|
# endif |
57 |
heimbach |
1.11 |
#endif |
58 |
heimbach |
1.1 |
|
59 |
|
|
c == routine arguments == |
60 |
|
|
|
61 |
jmc |
1.26 |
c myThid - thread number for this instance of the routine. |
62 |
heimbach |
1.1 |
|
63 |
jmc |
1.26 |
_RL myTime |
64 |
|
|
INTEGER myIter |
65 |
|
|
INTEGER myThid |
66 |
heimbach |
1.1 |
|
67 |
|
|
c == local variables == |
68 |
|
|
|
69 |
jmc |
1.26 |
INTEGER bi, bj, i, j |
70 |
heimbach |
1.8 |
|
71 |
heimbach |
1.1 |
c == end of interface == |
72 |
|
|
|
73 |
|
|
#ifdef ALLOW_CLIMSST_RELAXATION |
74 |
|
|
c Get values of climatological sst fields. |
75 |
jmc |
1.27 |
CALL EXF_SET_FLD( |
76 |
|
|
I 'climsst', climsstfile, climsstmask, |
77 |
jmc |
1.28 |
I climsstStartTime, climsstperiod, climsstRepCycle, |
78 |
jmc |
1.27 |
I exf_inscal_climsst, |
79 |
|
|
I climsst_exfremo_intercept, climsst_exfremo_slope, |
80 |
|
|
U climsst, climsst0, climsst1, |
81 |
heimbach |
1.7 |
#ifdef USE_EXF_INTERPOLATION |
82 |
jmc |
1.27 |
I climsst_lon0, climsst_lon_inc, climsst_lat0, climsst_lat_inc, |
83 |
|
|
I climsst_nlon, climsst_nlat, xC, yC, climsst_interpMethod, |
84 |
heimbach |
1.7 |
#endif |
85 |
jmc |
1.27 |
I myTime, myIter, myThid ) |
86 |
jmc |
1.19 |
|
87 |
jmc |
1.26 |
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 |
heimbach |
1.9 |
climsst(i,j,bi,bj) = climtempfreeze |
93 |
jmc |
1.26 |
ENDIF |
94 |
|
|
ENDDO |
95 |
|
|
ENDDO |
96 |
|
|
ENDDO |
97 |
|
|
ENDDO |
98 |
jmc |
1.19 |
|
99 |
heimbach |
1.1 |
c-- Update the tile edges. |
100 |
jmc |
1.26 |
_EXCH_XY_RL(climsst, myThid) |
101 |
heimbach |
1.1 |
#endif |
102 |
|
|
|
103 |
gforget |
1.25 |
#if (defined (ALLOW_CTRL) && defined (ECCO_CTRL_DEPRECATED)) |
104 |
|
|
# ifdef ALLOW_SST_CONTROL |
105 |
jmc |
1.26 |
CALL CTRL_GET_GEN ( |
106 |
heimbach |
1.21 |
& 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 |
jmc |
1.26 |
& wsst, myTime, myIter, myThid ) |
110 |
gforget |
1.25 |
# endif |
111 |
heimbach |
1.21 |
#endif |
112 |
|
|
|
113 |
heimbach |
1.1 |
#ifdef ALLOW_CLIMSSS_RELAXATION |
114 |
heimbach |
1.7 |
c Get values of climatological sss fields. |
115 |
jmc |
1.27 |
CALL EXF_SET_FLD( |
116 |
|
|
I 'climsss', climsssfile, climsssmask, |
117 |
jmc |
1.28 |
I climsssStartTime, climsssperiod, climsssRepCycle, |
118 |
jmc |
1.27 |
I exf_inscal_climsss, |
119 |
|
|
I climsss_exfremo_intercept, climsss_exfremo_slope, |
120 |
|
|
U climsss, climsss0, climsss1, |
121 |
heimbach |
1.7 |
#ifdef USE_EXF_INTERPOLATION |
122 |
jmc |
1.27 |
I climsss_lon0, climsss_lon_inc, climsss_lat0, climsss_lat_inc, |
123 |
|
|
I climsss_nlon, climsss_nlat, xC, yC, climsss_interpMethod, |
124 |
heimbach |
1.7 |
#endif |
125 |
jmc |
1.27 |
I myTime, myIter, myThid ) |
126 |
jmc |
1.19 |
|
127 |
heimbach |
1.1 |
c-- Update the tile edges. |
128 |
jmc |
1.26 |
_EXCH_XY_RL(climsss, myThid) |
129 |
heimbach |
1.1 |
#endif |
130 |
heimbach |
1.15 |
|
131 |
gforget |
1.25 |
#if (defined (ALLOW_CTRL) && defined (ECCO_CTRL_DEPRECATED)) |
132 |
|
|
# ifdef ALLOW_SSS_CONTROL |
133 |
jmc |
1.26 |
CALL CTRL_GET_GEN ( |
134 |
heimbach |
1.21 |
& 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 |
jmc |
1.26 |
& wsss, myTime, myIter, myThid ) |
138 |
gforget |
1.25 |
# endif |
139 |
heimbach |
1.11 |
#endif |
140 |
|
|
|
141 |
heimbach |
1.16 |
#ifdef ALLOW_CLIMSTRESS_RELAXATION |
142 |
|
|
c Get values of climatological ustr fields. |
143 |
jmc |
1.26 |
CALL EXF_SET_UV ( |
144 |
jmc |
1.27 |
I 'climustr', climustrfile, climustrmask, |
145 |
jmc |
1.28 |
I climustrStartTime, climustrperiod, climustrRepCycle, |
146 |
jmc |
1.19 |
I exf_inscal_climustr, |
147 |
|
|
I climustr_exfremo_intercept, climustr_exfremo_slope, |
148 |
jmc |
1.27 |
U climustr, climustr0, climustr1, |
149 |
|
|
I 'climvstr', climvstrfile, climvstrmask, |
150 |
jmc |
1.28 |
I climvstrStartTime, climvstrperiod, climvstrRepCycle, |
151 |
jmc |
1.19 |
I exf_inscal_climvstr, |
152 |
|
|
I climvstr_exfremo_intercept, climvstr_exfremo_slope, |
153 |
jmc |
1.27 |
U climvstr, climvstr0, climvstr1, |
154 |
jmc |
1.19 |
#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 |
jmc |
1.20 |
I uvInterp_climstr, |
162 |
jmc |
1.19 |
#endif |
163 |
jmc |
1.26 |
I myTime, myIter, myThid ) |
164 |
jmc |
1.19 |
|
165 |
heimbach |
1.16 |
CALL EXCH_UV_XY_RL( climustr, climvstr, .TRUE., myThid ) |
166 |
|
|
#endif /* CLIMSTRESS_RELAXATION */ |
167 |
|
|
|
168 |
heimbach |
1.11 |
#ifdef ALLOW_BULK_OFFLINE |
169 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
170 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
171 |
jmc |
1.26 |
DO j=1-OLy,sNy+OLy |
172 |
|
|
DO i=1-OLx,sNx+OLx |
173 |
heimbach |
1.18 |
# ifdef ALLOW_CLIMSST_RELAXATION |
174 |
jmc |
1.26 |
IF ( climsstfile .NE. ' ' .AND. |
175 |
heimbach |
1.17 |
& climsstperiod .NE. 0. ) |
176 |
|
|
& theta(i,j,1,bi,bj) = climsst(i,j,bi,bj) |
177 |
heimbach |
1.18 |
# endif |
178 |
|
|
# ifdef ALLOW_CLIMSSS_RELAXATION |
179 |
jmc |
1.26 |
IF ( climsssfile .NE. ' ' .AND. |
180 |
heimbach |
1.17 |
& climsssperiod .NE. 0. ) |
181 |
|
|
& salt(i,j,1,bi,bj) = climsss(i,j,bi,bj) |
182 |
heimbach |
1.18 |
# endif |
183 |
heimbach |
1.16 |
# ifdef ALLOW_CLIMSTRESS_RELAXATION |
184 |
jmc |
1.26 |
IF ( climustrfile .NE. ' ' .AND. |
185 |
heimbach |
1.17 |
& climustrperiod .NE. 0. ) |
186 |
|
|
& uvel(i,j,1,bi,bj) = climustr(i,j,bi,bj) |
187 |
jmc |
1.26 |
IF ( climvstrfile .NE. ' ' .AND. |
188 |
heimbach |
1.17 |
& climvstrperiod .NE. 0. ) |
189 |
|
|
& vvel(i,j,1,bi,bj) = climvstr(i,j,bi,bj) |
190 |
heimbach |
1.16 |
# endif |
191 |
jmc |
1.26 |
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 |
heimbach |
1.11 |
print *, 'ph-warn-exf-clim ', i, j, theta(i,j,1,bi,bj) |
195 |
|
|
cph STOP 'in exf_getclim' |
196 |
jmc |
1.26 |
ENDIF |
197 |
|
|
ENDIF |
198 |
heimbach |
1.11 |
ENDDO |
199 |
|
|
ENDDO |
200 |
|
|
ENDDO |
201 |
|
|
ENDDO |
202 |
|
|
#endif /* ALLOW_BULK_OFFLINE */ |
203 |
heimbach |
1.1 |
|
204 |
jmc |
1.19 |
RETURN |
205 |
|
|
END |