/[MITgcm]/MITgcm/pkg/exf/exf_mapfields.F
ViewVC logotype

Diff of /MITgcm/pkg/exf/exf_mapfields.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.19 by heimbach, Wed Apr 18 19:55:34 2007 UTC revision 1.20 by jmc, Mon May 14 19:34:57 2007 UTC
# Line 63  c     == routine arguments == Line 63  c     == routine arguments ==
63    
64  c     mythid - thread number for this instance of the routine.  c     mythid - thread number for this instance of the routine.
65    
       integer mythid  
       integer myiter  
66        _RL     mytime        _RL     mytime
67          integer myiter
68          integer mythid
69    
70  c     == local variables ==  c     == local variables ==
71    
72        integer bi,bj        integer bi,bj
73        integer i,j,k        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)
# Line 111  c     == end of interface == Line 98  c     == end of interface ==
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. ' ' )               if ( hfluxfile .EQ. ' ' )
102       &            qnet(i,j,bi,bj) = qnet(i,j,bi,bj) -       &            qnet(i,j,bi,bj) = qnet(i,j,bi,bj) -
103       &            exf_outscal_hflux * ( hflux_exfremo_intercept +       &            exf_outscal_hflux * ( hflux_exfremo_intercept +
104       &            hflux_exfremo_slope*(mytime-starttime) )       &            hflux_exfremo_slope*(mytime-starttime) )
# Line 124  c            Heat flux. Line 111  c            Heat flux.
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. ' ' )               if ( sfluxfile .EQ. ' ' )
114       &            empmr(i,j,bi,bj) = empmr(i,j,bi,bj) -       &            empmr(i,j,bi,bj) = empmr(i,j,bi,bj) -
115       &            exf_outscal_sflux * ( sflux_exfremo_intercept +       &            exf_outscal_sflux * ( sflux_exfremo_intercept +
116       &            sflux_exfremo_slope*(mytime-starttime) )       &            sflux_exfremo_slope*(mytime-starttime) )
117              enddo              enddo
# Line 151  CADJ STORE ustress(:,:,bi,bj) = comlev1_ Line 138  CADJ STORE ustress(:,:,bi,bj) = comlev1_
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 (ALLOW_ATM_WIND) ) \  
      || 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
# Line 186  CADJ STORE vstress(:,:,bi,bj) = comlev1_ Line 176  CADJ STORE vstress(:,:,bi,bj) = comlev1_
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 (ALLOW_ATM_WIND) ) \  
      || 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.
# Line 233  c             Short wave radiative flux. Line 226  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 )
# Line 256  c      _EXCH_XY_R4(    fv, mythid ) Line 247  c      _EXCH_XY_R4(    fv, mythid )
247        _EXCH_XY_R4( pload, mythid )        _EXCH_XY_R4( pload, mythid )
248  #endif  #endif
249    
250        end        RETURN
251          END

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.22