1 |
jmc |
1.3 |
C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_depth_ini.F,v 1.2 2007/05/14 22:02:33 heimbach Exp $ |
2 |
heimbach |
1.2 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
|
|
#include "CTRL_CPPOPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: ctrl_depth_ini |
8 |
|
|
C !INTERFACE: |
9 |
|
|
subroutine ctrl_depth_ini( mythid ) |
10 |
|
|
|
11 |
|
|
C !DESCRIPTION: \bv |
12 |
|
|
c *================================================================= |
13 |
|
|
c | SUBROUTINE ctrl_depth_ini |
14 |
|
|
c | Add the depth part of the control vector to the model state |
15 |
|
|
c | and update the tile halos. |
16 |
|
|
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 |
|
|
#include "ctrl.h" |
28 |
|
|
#include "ctrl_dummy.h" |
29 |
|
|
#include "optim.h" |
30 |
|
|
|
31 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
32 |
|
|
c == routine arguments == |
33 |
|
|
integer mythid |
34 |
|
|
|
35 |
|
|
#ifdef ALLOW_DEPTH_CONTROL |
36 |
|
|
C !LOCAL VARIABLES: |
37 |
|
|
c == local variables == |
38 |
|
|
|
39 |
|
|
integer bi,bj |
40 |
|
|
integer i,j,k |
41 |
|
|
integer itlo,ithi |
42 |
|
|
integer jtlo,jthi |
43 |
|
|
integer jmin,jmax |
44 |
|
|
integer imin,imax |
45 |
|
|
integer il |
46 |
|
|
|
47 |
|
|
logical equal |
48 |
|
|
logical doglobalread |
49 |
|
|
logical ladinit |
50 |
|
|
|
51 |
|
|
character*( 80) fnamedepth |
52 |
|
|
character*(max_len_mbuf) msgbuf |
53 |
|
|
|
54 |
|
|
_RL fac |
55 |
|
|
|
56 |
|
|
c == external == |
57 |
|
|
integer ilnblnk |
58 |
|
|
external ilnblnk |
59 |
|
|
|
60 |
|
|
c == end of interface == |
61 |
|
|
CEOP |
62 |
|
|
|
63 |
|
|
jtlo = mybylo(mythid) |
64 |
|
|
jthi = mybyhi(mythid) |
65 |
|
|
itlo = mybxlo(mythid) |
66 |
|
|
ithi = mybxhi(mythid) |
67 |
|
|
jmin = 1-oly |
68 |
|
|
jmax = sny+oly |
69 |
|
|
imin = 1-olx |
70 |
|
|
imax = snx+olx |
71 |
|
|
|
72 |
|
|
doglobalread = .false. |
73 |
|
|
ladinit = .false. |
74 |
|
|
|
75 |
|
|
equal = .true. |
76 |
|
|
|
77 |
|
|
if ( equal ) then |
78 |
|
|
fac = 1. _d 0 |
79 |
|
|
else |
80 |
|
|
fac = 0. _d 0 |
81 |
|
|
endif |
82 |
|
|
|
83 |
|
|
write(standardmessageunit,'(21x,a)') |
84 |
|
|
& 'ctrl_depth_ini: ctrl update R_low,' |
85 |
|
|
write(standardmessageunit,'(21x,a)') |
86 |
|
|
& ' adding the control vector.' |
87 |
|
|
|
88 |
|
|
C Re-initialize hFacC, so that TAMC/TAF can see it |
89 |
|
|
C Once hFacC is the control variable, and not its anomaly |
90 |
|
|
C this will be no longer necessary |
91 |
|
|
do bj = jtlo,jthi |
92 |
|
|
do bi = itlo,ithi |
93 |
|
|
do j = jmin,jmax |
94 |
|
|
do i = imin,imax |
95 |
|
|
tmpfld2d(i,j,bi,bj) = 0. _d 0 |
96 |
|
|
enddo |
97 |
|
|
enddo |
98 |
|
|
enddo |
99 |
|
|
enddo |
100 |
|
|
|
101 |
|
|
C-- |
102 |
|
|
do bj = jtlo,jthi |
103 |
|
|
do bi = itlo,ithi |
104 |
|
|
do j = jmin,jmax |
105 |
|
|
do i = imin,imax |
106 |
|
|
xx_r_low(i,j,bi,bj) = 0. _d 0 |
107 |
|
|
enddo |
108 |
|
|
enddo |
109 |
|
|
enddo |
110 |
|
|
enddo |
111 |
|
|
|
112 |
|
|
il=ilnblnk( xx_depth_file ) |
113 |
|
|
write(fnamedepth(1:80),'(2a,i10.10)') |
114 |
|
|
& xx_depth_file(1:il),'.',optimcycle |
115 |
heimbach |
1.2 |
call active_read_xy( fnamedepth, tmpfld2d, 1, |
116 |
heimbach |
1.1 |
& doglobalread, ladinit, optimcycle, |
117 |
|
|
& mythid, xx_depth_dummy ) |
118 |
|
|
do bj = jtlo,jthi |
119 |
|
|
do bi = itlo,ithi |
120 |
|
|
do j = jmin,jmax |
121 |
|
|
do i = imin,imax |
122 |
|
|
xx_r_low(i,j,bi,bj) = r_low(i,j,bi,bj) |
123 |
|
|
& + fac*tmpfld2d(i,j,bi,bj) |
124 |
|
|
enddo |
125 |
|
|
enddo |
126 |
|
|
enddo |
127 |
|
|
enddo |
128 |
|
|
|
129 |
|
|
c-- Update the tile edges. |
130 |
|
|
|
131 |
jmc |
1.3 |
_EXCH_XY_R8( xx_r_low, myThid ) |
132 |
heimbach |
1.1 |
|
133 |
|
|
#endif /* ALLOW_DEPTH_CONTROL */ |
134 |
|
|
|
135 |
|
|
return |
136 |
|
|
end |
137 |
|
|
|