29 |
#include "FFIELDS.h" |
#include "FFIELDS.h" |
30 |
#include "THSICE_PARAMS.h" |
#include "THSICE_PARAMS.h" |
31 |
#include "THSICE_VARS.h" |
#include "THSICE_VARS.h" |
32 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
33 |
|
# include "tamc.h" |
34 |
|
# include "tamc_keys.h" |
35 |
|
#endif |
36 |
|
|
37 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
38 |
C === Routine arguments === |
C === Routine arguments === |
84 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
85 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
86 |
|
|
87 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
88 |
|
act1 = bi - myBxLo(myThid) |
89 |
|
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
90 |
|
act2 = bj - myByLo(myThid) |
91 |
|
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
92 |
|
act3 = myThid - 1 |
93 |
|
max3 = nTx*nTy |
94 |
|
act4 = ikey_dynamics - 1 |
95 |
|
iicekey = (act1 + 1) + act2*max1 |
96 |
|
& + act3*max1*max2 |
97 |
|
& + act4*max1*max2*max3 |
98 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
99 |
|
|
100 |
C-- Mixed layer thickness: take the 1rst layer |
C-- Mixed layer thickness: take the 1rst layer |
101 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
102 |
IF ( staggerTimeStep .AND. nonlinFreeSurf.GT.0 ) THEN |
IF ( staggerTimeStep .AND. nonlinFreeSurf.GT.0 ) THEN |
129 |
ENDDO |
ENDDO |
130 |
ENDIF |
ENDIF |
131 |
|
|
132 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
133 |
|
CADJ STORE uvel (:,:,1,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte |
134 |
|
CADJ STORE vvel (:,:,1,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte |
135 |
|
#endif |
136 |
|
|
137 |
DO j = jMin, jMax |
DO j = jMin, jMax |
138 |
DO i = iMin, iMax |
DO i = iMin, iMax |
139 |
tOceMxL(i,j,bi,bj) = theta(i,j,1,bi,bj) |
tOceMxL(i,j,bi,bj) = theta(i,j,1,bi,bj) |
151 |
siceAlb(i,j,bi,bj) = 0. _d 0 |
siceAlb(i,j,bi,bj) = 0. _d 0 |
152 |
ENDDO |
ENDDO |
153 |
ENDDO |
ENDDO |
154 |
|
|
155 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
156 |
|
CADJ STORE iceMask = comlev1, key = iicekey |
157 |
|
CADJ STORE iceHeight = comlev1, key = iicekey |
158 |
|
CADJ STORE snowHeight = comlev1, key = iicekey |
159 |
|
CADJ STORE Tsrf = comlev1, key = iicekey |
160 |
|
CADJ STORE Qice1 = comlev1, key = iicekey |
161 |
|
CADJ STORE Qice2 = comlev1, key = iicekey |
162 |
|
CADJ STORE snowAge = comlev1, key = iicekey |
163 |
|
|
164 |
|
CADJ STORE sHeating = comlev1, key = iicekey |
165 |
|
CADJ STORE flxCndBt = comlev1, key = iicekey |
166 |
|
CADJ STORE snowPrc = comlev1, key = iicekey |
167 |
|
|
168 |
|
CADJ STORE hOceMxL = comlev1, key = iicekey |
169 |
|
CADJ STORE tOceMxL = comlev1, key = iicekey |
170 |
|
CADJ STORE sOceMxL = comlev1, key = iicekey |
171 |
|
CADJ STORE v2ocMxL = comlev1, key = iicekey |
172 |
|
|
173 |
|
CADJ STORE empmr = comlev1, key = iicekey |
174 |
|
CADJ STORE qnet = comlev1, key = iicekey |
175 |
|
#endif |
176 |
|
|
177 |
#ifdef ALLOW_BULK_FORCE |
#ifdef ALLOW_BULK_FORCE |
178 |
IF ( useBulkforce ) THEN |
IF ( useBulkforce ) THEN |
179 |
CALL THSICE_GET_PRECIP( |
CALL THSICE_GET_PRECIP( |
183 |
ENDIF |
ENDIF |
184 |
#endif |
#endif |
185 |
|
|
186 |
|
|
187 |
CALL THSICE_STEP_FWD( |
CALL THSICE_STEP_FWD( |
188 |
I bi, bj, iMin, iMax, jMin, jMax, |
I bi, bj, iMin, iMax, jMin, jMax, |
189 |
I prcAtm, |
I prcAtm, |
198 |
c ENDDO |
c ENDDO |
199 |
|
|
200 |
c IF ( .FALSE. ) THEN |
c IF ( .FALSE. ) THEN |
201 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
202 |
|
CADJ STORE fu(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte |
203 |
|
CADJ STORE fv(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte |
204 |
|
#endif |
205 |
IF ( stressReduction.GT. 0. _d 0 ) THEN |
IF ( stressReduction.GT. 0. _d 0 ) THEN |
206 |
DO j = jMin, jMax |
DO j = jMin, jMax |
207 |
DO i = iMin+1,iMax |
DO i = iMin+1,iMax |