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

Annotation of /MITgcm/pkg/ctrl/ctrl_hfacc_ini.F

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


Revision 1.8 - (hide annotations) (download)
Fri Aug 10 19:38:57 2012 UTC (11 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63r, checkpoint63s, checkpoint65o, checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, HEAD
Changes since 1.7: +2 -2 lines
rename CTRL_CPPOPTIONS.h to CTRL_OPTIONS.h

1 jmc 1.8 C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_hfacc_ini.F,v 1.7 2012/07/31 16:05:57 heimbach Exp $
2 jmc 1.5 C $Name: $
3 heimbach 1.1
4 jmc 1.8 #include "CTRL_OPTIONS.h"
5 heimbach 1.1
6     CBOP
7     C !ROUTINE: ctrl_hfacc_ini
8     C !INTERFACE:
9     subroutine ctrl_hfacc_ini( mythid )
10    
11     C !DESCRIPTION: \bv
12     c *=================================================================
13 jmc 1.5 c | SUBROUTINE ctrl_hfacc_ini
14 heimbach 1.1 c | Add the hFacC part of the control vector to the model state
15 jmc 1.5 c | and update the tile halos.
16 heimbach 1.1 c | The control vector is defined in the header file "ctrl.h".
17     c *=================================================================
18     C \ev
19    
20     C !USES:
21     implicit none
22    
23     c == global variables ==
24     #include "EEPARAMS.h"
25     #include "SIZE.h"
26     #include "GRID.h"
27 heimbach 1.7 #include "CTRL_SIZE.h"
28 heimbach 1.1 #include "ctrl.h"
29     #include "ctrl_dummy.h"
30     #include "optim.h"
31    
32     C !INPUT/OUTPUT PARAMETERS:
33     c == routine arguments ==
34     integer mythid
35    
36     #ifdef ALLOW_HFACC_CONTROL
37     C !LOCAL VARIABLES:
38     c == local variables ==
39    
40     integer bi,bj
41     integer i,j,k
42     integer itlo,ithi
43     integer jtlo,jthi
44     integer jmin,jmax
45     integer imin,imax
46     integer il
47    
48     logical equal
49     logical doglobalread
50     logical ladinit
51    
52     character*( 80) fnamehfacc
53     character*(max_len_mbuf) msgbuf
54    
55     _RL fac
56    
57     c == external ==
58     integer ilnblnk
59     external ilnblnk
60    
61     c == end of interface ==
62     CEOP
63    
64     jtlo = mybylo(mythid)
65     jthi = mybyhi(mythid)
66     itlo = mybxlo(mythid)
67     ithi = mybxhi(mythid)
68     jmin = 1-oly
69     jmax = sny+oly
70     imin = 1-olx
71     imax = snx+olx
72    
73     doglobalread = .false.
74     ladinit = .false.
75    
76     equal = .true.
77    
78     if ( equal ) then
79     fac = 1. _d 0
80     else
81     fac = 0. _d 0
82     endif
83    
84 jmc 1.5 Cml write(msgbuf,'(a)')
85 heimbach 1.1 Cml & 'ctrl_hfacc_ini: Re-initialising hFacC,'
86     Cml call print_message( msgbuf, standardmessageunit,
87     Cml & SQUEEZE_RIGHT , mythid)
88 jmc 1.5 Cml write(msgbuf,'(a)')
89 heimbach 1.1 Cml & ' adding the control vector.'
90     Cml call print_message( msgbuf, standardmessageunit,
91     Cml & SQUEEZE_RIGHT , mythid)
92 jmc 1.5 write(standardmessageunit,'(21x,a)')
93 heimbach 1.1 & 'ctrl_hfacc_ini: Re-initialising hFacC,'
94 jmc 1.5 write(standardmessageunit,'(21x,a)')
95 heimbach 1.1 & ' adding the control vector.'
96    
97     C Re-initialize hFacC, so that TAMC/TAF can see it
98     C Once hFacC is the control variable, and not its anomaly
99     C this will be no longer necessary
100     do bj = jtlo,jthi
101     do bi = itlo,ithi
102     do k = 1,nr
103     do j = jmin,jmax
104     do i = imin,imax
105     hFacC(i,j,k,bi,bj) = 0.
106     tmpfld3d(i,j,k,bi,bj) = 0. _d 0
107     enddo
108     enddo
109     enddo
110     enddo
111     enddo
112     _BEGIN_MASTER( myThid )
113     CALL READ_FLD_XYZ_RL( 'hFacC', ' ', hFacC, 0, myThid )
114     _END_MASTER( myThid )
115 jmc 1.6 _EXCH_XYZ_RS( hFacC ,myThid )
116 heimbach 1.1
117 jmc 1.5 C--
118 heimbach 1.1 il=ilnblnk( xx_hfacc_file )
119     write(fnamehfacc(1:80),'(2a,i10.10)')
120     & xx_hfacc_file(1:il),'.',optimcycle
121     #ifdef ALLOW_HFACC3D_CONTROL
122 heimbach 1.4 call active_read_xyz( fnamehfacc, tmpfld3d, 1,
123 heimbach 1.1 & doglobalread, ladinit, optimcycle,
124     & mythid, xx_hfacc_dummy )
125     do bj = jtlo,jthi
126     do bi = itlo,ithi
127     do k = 1,nr
128     do j = jmin,jmax
129     do i = imin,imax
130     hFacC(i,j,k,bi,bj) = hFacC(i,j,k,bi,bj) +
131     & fac*tmpfld3d(i,j,k,bi,bj)
132     enddo
133     enddo
134     enddo
135     enddo
136     enddo
137     #else /* ALLOW_HFACC3D_CONTROL undefined */
138 heimbach 1.4 call active_read_xy( fnamehfacc, tmpfld2d, 1,
139 heimbach 1.1 & doglobalread, ladinit, optimcycle,
140     & mythid, xx_hfacc_dummy )
141     do bj = jtlo,jthi
142     do bi = itlo,ithi
143     do j = jmin,jmax
144     do i = imin,imax
145     k = k_lowC(i,j,bi,bj)
146     c if ( k .gt. 0 ) then
147 jmc 1.5 hFacC(i,j,k,bi,bj) = hFacC(i,j,k,bi,bj)
148 heimbach 1.1 & + fac*tmpfld2d(i,j,bi,bj)
149     c end if
150     enddo
151     enddo
152     enddo
153     enddo
154     #endif /* ALLOW_HFACC3D_CONTROL */
155    
156     c-- Update the tile edges.
157    
158     CALL dummy_in_hfac( 'C', 0, myThid )
159 jmc 1.6 _EXCH_XYZ_RS( hFacC, myThid )
160 heimbach 1.1 CALL dummy_in_hfac( 'C', 1, myThid )
161    
162     #endif /* ALLOW_HFACC_CONTROL */
163    
164     return
165     end
166    

  ViewVC Help
Powered by ViewVC 1.1.22