/[MITgcm]/MITgcm/pkg/ctrl/ctrl_map_ini.F
ViewVC logotype

Diff of /MITgcm/pkg/ctrl/ctrl_map_ini.F

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

revision 1.4 by heimbach, Mon Aug 13 23:28:41 2001 UTC revision 1.6 by heimbach, Sat Jul 13 02:47:32 2002 UTC
# Line 2  C $Header$ Line 2  C $Header$
2    
3  #include "CTRL_CPPOPTIONS.h"  #include "CTRL_CPPOPTIONS.h"
4    
5    CBOP
6    C     !ROUTINE: ctrl_map_ini
7    C     !INTERFACE:
8          subroutine ctrl_map_ini( mythid )
9    
10    C     !DESCRIPTION: \bv
11    c     *=================================================================
12    c     | SUBROUTINE ctrl_map_ini
13    c     | Add the temperature, salinity, and diffusivity parts of the
14    c     | control vector to the model state and update the tile halos.
15    c     | The control vector is defined in the header file "ctrl.h".
16    c     *=================================================================
17    C     \ev
18    
19        subroutine ctrl_map_ini(  C     !USES:
      I                     mythid  
      &                   )  
   
 c     ==================================================================  
 c     SUBROUTINE ctrl_map_ini  
 c     ==================================================================  
 c  
 c     o Add the temperature and salinity parts of the control vector to  
 c       the model state and update the tile edges. The control vector is  
 c       defined in the header file "ctrl.h".  
 c  
 c     started: Christian Eckert eckert@mit.edu 30-Jun-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 23-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.  
 c  
 c     ==================================================================  
 c     SUBROUTINE ctrl_map_ini  
 c     ==================================================================  
   
20        implicit none        implicit none
21    
22  c     == global variables ==  c     == global variables ==
   
 #include "EEPARAMS.h"  
23  #include "SIZE.h"  #include "SIZE.h"
24    #include "EEPARAMS.h"
25    #include "PARAMS.h"
26  #include "DYNVARS.h"  #include "DYNVARS.h"
27    #include "GRID.h"
28  #include "TR1.h"  #include "TR1.h"
   
29  #include "ctrl.h"  #include "ctrl.h"
30  #include "ctrl_dummy.h"  #include "ctrl_dummy.h"
31  #include "optim.h"  #include "optim.h"
32    
33    C     !INPUT/OUTPUT PARAMETERS:
34  c     == routine arguments ==  c     == routine arguments ==
   
35        integer mythid        integer mythid
36    
37    C     !LOCAL VARIABLES:
38  c     == local variables ==  c     == local variables ==
39    
       _RL     fac  
40        integer bi,bj        integer bi,bj
41        integer i,j,k        integer i,j,k
42        integer itlo,ithi        integer itlo,ithi
# Line 63  c     == local variables == Line 54  c     == local variables ==
54        character*( 80)   fnametr1        character*( 80)   fnametr1
55        character*( 80)   fnamediffkr        character*( 80)   fnamediffkr
56        character*( 80)   fnamekapgm        character*( 80)   fnamekapgm
57          character*( 80)   fnameefluxy
58          character*( 80)   fnameefluxp
59    
60  c     == external ==        _RL     fac
61    
62    c     == external ==
63        integer  ilnblnk        integer  ilnblnk
64        external ilnblnk        external ilnblnk
65    
66  c     == end of interface ==  c     == end of interface ==
67    CEOP
68    
69        jtlo = mybylo(mythid)        jtlo = mybylo(mythid)
70        jthi = mybyhi(mythid)        jthi = mybyhi(mythid)
# Line 210  c--   kapgm. Line 205  c--   kapgm.
205        enddo        enddo
206  #endif  #endif
207    
208    #ifdef ALLOW_EFLUXY0_CONTROL
209    c--   y-component EP-flux field.
210          il=ilnblnk( xx_efluxy_file )
211          write(fnameefluxy(1:80),'(2a,i10.10)')
212         &     xx_efluxy_file(1:il),'.',optimcycle
213          call active_read_xyz( fnameefluxy, tmpfld3d, 1,
214         &                      doglobalread, ladinit, optimcycle,
215         &                      mythid, xx_efluxy_dummy )
216    
217          do bj = jtlo,jthi
218            do bi = itlo,ithi
219              do k = 1,nr
220                do j = jmin,jmax
221                  do i = imin,imax
222                    EfluxY(i,j,k,bi,bj) = EfluxY(i,j,k,bi,bj)
223         &                                - fac*tmpfld3d(i,j,k,bi,bj)
224         &                                  *maskS(i,j,k,bi,bj)
225    cph                EfluxY(i,j,k,bi,bj) = EfluxY(i,j,k,bi,bj)
226    cph     &                                - rSphere*cosFacU(J,bi,bj)
227    cph     &                                  *fac*tmpfld3d(i,j,k,bi,bj)
228                  enddo
229                enddo
230              enddo
231           enddo
232          enddo
233    #endif
234    
235    #ifdef ALLOW_EFLUXP0_CONTROL
236    c--   p-component EP-flux field.
237          il=ilnblnk( xx_efluxp_file )
238          write(fnameefluxp(1:80),'(2a,i10.10)')
239         &     xx_efluxp_file(1:il),'.',optimcycle
240          call active_read_xyz( fnameefluxp, tmpfld3d, 1,
241         &                      doglobalread, ladinit, optimcycle,
242         &                      mythid, xx_efluxp_dummy )
243    
244          do bj = jtlo,jthi
245            do bi = itlo,ithi
246              do k = 1,nr
247                do j = jmin,jmax
248                  do i = imin,imax
249                    EfluxP(i,j,k,bi,bj) = EfluxP(i,j,k,bi,bj)
250         &                                + fCori(i,j,bi,bj)
251         &                                  *fac*tmpfld3d(i,j,k,bi,bj)
252         &                                  *hFacV(i,j,k,bi,bj)
253    cph                EfluxP(i,j,k,bi,bj) = EfluxP(i,j,k,bi,bj)
254    cph     &                                + fCori(i,j,bi,bj)
255    cph     &                                  *rSphere*cosFacU(J,bi,bj)
256    cph     &                                  *fac*tmpfld3d(i,j,k,bi,bj)
257                  enddo
258                enddo
259              enddo
260           enddo
261          enddo
262    #endif
263    
264    
265  c--   Update the tile edges.  c--   Update the tile edges.
266    
267  #ifdef ALLOW_THETA0_CONTROL  #ifdef ALLOW_THETA0_CONTROL
268        _EXCH_XYZ_R8( theta, mythid )        _EXCH_XYZ_R8( theta, mythid )
269        _EXCH_XYZ_R8( gtNm1, mythid )  cph      _EXCH_XYZ_R8( gtNm1, mythid )
270  #endif  #endif
271  #ifdef ALLOW_SALT0_CONTROL  #ifdef ALLOW_SALT0_CONTROL
272        _EXCH_XYZ_R8(  salt, mythid )        _EXCH_XYZ_R8(  salt, mythid )
273        _EXCH_XYZ_R8( gsNm1, mythid )  cph      _EXCH_XYZ_R8( gsNm1, mythid )
274  #endif  #endif
275  #ifdef ALLOW_TR10_CONTROL  #ifdef ALLOW_TR10_CONTROL
276        _EXCH_XYZ_R8(     tr1, mythid )        _EXCH_XYZ_R8(     tr1, mythid )
277        _EXCH_XYZ_R8( gTr1Nm1, mythid )  cph      _EXCH_XYZ_R8( gTr1Nm1, mythid )
278  #endif  #endif
279  #ifdef ALLOW_DIFFKR_CONTROL  #ifdef ALLOW_DIFFKR_CONTROL
280        _EXCH_XYZ_R8( diffkr, mythid)        _EXCH_XYZ_R8( diffkr, mythid)
# Line 231  c--   Update the tile edges. Line 282  c--   Update the tile edges.
282  #ifdef ALLOW_KAPGM_CONTROL  #ifdef ALLOW_KAPGM_CONTROL
283        _EXCH_XYZ_R8( kapgm, mythid)        _EXCH_XYZ_R8( kapgm, mythid)
284  #endif  #endif
285    #ifdef ALLOW_EFLUXY0_CONTROL
286          _EXCH_XYZ_R8( EfluxY, mythid )
287    #endif
288    #ifdef ALLOW_EFLUXP0_CONTROL
289          _EXCH_XYZ_R8( EfluxP, mythid )
290    #endif
291    
292    
293        return        return

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22