1 |
c $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
|
|
4 |
#include "EXF_OPTIONS.h" |
#include "EXF_OPTIONS.h" |
5 |
|
|
6 |
|
subroutine exf_mapfields( mytime, myiter, mythid ) |
|
subroutine exf_mapfields( mythid ) |
|
7 |
|
|
8 |
c ================================================================== |
c ================================================================== |
9 |
c SUBROUTINE exf_mapfields |
c SUBROUTINE exf_mapfields |
16 |
c tool as much as possible from the ocean model. Unit and sign |
c tool as much as possible from the ocean model. Unit and sign |
17 |
c conventions can be customized using variables exf_outscal_*, |
c conventions can be customized using variables exf_outscal_*, |
18 |
c which are set in exf_readparms.F. See the header files |
c which are set in exf_readparms.F. See the header files |
19 |
c exf_fields.h and FFIELDS.h for definitions of the various input |
c EXF_FIELDS.h and FFIELDS.h for definitions of the various input |
20 |
c and output fields and for default unit and sign convetions. |
c and output fields and for default unit and sign convetions. |
21 |
c |
c |
22 |
c started: Christian Eckert eckert@mit.edu 09-Aug-1999 |
c started: Christian Eckert eckert@mit.edu 09-Aug-1999 |
48 |
|
|
49 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
50 |
#include "SIZE.h" |
#include "SIZE.h" |
51 |
|
#include "PARAMS.h" |
52 |
#include "FFIELDS.h" |
#include "FFIELDS.h" |
53 |
#include "exf_param.h" |
#include "GRID.h" |
54 |
#include "exf_constants.h" |
|
55 |
#include "exf_fields.h" |
#include "EXF_PARAM.h" |
56 |
#include "exf_clim_fields.h" |
#include "EXF_CONSTANTS.h" |
57 |
|
#include "EXF_FIELDS.h" |
58 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
59 |
# include "tamc.h" |
# include "tamc.h" |
60 |
# include "tamc_keys.h" |
# include "tamc_keys.h" |
63 |
|
|
64 |
c mythid - thread number for this instance of the routine. |
c mythid - thread number for this instance of the routine. |
65 |
|
|
66 |
|
_RL mytime |
67 |
|
integer myiter |
68 |
integer mythid |
integer mythid |
69 |
|
|
70 |
c == local variables == |
c == local variables == |
71 |
|
|
72 |
integer bi,bj |
integer bi,bj |
73 |
integer i,j |
integer i,j,k |
74 |
integer jtlo |
INTEGER imin, imax |
75 |
integer jthi |
INTEGER jmin, jmax |
76 |
integer itlo |
PARAMETER ( imin = 1-OLx , imax = sNx+OLx ) |
77 |
integer ithi |
PARAMETER ( jmin = 1-OLy , jmax = sNy+OLy ) |
|
integer jmin |
|
|
integer jmax |
|
|
integer imin |
|
|
integer imax |
|
78 |
|
|
79 |
c == end of interface == |
c == end of interface == |
80 |
|
|
81 |
jtlo = mybylo(mythid) |
DO bj = myByLo(myThid),myByHi(myThid) |
82 |
jthi = mybyhi(mythid) |
DO bi = myBxLo(myThid),myBxHi(myThid) |
|
itlo = mybxlo(mythid) |
|
|
ithi = mybxhi(mythid) |
|
|
jmin = 1-oly |
|
|
jmax = sny+oly |
|
|
imin = 1-olx |
|
|
imax = snx+olx |
|
|
|
|
|
do bj = jtlo,jthi |
|
|
do bi = itlo,ithi |
|
83 |
|
|
84 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
85 |
act1 = bi - myBxLo(myThid) |
act1 = bi - myBxLo(myThid) |
98 |
do i = imin,imax |
do i = imin,imax |
99 |
c Heat flux. |
c Heat flux. |
100 |
qnet(i,j,bi,bj) = exf_outscal_hflux*hflux(i,j,bi,bj) |
qnet(i,j,bi,bj) = exf_outscal_hflux*hflux(i,j,bi,bj) |
101 |
|
if ( hfluxfile .EQ. ' ' ) |
102 |
|
& qnet(i,j,bi,bj) = qnet(i,j,bi,bj) - |
103 |
|
& exf_outscal_hflux * ( hflux_exfremo_intercept + |
104 |
|
& hflux_exfremo_slope*(mytime-starttime) ) |
105 |
enddo |
enddo |
106 |
enddo |
enddo |
107 |
|
|
110 |
do i = imin,imax |
do i = imin,imax |
111 |
c Salt flux. |
c Salt flux. |
112 |
empmr(i,j,bi,bj)= exf_outscal_sflux*sflux(i,j,bi,bj) |
empmr(i,j,bi,bj)= exf_outscal_sflux*sflux(i,j,bi,bj) |
113 |
|
if ( sfluxfile .EQ. ' ' ) |
114 |
|
& empmr(i,j,bi,bj) = empmr(i,j,bi,bj) - |
115 |
|
& exf_outscal_sflux * ( sflux_exfremo_intercept + |
116 |
|
& sflux_exfremo_slope*(mytime-starttime) ) |
117 |
enddo |
enddo |
118 |
enddo |
enddo |
119 |
|
|
123 |
do j = jmin,jmax |
do j = jmin,jmax |
124 |
do i = imin,imax |
do i = imin,imax |
125 |
c Zonal wind stress. |
c Zonal wind stress. |
126 |
if (ustress(i,j,bi,bj).gt.2.0D0) then |
if (ustress(i,j,bi,bj).gt.windstressmax) then |
127 |
ustress(i,j,bi,bj)=2.0D0 |
ustress(i,j,bi,bj)=windstressmax |
128 |
endif |
endif |
129 |
enddo |
enddo |
130 |
enddo |
enddo |
133 |
#endif |
#endif |
134 |
do j = jmin,jmax |
do j = jmin,jmax |
135 |
do i = imin,imax |
do i = imin,imax |
136 |
if (ustress(i,j,bi,bj).lt.-2.0D0) then |
if (ustress(i,j,bi,bj).lt.-windstressmax) then |
137 |
ustress(i,j,bi,bj)=-2.0D0 |
ustress(i,j,bi,bj)=-windstressmax |
138 |
endif |
endif |
139 |
enddo |
enddo |
140 |
enddo |
enddo |
141 |
do j = jmin,jmax |
IF ( stressIsOnCgrid ) THEN |
142 |
do i = imin,imax |
do j = jmin,jmax |
143 |
fu(i,j,bi,bj) = exf_outscal_ustress*ustress(i,j,bi,bj) |
do i = imin+1,imax |
144 |
|
fu(i,j,bi,bj) = exf_outscal_ustress*ustress(i,j,bi,bj) |
145 |
|
enddo |
146 |
|
enddo |
147 |
|
ELSE |
148 |
|
do j = jmin,jmax |
149 |
|
do i = imin+1,imax |
150 |
|
c Shift wind stresses calculated at Grid-center to W/S points |
151 |
|
fu(i,j,bi,bj) = exf_outscal_ustress* |
152 |
|
& (ustress(i,j,bi,bj)+ustress(i-1,j,bi,bj)) |
153 |
|
& *exf_half*maskW(i,j,1,bi,bj) |
154 |
enddo |
enddo |
155 |
enddo |
enddo |
156 |
|
ENDIF |
157 |
|
|
158 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
159 |
CADJ STORE vstress(:,:,bi,bj) = comlev1_bibj, key=ikey, byte=isbyte |
CADJ STORE vstress(:,:,bi,bj) = comlev1_bibj, key=ikey, byte=isbyte |
161 |
do j = jmin,jmax |
do j = jmin,jmax |
162 |
do i = imin,imax |
do i = imin,imax |
163 |
c Meridional wind stress. |
c Meridional wind stress. |
164 |
if (vstress(i,j,bi,bj).gt.2.0D0) then |
if (vstress(i,j,bi,bj).gt.windstressmax) then |
165 |
vstress(i,j,bi,bj)=2.0D0 |
vstress(i,j,bi,bj)=windstressmax |
166 |
endif |
endif |
167 |
enddo |
enddo |
168 |
enddo |
enddo |
171 |
#endif |
#endif |
172 |
do j = jmin,jmax |
do j = jmin,jmax |
173 |
do i = imin,imax |
do i = imin,imax |
174 |
if (vstress(i,j,bi,bj).lt.-2.0D0) then |
if (vstress(i,j,bi,bj).lt.-windstressmax) then |
175 |
vstress(i,j,bi,bj)=-2.0D0 |
vstress(i,j,bi,bj)=-windstressmax |
176 |
endif |
endif |
177 |
enddo |
enddo |
178 |
enddo |
enddo |
179 |
do j = jmin,jmax |
IF ( stressIsOnCgrid ) THEN |
180 |
|
do j = jmin+1,jmax |
181 |
do i = imin,imax |
do i = imin,imax |
182 |
fv(i,j,bi,bj) = exf_outscal_vstress*vstress(i,j,bi,bj) |
fv(i,j,bi,bj) = exf_outscal_vstress*vstress(i,j,bi,bj) |
183 |
enddo |
enddo |
184 |
enddo |
enddo |
185 |
|
ELSE |
186 |
|
do j = jmin+1,jmax |
187 |
|
do i = imin,imax |
188 |
|
c Shift wind stresses calculated at C-points to W/S points |
189 |
|
fv(i,j,bi,bj) = exf_outscal_vstress* |
190 |
|
& (vstress(i,j,bi,bj)+vstress(i,j-1,bi,bj)) |
191 |
|
& *exf_half*maskS(i,j,1,bi,bj) |
192 |
|
enddo |
193 |
|
enddo |
194 |
|
ENDIF |
195 |
|
|
196 |
#ifdef SHORTWAVE_HEATING |
#ifdef SHORTWAVE_HEATING |
197 |
c Short wave radiative flux. |
c Short wave radiative flux. |
226 |
enddo |
enddo |
227 |
#endif |
#endif |
228 |
|
|
229 |
enddo |
ENDDO |
230 |
enddo |
ENDDO |
231 |
|
|
232 |
c Update the tile edges. |
c Update the tile edges. |
233 |
|
|
234 |
_EXCH_XY_R4( qnet, mythid ) |
_EXCH_XY_R4( qnet, mythid ) |
235 |
_EXCH_XY_R4( empmr, mythid ) |
_EXCH_XY_R4( empmr, mythid ) |
|
c _EXCH_XY_R4( fu, mythid ) |
|
|
c _EXCH_XY_R4( fv, mythid ) |
|
236 |
CALL EXCH_UV_XY_RS(fu, fv, .TRUE., myThid) |
CALL EXCH_UV_XY_RS(fu, fv, .TRUE., myThid) |
237 |
#ifdef SHORTWAVE_HEATING |
#ifdef SHORTWAVE_HEATING |
238 |
_EXCH_XY_R4( qsw, mythid ) |
_EXCH_XY_R4( qsw, mythid ) |
247 |
_EXCH_XY_R4( pload, mythid ) |
_EXCH_XY_R4( pload, mythid ) |
248 |
#endif |
#endif |
249 |
|
|
250 |
end |
RETURN |
251 |
|
END |