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