/[MITgcm]/MITgcm/pkg/thsice/thsice_step_temp.F
ViewVC logotype

Contents of /MITgcm/pkg/thsice/thsice_step_temp.F

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


Revision 1.6 - (show annotations) (download)
Thu Apr 19 13:22:36 2007 UTC (17 years, 2 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint59, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q
Changes since 1.5: +1 -13 lines
Clean up.

1 C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_step_temp.F,v 1.5 2007/04/19 02:59:29 jmc Exp $
2 C $Name: $
3
4 #include "THSICE_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: THSICE_STEP_TEMP
8 C !INTERFACE:
9 SUBROUTINE THSICE_STEP_TEMP(
10 I bi, bj, iMin, iMax, jMin, jMax,
11 I myTime, myIter, myThid )
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | S/R THSICE_STEP_TEMP
15 C | o Step Forward Surface and SeaIce Temperature.
16 C *==========================================================*
17 C \ev
18
19 C !USES:
20 IMPLICIT NONE
21
22 C === Global variables ===
23 #include "SIZE.h"
24 #include "EEPARAMS.h"
25 #include "PARAMS.h"
26 #include "FFIELDS.h"
27 #include "THSICE_SIZE.h"
28 #include "THSICE_PARAMS.h"
29 #include "THSICE_VARS.h"
30 #include "THSICE_TAVE.h"
31 #ifdef ALLOW_AUTODIFF_TAMC
32 # include "tamc.h"
33 # include "tamc_keys.h"
34 #endif
35
36 INTEGER siLo, siHi, sjLo, sjHi
37 PARAMETER ( siLo = 1-OLx , siHi = sNx+OLx )
38 PARAMETER ( sjLo = 1-OLy , sjHi = sNy+OLy )
39
40 C !INPUT/OUTPUT PARAMETERS:
41 C === Routine arguments ===
42 C- input:
43 C bi,bj :: tile indices
44 C iMin,iMax :: computation domain: 1rst index range
45 C jMin,jMax :: computation domain: 2nd index range
46 C myTime :: time counter for this thread
47 C myIter :: iteration counter for this thread
48 C myThid :: thread number for this instance of the routine.
49 C-- Modify fluxes hold in commom blocks
50 C- input:
51 C icFlxSW :: (Inp) short-wave heat flux (+=down): downward comp. only
52 C- output
53 C icFlxSW :: (Out) net SW flux into ocean (+=down)
54 C icFlxAtm:: net flux of energy from the atmosphere [W/m2] (+=down)
55 C icFrwAtm:: evaporation to the atmosphere (kg/m2/s) (>0 if evaporate)
56 C--
57 INTEGER bi,bj
58 INTEGER iMin, iMax
59 INTEGER jMin, jMax
60 _RL myTime
61 INTEGER myIter
62 INTEGER myThid
63 CEOP
64
65 #ifdef ALLOW_THSICE
66 C !LOCAL VARIABLES:
67 C === Local variables ===
68 C tFrzOce :: sea-water freezing temperature [oC] (function of S)
69 C dTsrf :: surf. temp adjusment: Ts^n+1 - Ts^n
70 INTEGER i,j
71 _RL tFrzOce(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
72 c _RL dTsrf (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
73 _RL tmpflx(1:2), tmpdTs(1:2)
74 #ifdef SHORTWAVE_HEATING
75 _RL opFrac, icFrac
76 #endif
77 LOGICAL dBugFlag
78
79 C- define grid-point location where to print debugging values
80 #include "THSICE_DEBUG.h"
81
82 1010 FORMAT(A,1P4E14.6)
83
84 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
85
86 #ifdef ALLOW_AUTODIFF_TAMC
87 act1 = bi - myBxLo(myThid)
88 max1 = myBxHi(myThid) - myBxLo(myThid) + 1
89 act2 = bj - myByLo(myThid)
90 max2 = myByHi(myThid) - myByLo(myThid) + 1
91 act3 = myThid - 1
92 max3 = nTx*nTy
93 act4 = ikey_dynamics - 1
94 iicekey = (act1 + 1) + act2*max1
95 & + act3*max1*max2
96 & + act4*max1*max2*max3
97 #endif /* ALLOW_AUTODIFF_TAMC */
98
99 dBugFlag = debugLevel.GE.debLevB
100 C- Initialise flxAtm,evpAtm
101 DO j = 1-OLy, sNy+OLy
102 DO i = 1-OLx, sNx+OLx
103 icFlxAtm(i,j,bi,bj) = 0.
104 icFrwAtm(i,j,bi,bj) = 0.
105 ENDDO
106 ENDDO
107
108 #ifdef ALLOW_AUTODIFF_TAMC
109 CADJ STORE tsrf(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
110 #endif
111 c IF ( fluidIsWater ) THEN
112 CALL THSICE_ALBEDO(
113 I bi, bj, siLo, siHi, sjLo, sjHi,
114 I iMin,iMax, jMin,jMax,
115 I iceMask(siLo,sjLo,bi,bj), iceHeight(siLo,sjLo,bi,bj),
116 I snowHeight(siLo,sjLo,bi,bj), Tsrf(siLo,sjLo,bi,bj),
117 I snowAge(siLo,sjLo,bi,bj),
118 O siceAlb(siLo,sjLo,bi,bj),
119 I myTime, myIter, myThid )
120
121 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
122 C part.1 : ice-covered fraction ;
123 C Solve for surface and ice temperature (implicitly) ; compute surf. fluxes
124 C-------
125
126 #ifdef ALLOW_AUTODIFF_TAMC
127 CADJ STORE icflxsw(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
128 #endif
129
130 DO j = jMin, jMax
131 DO i = iMin, iMax
132 IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN
133 #ifdef ALLOW_DBUG_THSICE
134 IF ( dBug(i,j,bi,bj) ) THEN
135 WRITE(6,'(A,2I4,2I2)') 'ThSI_STEP_T: i,j=',i,j,bi,bj
136 WRITE(6,1010) 'ThSI_STEP_T: iceMask, hIc, hSn, Tsf =',
137 & iceMask(i,j,bi,bj), iceHeight(i,j,bi,bj),
138 & snowHeight(i,j,bi,bj), Tsrf(i,j,bi,bj)
139 ENDIF
140 #endif
141 C- surface net SW flux:
142 icFlxSW(i,j,bi,bj) = icFlxSW(i,j,bi,bj)
143 & *(1. _d 0 - siceAlb(i,j,bi,bj))
144 tFrzOce(i,j) = -mu_Tf*sOceMxL(i,j,bi,bj)
145 ELSE
146 tFrzOce(i,j) = 0. _d 0
147 ENDIF
148 ENDDO
149 ENDDO
150
151 #ifdef ALLOW_AUTODIFF_TAMC
152 CADJ STORE qice1(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
153 CADJ STORE qice2(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
154 #endif
155 CALL THSICE_SOLVE4TEMP(
156 I bi, bj, siLo, siHi, sjLo, sjHi,
157 I iMin,iMax, jMin,jMax, dBugFlag,
158 I useBulkForce, useEXF,
159 I iceMask(siLo,sjLo,bi,bj), iceHeight(siLo,sjLo,bi,bj),
160 I snowHeight(siLo,sjLo,bi,bj), tFrzOce, tmpflx,
161 U icFlxSW(siLo,sjLo,bi,bj), Tsrf(siLo,sjLo,bi,bj),
162 U Qice1(siLo,sjLo,bi,bj), Qice2(siLo,sjLo,bi,bj),
163 O Tice1(siLo,sjLo,bi,bj), Tice2(siLo,sjLo,bi,bj), tmpdTs,
164 O sHeating(siLo,sjLo,bi,bj), flxCndBt(siLo,sjLo,bi,bj),
165 O icFlxAtm(siLo,sjLo,bi,bj), icFrwAtm(siLo,sjLo,bi,bj),
166 I myTime, myIter, myThid )
167
168 #ifdef SHORTWAVE_HEATING
169 DO j = jMin, jMax
170 DO i = iMin, iMax
171 IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN
172 icFrac = iceMask(i,j,bi,bj)
173 opFrac = 1. _d 0 - icFrac
174 C-- Update Fluxes :
175 Qsw(i,j,bi,bj) = opFrac*Qsw(i,j,bi,bj)
176 & - icFrac*icFlxSW(i,j,bi,bj)
177 ENDIF
178 ENDDO
179 ENDDO
180 #endif /* SHORTWAVE_HEATING */
181 c ENDIF
182
183 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
184 #endif /* ALLOW_THSICE */
185
186 RETURN
187 END

  ViewVC Help
Powered by ViewVC 1.1.22