1 |
c $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
|
|
4 |
#include "EXF_OPTIONS.h" |
#include "EXF_OPTIONS.h" |
5 |
|
|
6 |
subroutine exf_mapfields( mythid ) |
subroutine exf_mapfields( mytime, myiter, 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 "GRID.h" |
#include "GRID.h" |
54 |
|
|
55 |
#include "exf_param.h" |
#include "EXF_PARAM.h" |
56 |
#include "exf_constants.h" |
#include "EXF_CONSTANTS.h" |
57 |
#include "exf_fields.h" |
#include "EXF_FIELDS.h" |
|
#include "exf_clim_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 |
|
|
138 |
endif |
endif |
139 |
enddo |
enddo |
140 |
enddo |
enddo |
141 |
do j = jmin,jmax |
IF ( stressIsOnCgrid ) THEN |
142 |
|
do j = jmin,jmax |
143 |
do i = imin+1,imax |
do i = imin+1,imax |
|
#if (defined (ALLOW_BULKFORMULAE) || defined (USE_EXF_INTERPOLATION)) |
|
|
c Shift wind stresses calculated at C-points to W/S points |
|
|
fu(i,j,bi,bj) = exf_outscal_ustress* |
|
|
& (ustress(i,j,bi,bj)+ustress(i-1,j,bi,bj))/2.* |
|
|
& maskW(i,j,1,bi,bj) |
|
|
#else |
|
144 |
fu(i,j,bi,bj) = exf_outscal_ustress*ustress(i,j,bi,bj) |
fu(i,j,bi,bj) = exf_outscal_ustress*ustress(i,j,bi,bj) |
|
#endif |
|
145 |
enddo |
enddo |
146 |
enddo |
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 |
155 |
|
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 |
176 |
endif |
endif |
177 |
enddo |
enddo |
178 |
enddo |
enddo |
179 |
do j = jmin+1,jmax |
IF ( stressIsOnCgrid ) THEN |
180 |
|
do j = jmin+1,jmax |
181 |
|
do i = imin,imax |
182 |
|
fv(i,j,bi,bj) = exf_outscal_vstress*vstress(i,j,bi,bj) |
183 |
|
enddo |
184 |
|
enddo |
185 |
|
ELSE |
186 |
|
do j = jmin+1,jmax |
187 |
do i = imin,imax |
do i = imin,imax |
|
#if (defined (ALLOW_BULKFORMULAE) || defined (USE_EXF_INTERPOLATION)) |
|
188 |
c Shift wind stresses calculated at C-points to W/S points |
c Shift wind stresses calculated at C-points to W/S points |
189 |
fv(i,j,bi,bj) = exf_outscal_vstress* |
fv(i,j,bi,bj) = exf_outscal_vstress* |
190 |
& (vstress(i,j,bi,bj)+vstress(i,j-1,bi,bj))/2.* |
& (vstress(i,j,bi,bj)+vstress(i,j-1,bi,bj)) |
191 |
& maskS(i,j,1,bi,bj) |
& *exf_half*maskS(i,j,1,bi,bj) |
|
#else |
|
|
fv(i,j,bi,bj) = exf_outscal_vstress*vstress(i,j,bi,bj) |
|
|
#endif |
|
192 |
enddo |
enddo |
193 |
enddo |
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 |