122 |
dBug = .FALSE. |
dBug = .FALSE. |
123 |
c dBug = ( bi.EQ.3 .AND. i.EQ.15 .AND. j.EQ.11 ) |
c dBug = ( bi.EQ.3 .AND. i.EQ.15 .AND. j.EQ.11 ) |
124 |
c dBug = ( bi.EQ.6 .AND. i.EQ.18 .AND. j.EQ.10 ) |
c dBug = ( bi.EQ.6 .AND. i.EQ.18 .AND. j.EQ.10 ) |
125 |
IF ( dBug ) WRITE(6,'(A,2I4,2I2)') 'ThSI_SOLVE4T: i,j=',i,j,bi,bj |
IF (dBug) WRITE(6,'(A,2I4,2I2)') 'ThSI_SOLVE4T: i,j=',i,j,bi,bj |
126 |
|
|
127 |
if ( hi.lt.himin ) then |
if ( hi.lt.himin ) then |
128 |
C If hi < himin, melt the ice. |
C If hi < himin, melt the ice. |
158 |
write (6,*) 'BBerr Tice(1) > 0 = ',Tice(1) |
write (6,*) 'BBerr Tice(1) > 0 = ',Tice(1) |
159 |
write (6,*) 'BBerr Tice(2) > 0 = ',Tice(2) |
write (6,*) 'BBerr Tice(2) > 0 = ',Tice(2) |
160 |
endif |
endif |
161 |
IF ( dBug ) WRITE(6,1010) 'ThSI_SOLVE4T: k,Tice=',0,Tsf,Tice |
IF (dBug) WRITE(6,1010) 'ThSI_SOLVE4T: k, Ts, Tice=',0,Tsf,Tice |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
162 |
|
|
163 |
C Compute coefficients used in quadratic formula. |
C Compute coefficients used in quadratic formula. |
164 |
|
|
172 |
& / (6. _d 0*dt*k32 + rhoi*cpice *hi) - fswint |
& / (6. _d 0*dt*k32 + rhoi*cpice *hi) - fswint |
173 |
c1 = rhoi*Lfresh*hi*Tmlt1 / (2. _d 0*dt) |
c1 = rhoi*Lfresh*hi*Tmlt1 / (2. _d 0*dt) |
174 |
|
|
175 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
176 |
C Compute new surface and internal temperatures; iterate until |
C Compute new surface and internal temperatures; iterate until |
177 |
C Tsfc converges. |
C Tsfc converges. |
178 |
|
|
198 |
flx0 = fswdn + flxExcSw(1) |
flx0 = fswdn + flxExcSw(1) |
199 |
df0dT = flxExcSw(2) |
df0dT = flxExcSw(2) |
200 |
ENDIF |
ENDIF |
201 |
|
IF ( dBug ) WRITE(6,1020) 'ThSI_SOLVE4T: flx0,df0dT,k12,D=', |
202 |
|
& flx0,df0dT,k12,k12-df0dT |
203 |
|
|
204 |
C Compute new top layer and surface temperatures. |
C Compute new top layer and surface temperatures. |
205 |
C If Tsfc is computed to be > 0 C, fix Tsfc = 0 and recompute T1 |
C If Tsfc is computed to be > 0 C, fix Tsfc = 0 and recompute T1 |
211 |
dTsf = (flx0 + k12*(Tice(1)-Tsf)) / (k12-df0dT) |
dTsf = (flx0 + k12*(Tice(1)-Tsf)) / (k12-df0dT) |
212 |
Tsf = Tsf + dTsf |
Tsf = Tsf + dTsf |
213 |
if (Tsf .gt. 0. _d 0) then |
if (Tsf .gt. 0. _d 0) then |
214 |
IF(dBug) WRITE(6,1010) 'ThSI_SOLVE4T: k,tice=', |
IF(dBug) WRITE(6,1010) 'ThSI_SOLVE4T: k,ts,t1,dTs=', |
215 |
& k,Tsf,Tice(1),dTsf |
& k,Tsf,Tice(1),dTsf |
216 |
a1 = a10 + k12 |
a1 = a10 + k12 |
217 |
b1 = b10 ! note b1 = b10 - k12*Tf0 |
b1 = b10 ! note b1 = b10 - k12*Tf0 |
244 |
C if Tsfc has not converged.) |
C if Tsfc has not converged.) |
245 |
C If no convergence, then repeat. |
C If no convergence, then repeat. |
246 |
|
|
247 |
IF ( dBug ) WRITE(6,1010) 'ThSI_SOLVE4T: k,tice=', |
IF ( dBug ) WRITE(6,1010) 'ThSI_SOLVE4T: k,ts,t1,dTs=', |
248 |
& k,Tsf,Tice(1),dTsf |
& k,Tsf,Tice(1),dTsf |
249 |
IF ( useBlkFlx ) THEN |
IF ( useBlkFlx ) THEN |
250 |
if (abs(dTsf).lt.Terrmax) then |
if (abs(dTsf).lt.Terrmax) then |
273 |
Tice(2) = (2. _d 0*dt*k32*(Tice(1)+2. _d 0*Tf) |
Tice(2) = (2. _d 0*dt*k32*(Tice(1)+2. _d 0*Tf) |
274 |
& + rhoi*cpice *hi*Tice(2)) |
& + rhoi*cpice *hi*Tice(2)) |
275 |
& /(6. _d 0*dt*k32 + rhoi*cpice *hi) |
& /(6. _d 0*dt*k32 + rhoi*cpice *hi) |
276 |
IF ( dBug ) WRITE(6,1010) 'ThSI_SOLVE4T: k,Tice=',k,Tsf,Tice |
IF (dBug) WRITE(6,1010) 'ThSI_SOLVE4T: k, Ts, Tice=',k,Tsf,Tice |
277 |
|
|
278 |
|
|
279 |
C Compute final flux values at surfaces. |
C Compute final flux values at surfaces. |