1 |
mlosch |
1.5 |
C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_ctrl_map_ini.F,v 1.4 2009/04/28 18:20:02 jmc Exp $ |
2 |
jmc |
1.3 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
|
|
#include "SEAICE_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: seaice_ctrl_map_ini |
8 |
|
|
C !INTERFACE: |
9 |
|
|
subroutine seaice_ctrl_map_ini( mythid ) |
10 |
|
|
|
11 |
|
|
C !DESCRIPTION: \bv |
12 |
|
|
c *================================================================= |
13 |
|
|
c | SUBROUTINE seaice_ctrl_map_ini |
14 |
jmc |
1.3 |
c | Add the temperature, salinity, and diffusivity parts of the |
15 |
|
|
c | control vector to the model state 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 "SIZE.h" |
25 |
|
|
#include "EEPARAMS.h" |
26 |
|
|
#include "PARAMS.h" |
27 |
|
|
#include "GRID.h" |
28 |
|
|
#include "DYNVARS.h" |
29 |
|
|
#include "FFIELDS.h" |
30 |
|
|
#include "SEAICE.h" |
31 |
heimbach |
1.2 |
#ifdef ALLOW_CTRL |
32 |
|
|
# include "ctrl.h" |
33 |
|
|
# include "ctrl_dummy.h" |
34 |
|
|
# include "optim.h" |
35 |
|
|
#endif |
36 |
heimbach |
1.1 |
|
37 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
38 |
|
|
c == routine arguments == |
39 |
|
|
integer mythid |
40 |
|
|
|
41 |
heimbach |
1.2 |
#ifdef ALLOW_CTRL |
42 |
heimbach |
1.1 |
C !LOCAL VARIABLES: |
43 |
|
|
c == local variables == |
44 |
|
|
|
45 |
|
|
integer bi,bj |
46 |
|
|
integer i,j,k |
47 |
|
|
integer itlo,ithi |
48 |
|
|
integer jtlo,jthi |
49 |
|
|
integer jmin,jmax |
50 |
|
|
integer imin,imax |
51 |
|
|
integer il |
52 |
|
|
|
53 |
|
|
logical equal |
54 |
|
|
logical doglobalread |
55 |
|
|
logical ladinit |
56 |
|
|
|
57 |
|
|
character*( 80) fnamegeneric |
58 |
|
|
|
59 |
|
|
_RL fac |
60 |
|
|
_RL tmptest |
61 |
|
|
|
62 |
|
|
c == external == |
63 |
|
|
integer ilnblnk |
64 |
|
|
external ilnblnk |
65 |
|
|
|
66 |
|
|
c == end of interface == |
67 |
|
|
CEOP |
68 |
|
|
|
69 |
|
|
jtlo = mybylo(mythid) |
70 |
|
|
jthi = mybyhi(mythid) |
71 |
|
|
itlo = mybxlo(mythid) |
72 |
|
|
ithi = mybxhi(mythid) |
73 |
|
|
jmin = 1 |
74 |
|
|
jmax = sny |
75 |
|
|
imin = 1 |
76 |
|
|
imax = snx |
77 |
|
|
|
78 |
|
|
doglobalread = .false. |
79 |
|
|
ladinit = .false. |
80 |
|
|
|
81 |
|
|
equal = .true. |
82 |
|
|
|
83 |
|
|
if ( equal ) then |
84 |
|
|
fac = 1. _d 0 |
85 |
|
|
else |
86 |
|
|
fac = 0. _d 0 |
87 |
|
|
endif |
88 |
|
|
|
89 |
|
|
#ifdef ALLOW_SIAREA_CONTROL |
90 |
|
|
c-- siarea. |
91 |
|
|
il=ilnblnk( xx_siarea_file ) |
92 |
|
|
write(fnamegeneric(1:80),'(2a,i10.10)') |
93 |
|
|
& xx_siarea_file(1:il),'.',optimcycle |
94 |
|
|
call active_read_xy( fnamegeneric, tmpfld2d, 1, |
95 |
|
|
& doglobalread, ladinit, optimcycle, |
96 |
|
|
& mythid, xx_siarea_dummy ) |
97 |
|
|
do bj = jtlo,jthi |
98 |
|
|
do bi = itlo,ithi |
99 |
|
|
do j = jmin,jmax |
100 |
|
|
do i = imin,imax |
101 |
mlosch |
1.5 |
area(i,j,bi,bj) = area(i,j,bi,bj) + |
102 |
|
|
& tmpfld2d(i,j,bi,bj) |
103 |
heimbach |
1.1 |
enddo |
104 |
|
|
enddo |
105 |
|
|
enddo |
106 |
|
|
enddo |
107 |
|
|
#endif |
108 |
|
|
|
109 |
|
|
#ifdef ALLOW_SIHEFF_CONTROL |
110 |
|
|
c-- siheff. |
111 |
|
|
il=ilnblnk( xx_siheff_file ) |
112 |
|
|
write(fnamegeneric(1:80),'(2a,i10.10)') |
113 |
|
|
& xx_siheff_file(1:il),'.',optimcycle |
114 |
|
|
call active_read_xy( fnamegeneric, tmpfld2d, 1, |
115 |
|
|
& doglobalread, ladinit, optimcycle, |
116 |
|
|
& mythid, xx_siheff_dummy ) |
117 |
|
|
do bj = jtlo,jthi |
118 |
|
|
do bi = itlo,ithi |
119 |
|
|
do j = jmin,jmax |
120 |
|
|
do i = imin,imax |
121 |
mlosch |
1.5 |
heff(i,j,bi,bj) = heff(i,j,bi,bj) + |
122 |
|
|
& tmpfld2d(i,j,bi,bj) |
123 |
heimbach |
1.1 |
enddo |
124 |
|
|
enddo |
125 |
|
|
enddo |
126 |
|
|
enddo |
127 |
|
|
#endif |
128 |
|
|
|
129 |
|
|
#ifdef ALLOW_SIHSNOW_CONTROL |
130 |
|
|
c-- sihsnow. |
131 |
|
|
il=ilnblnk( xx_sihsnow_file ) |
132 |
|
|
write(fnamegeneric(1:80),'(2a,i10.10)') |
133 |
|
|
& xx_sihsnow_file(1:il),'.',optimcycle |
134 |
|
|
call active_read_xy( fnamegeneric, tmpfld2d, 1, |
135 |
|
|
& doglobalread, ladinit, optimcycle, |
136 |
|
|
& mythid, xx_sihsnow_dummy ) |
137 |
|
|
do bj = jtlo,jthi |
138 |
|
|
do bi = itlo,ithi |
139 |
|
|
do j = jmin,jmax |
140 |
|
|
do i = imin,imax |
141 |
mlosch |
1.5 |
hsnow(i,j,bi,bj) = hsnow(i,j,bi,bj) + |
142 |
|
|
& tmpfld2d(i,j,bi,bj) |
143 |
heimbach |
1.1 |
enddo |
144 |
|
|
enddo |
145 |
|
|
enddo |
146 |
|
|
enddo |
147 |
|
|
#endif |
148 |
|
|
|
149 |
|
|
c-- Update the tile edges. |
150 |
|
|
|
151 |
|
|
#ifdef ALLOW_SIAREA_CONTROL |
152 |
jmc |
1.4 |
_EXCH_XY_RL( area, mythid ) |
153 |
heimbach |
1.1 |
#endif |
154 |
|
|
|
155 |
|
|
#ifdef ALLOW_SIHEFF_CONTROL |
156 |
jmc |
1.4 |
_EXCH_XY_RL( heff, mythid ) |
157 |
heimbach |
1.1 |
#endif |
158 |
|
|
|
159 |
|
|
#ifdef ALLOW_SIHSNOW_CONTROL |
160 |
jmc |
1.4 |
_EXCH_XY_RL( hsnow, mythid ) |
161 |
heimbach |
1.1 |
#endif |
162 |
|
|
|
163 |
heimbach |
1.2 |
#endif /* ALLOW_CTRL */ |
164 |
|
|
|
165 |
heimbach |
1.1 |
return |
166 |
|
|
end |
167 |
|
|
|