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 |
|
#include "EXF_CLIM_PARAM.h" |
59 |
|
#include "EXF_CLIM_FIELDS.h" |
60 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
61 |
# include "tamc.h" |
# include "tamc.h" |
62 |
# include "tamc_keys.h" |
# include "tamc_keys.h" |
66 |
c mythid - thread number for this instance of the routine. |
c mythid - thread number for this instance of the routine. |
67 |
|
|
68 |
integer mythid |
integer mythid |
69 |
|
integer myiter |
70 |
|
_RL mytime |
71 |
|
|
72 |
c == local variables == |
c == local variables == |
73 |
|
|
74 |
integer bi,bj |
integer bi,bj |
75 |
integer i,j |
integer i,j,k |
76 |
integer jtlo |
integer jtlo |
77 |
integer jthi |
integer jthi |
78 |
integer itlo |
integer itlo |
113 |
do i = imin,imax |
do i = imin,imax |
114 |
c Heat flux. |
c Heat flux. |
115 |
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) |
116 |
|
if ( hfluxfile .EQ. ' ' ) |
117 |
|
& qnet(i,j,bi,bj) = qnet(i,j,bi,bj) - |
118 |
|
& exf_outscal_hflux * ( hflux_exfremo_intercept + |
119 |
|
& hflux_exfremo_slope*(mytime-starttime) ) |
120 |
enddo |
enddo |
121 |
enddo |
enddo |
122 |
|
|
125 |
do i = imin,imax |
do i = imin,imax |
126 |
c Salt flux. |
c Salt flux. |
127 |
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) |
128 |
|
if ( sfluxfile .EQ. ' ' ) |
129 |
|
& empmr(i,j,bi,bj) = empmr(i,j,bi,bj) - |
130 |
|
& exf_outscal_sflux * ( sflux_exfremo_intercept + |
131 |
|
& sflux_exfremo_slope*(mytime-starttime) ) |
132 |
enddo |
enddo |
133 |
enddo |
enddo |
134 |
|
|
138 |
do j = jmin,jmax |
do j = jmin,jmax |
139 |
do i = imin,imax |
do i = imin,imax |
140 |
c Zonal wind stress. |
c Zonal wind stress. |
141 |
if (ustress(i,j,bi,bj).gt.2.0D0) then |
if (ustress(i,j,bi,bj).gt.windstressmax) then |
142 |
ustress(i,j,bi,bj)=2.0D0 |
ustress(i,j,bi,bj)=windstressmax |
143 |
endif |
endif |
144 |
enddo |
enddo |
145 |
enddo |
enddo |
148 |
#endif |
#endif |
149 |
do j = jmin,jmax |
do j = jmin,jmax |
150 |
do i = imin,imax |
do i = imin,imax |
151 |
if (ustress(i,j,bi,bj).lt.-2.0D0) then |
if (ustress(i,j,bi,bj).lt.-windstressmax) then |
152 |
ustress(i,j,bi,bj)=-2.0D0 |
ustress(i,j,bi,bj)=-windstressmax |
153 |
endif |
endif |
154 |
enddo |
enddo |
155 |
enddo |
enddo |
156 |
do j = jmin,jmax |
do j = jmin,jmax |
157 |
do i = imin,imax |
do i = imin+1,imax |
158 |
fu(i,j,bi,bj) = exf_outscal_ustress*ustress(i,j,bi,bj) |
#if (defined (ALLOW_BULKFORMULAE) || defined (USE_EXF_INTERPOLATION)) |
159 |
|
c Shift wind stresses calculated at C-points to W/S points |
160 |
|
fu(i,j,bi,bj) = exf_outscal_ustress* |
161 |
|
& (ustress(i,j,bi,bj)+ustress(i-1,j,bi,bj))/2.* |
162 |
|
& maskW(i,j,1,bi,bj) |
163 |
|
#else |
164 |
|
fu(i,j,bi,bj) = exf_outscal_ustress*ustress(i,j,bi,bj) |
165 |
|
#endif |
166 |
enddo |
enddo |
167 |
enddo |
enddo |
168 |
|
|
172 |
do j = jmin,jmax |
do j = jmin,jmax |
173 |
do i = imin,imax |
do i = imin,imax |
174 |
c Meridional wind stress. |
c Meridional wind stress. |
175 |
if (vstress(i,j,bi,bj).gt.2.0D0) then |
if (vstress(i,j,bi,bj).gt.windstressmax) then |
176 |
vstress(i,j,bi,bj)=2.0D0 |
vstress(i,j,bi,bj)=windstressmax |
177 |
endif |
endif |
178 |
enddo |
enddo |
179 |
enddo |
enddo |
182 |
#endif |
#endif |
183 |
do j = jmin,jmax |
do j = jmin,jmax |
184 |
do i = imin,imax |
do i = imin,imax |
185 |
if (vstress(i,j,bi,bj).lt.-2.0D0) then |
if (vstress(i,j,bi,bj).lt.-windstressmax) then |
186 |
vstress(i,j,bi,bj)=-2.0D0 |
vstress(i,j,bi,bj)=-windstressmax |
187 |
endif |
endif |
188 |
enddo |
enddo |
189 |
enddo |
enddo |
190 |
do j = jmin,jmax |
do j = jmin+1,jmax |
191 |
do i = imin,imax |
do i = imin,imax |
192 |
fv(i,j,bi,bj) = exf_outscal_vstress*vstress(i,j,bi,bj) |
#if (defined (ALLOW_BULKFORMULAE) || defined (USE_EXF_INTERPOLATION)) |
193 |
|
c Shift wind stresses calculated at C-points to W/S points |
194 |
|
fv(i,j,bi,bj) = exf_outscal_vstress* |
195 |
|
& (vstress(i,j,bi,bj)+vstress(i,j-1,bi,bj))/2.* |
196 |
|
& maskS(i,j,1,bi,bj) |
197 |
|
#else |
198 |
|
fv(i,j,bi,bj) = exf_outscal_vstress*vstress(i,j,bi,bj) |
199 |
|
#endif |
200 |
enddo |
enddo |
201 |
enddo |
enddo |
202 |
|
|