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

Contents of /MITgcm/pkg/ctrl/ctrl_depth_ini.F

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


Revision 1.4 - (show annotations) (download)
Tue Apr 28 18:09:28 2009 UTC (15 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint62, checkpoint63, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61n, checkpoint61o, checkpoint61m, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.3: +2 -2 lines
change macros (EXCH & GLOBAL_SUM/MAX) sufix _R4/_R8 to _RS/_RL
 when applied to _RS/_RL variable

1 C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_depth_ini.F,v 1.3 2009/02/27 03:07:50 jmc Exp $
2 C $Name: $
3
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 call active_read_xy( fnamedepth, tmpfld2d, 1,
116 & 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 _EXCH_XY_RL( xx_r_low, myThid )
132
133 #endif /* ALLOW_DEPTH_CONTROL */
134
135 return
136 end
137

  ViewVC Help
Powered by ViewVC 1.1.22