/[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.7 by edhill, Thu Oct 9 04:19:19 2003 UTC revision 1.17 by jmc, Mon Apr 16 23:27:21 2007 UTC
# Line 1  Line 1 
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
# Line 16  c       This routine is included to sepa Line 16  c       This routine is included to sepa
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
# Line 48  c     == global variables == Line 48  c     == global variables ==
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"
# Line 62  c     == routine arguments == Line 66  c     == routine arguments ==
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
# Line 107  c     == end of interface == Line 113  c     == end of interface ==
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    
# Line 115  c            Heat flux. Line 125  c            Heat flux.
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    
# Line 124  CADJ STORE ustress(:,:,bi,bj) = comlev1_ Line 138  CADJ STORE ustress(:,:,bi,bj) = comlev1_
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
# Line 134  CADJ STORE ustress(:,:,bi,bj) = comlev1_ Line 148  CADJ STORE ustress(:,:,bi,bj) = comlev1_
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    
# Line 151  CADJ STORE vstress(:,:,bi,bj) = comlev1_ Line 172  CADJ STORE vstress(:,:,bi,bj) = comlev1_
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
# Line 161  CADJ STORE vstress(:,:,bi,bj) = comlev1_ Line 182  CADJ STORE vstress(:,:,bi,bj) = comlev1_
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    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.22