1 |
heimbach |
1.2 |
C $Header: /u/gcmpack/MITgcm/verification/halfpipe_streamice/code_ad/ctrl_map_gentim2d.F,v 1.1 2015/01/30 21:04:45 heimbach Exp $ |
2 |
heimbach |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "CTRL_OPTIONS.h" |
5 |
|
|
#include "STREAMICE_OPTIONS.h" |
6 |
|
|
|
7 |
|
|
CBOP |
8 |
|
|
C !ROUTINE: CTRL_MAP_GENTIM2D |
9 |
|
|
C !INTERFACE: |
10 |
|
|
SUBROUTINE CTRL_MAP_GENTIM2D( |
11 |
|
|
I myTime, myIter, myThid ) |
12 |
|
|
C !DESCRIPTION: \bv |
13 |
|
|
C *=============================================================* |
14 |
|
|
C | S/R CTRL_MAP_GENTIM2D |
15 |
|
|
C *=============================================================* |
16 |
|
|
|
17 |
|
|
C !USES: |
18 |
|
|
IMPLICIT NONE |
19 |
|
|
|
20 |
|
|
C === Global variables === |
21 |
|
|
#include "SIZE.h" |
22 |
|
|
#include "EEPARAMS.h" |
23 |
|
|
#include "PARAMS.h" |
24 |
|
|
#include "FFIELDS.h" |
25 |
|
|
#include "DYNVARS.h" |
26 |
|
|
#include "GRID.h" |
27 |
|
|
#include "CTRL_SIZE.h" |
28 |
|
|
#include "ctrl.h" |
29 |
|
|
#include "CTRL_GENARR.h" |
30 |
|
|
#include "ctrl_dummy.h" |
31 |
|
|
#include "optim.h" |
32 |
|
|
#ifdef ALLOW_AUTODIFF |
33 |
|
|
#include "AUTODIFF_MYFIELDS.h" |
34 |
|
|
#endif |
35 |
|
|
#ifdef ALLOW_STREAMICE |
36 |
|
|
#include "STREAMICE.h" |
37 |
|
|
#endif |
38 |
|
|
|
39 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
40 |
|
|
C === Routine arguments === |
41 |
|
|
C myIter :: iteration counter for this thread |
42 |
|
|
C myTime :: time counter for this thread |
43 |
|
|
C myThid :: thread number for this instance of the routine. |
44 |
|
|
_RL myTime |
45 |
|
|
INTEGER myIter |
46 |
|
|
INTEGER myThid |
47 |
|
|
|
48 |
|
|
C !LOCAL VARIABLES: |
49 |
|
|
C == Local variables == |
50 |
|
|
integer bi,bj |
51 |
|
|
integer i,j,k |
52 |
|
|
integer itlo,ithi |
53 |
|
|
integer jtlo,jthi |
54 |
|
|
integer jmin,jmax |
55 |
|
|
integer imin,imax |
56 |
|
|
integer il |
57 |
|
|
integer iarr |
58 |
|
|
|
59 |
|
|
logical equal |
60 |
|
|
logical doglobalread |
61 |
|
|
logical ladinit |
62 |
|
|
character*(MAX_LEN_FNAM) fnamebase |
63 |
|
|
character*( 80) fnamegeneric |
64 |
|
|
|
65 |
|
|
_RL fac |
66 |
|
|
_RL xx_gentim2d_loc(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
67 |
|
|
_RL genweight(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) |
68 |
|
|
|
69 |
|
|
c == external == |
70 |
|
|
integer ilnblnk |
71 |
|
|
external ilnblnk |
72 |
|
|
CEOP |
73 |
|
|
|
74 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
75 |
|
|
|
76 |
|
|
#ifdef ALLOW_GENTIM2D_CONTROL |
77 |
|
|
C-- An example of connecting specific fields |
78 |
|
|
C-- to generic time-varying 2D control arrays |
79 |
|
|
cph--->>> |
80 |
|
|
cph--->>> COMPILE FAILURE IS DELIBERATE |
81 |
|
|
cph--->>> BE SURE WHAT YOU ARE DOING AND CUSTOMIZE <<<--- |
82 |
|
|
cph--->>> |
83 |
|
|
C-- generic - user-defined control vars |
84 |
|
|
|
85 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
86 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
87 |
|
|
DO J = 1-Oly,sNy+Oly |
88 |
|
|
DO I = 1-Olx,sNx+Olx |
89 |
|
|
bdot_streamice(i,j,bi,bj) = 0. _d 0 |
90 |
|
|
ENDDO |
91 |
|
|
ENDDO |
92 |
|
|
ENDDO |
93 |
|
|
ENDDO |
94 |
|
|
|
95 |
|
|
DO iarr = 1, maxCtrlTim2D |
96 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
97 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
98 |
|
|
DO J = 1-Oly,sNy+Oly |
99 |
|
|
DO I = 1-Olx,sNx+Olx |
100 |
|
|
xx_gentim2d_loc(I,J,bi,bj) = 0. _d 0 |
101 |
|
|
! bdot_streamice(i,j,bi,bj) = 0. _d 0 |
102 |
|
|
ENDDO |
103 |
|
|
ENDDO |
104 |
|
|
ENDDO |
105 |
|
|
ENDDO |
106 |
|
|
C |
107 |
|
|
! CALL CTRL_GET_GEN ( |
108 |
|
|
! I xx_gentim2d_file(iarr)(1:MAX_LEN_FNAM), |
109 |
|
|
! I xx_gentim2d_startdate(1,iarr), |
110 |
|
|
! I xx_gentim2d_period(iarr), |
111 |
|
|
! I maskC, |
112 |
|
|
! O xx_gentim2d_loc, |
113 |
|
|
! I xx_gentim2d0(1-Olx,1-Oly,1,1,iarr), |
114 |
|
|
! I xx_gentim2d1(1-Olx,1-Oly,1,1,iarr), |
115 |
|
|
! I xx_gentim2d_dummy(iarr), |
116 |
|
|
! I zeroRL, zeroRL, |
117 |
|
|
! I mytime, myiter, mythid ) |
118 |
|
|
|
119 |
|
|
! CALL CTRL_GET_GEN ( |
120 |
|
|
! I xx_gentim2d_file(iarr)(1:MAX_LEN_FNAM), |
121 |
|
|
! I xx_gentim2d_startdate(1,iarr), |
122 |
|
|
! I xx_gentim2d_period(iarr), |
123 |
|
|
! I maskC, |
124 |
|
|
! O xx_gentim2d_loc, |
125 |
|
|
! I xx_gentim2d0(1-Olx,1-Oly,1,1,iarr), |
126 |
|
|
! I xx_gentim2d1(1-Olx,1-Oly,1,1,iarr), |
127 |
|
|
! I xx_gentim2d_dummy(iarr), |
128 |
|
|
! I zeroRL, zeroRL, genweight, |
129 |
|
|
! I mytime, myiter, mythid ) |
130 |
|
|
|
131 |
|
|
fnamebase = xx_gentim2d_file(iarr) |
132 |
|
|
CALL CTRL_GET_GEN ( |
133 |
|
|
I xx_gentim2d_file(iarr), |
134 |
|
|
I xx_gentim2d_startdate(1,iarr), |
135 |
|
|
I xx_gentim2d_period(iarr), |
136 |
|
|
I maskC, |
137 |
|
|
O xx_gentim2d_loc, |
138 |
|
|
I xx_gentim2d0(1-Olx,1-Oly,1,1,iarr), |
139 |
|
|
I xx_gentim2d1(1-Olx,1-Oly,1,1,iarr), |
140 |
heimbach |
1.2 |
I xx_gentim2d_dummy(iarr), |
141 |
heimbach |
1.1 |
I zeroRL, zeroRL, |
142 |
|
|
I wgentim2d(1-Olx,1-Oly,1,1,iarr), |
143 |
|
|
I mytime, myiter, mythid ) |
144 |
|
|
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
148 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
149 |
|
|
do j = 1,sNy |
150 |
|
|
do i = 1,sNx |
151 |
|
|
xx_gentim2d(i,j,bi,bj,iarr)=xx_gentim2d_loc(i,j,bi,bj) |
152 |
|
|
enddo |
153 |
|
|
enddo |
154 |
|
|
enddo |
155 |
|
|
enddo |
156 |
|
|
|
157 |
|
|
|
158 |
|
|
C |
159 |
|
|
|
160 |
|
|
|
161 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
162 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
163 |
|
|
DO J = 1,sNy |
164 |
|
|
DO I = 1,sNx |
165 |
|
|
if ( iarr .eq. 1 ) then |
166 |
|
|
|
167 |
|
|
|
168 |
|
|
bdot_streamice(i,j,bi,bj) = |
169 |
|
|
& bdot_streamice(i,j,bi,bj)+ |
170 |
heimbach |
1.2 |
& xx_gentim2d(i,j,bi,bj,iarr) |
171 |
heimbach |
1.1 |
|
172 |
|
|
endif |
173 |
|
|
enddo |
174 |
|
|
enddo |
175 |
|
|
enddo |
176 |
|
|
enddo |
177 |
|
|
c-- |
178 |
|
|
! CALL EXCH_XY_RL |
179 |
|
|
! & (streamice_v_shear_pert, myThid) |
180 |
|
|
! CALL EXCH_XY_RL |
181 |
|
|
! & (streamice_u_shear_pert, myThid) |
182 |
|
|
! CALL EXCH_XY_RL |
183 |
|
|
! & (streamice_v_normal_pert, myThid) |
184 |
|
|
! CALL EXCH_XY_RL |
185 |
|
|
! & (streamice_u_normal_pert, myThid) |
186 |
|
|
|
187 |
|
|
_EXCH_XY_RL(bdot_streamice, mythid ) |
188 |
|
|
c-- |
189 |
|
|
ENDDO ! iarr |
190 |
|
|
|
191 |
|
|
|
192 |
|
|
#endif /* ALLOW_GENTIM2D_CONTROL */ |
193 |
|
|
|
194 |
|
|
RETURN |
195 |
|
|
END |