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

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

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


Revision 1.13 - (show annotations) (download)
Thu Feb 9 02:20:00 2012 UTC (12 years, 4 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63j, checkpoint63k, checkpoint64
Changes since 1.12: +13 -3 lines
Initialization should fix ADM and TLM problem.

1 C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_extend.F,v 1.12 2010/12/17 04:00:14 gforget Exp $
2 C $Name: $
3
4 #include "THSICE_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: THSICE_EXTEND
8 C !INTERFACE:
9 SUBROUTINE THSICE_EXTEND(
10 I bi, bj,
11 I iMin,iMax, jMin,jMax, dBugFlag,
12 I fzMlOc, tFrz, tOce,
13 U icFrac, hIce, hSnow,
14 U tSrf, tIc1, tIc2, qIc1, qIc2,
15 O flx2oc, frw2oc, fsalt,
16 I myTime, myIter, myThid )
17 C !DESCRIPTION: \bv
18 C *==========================================================*
19 C | S/R THSICE_EXTEND
20 C | o Extend sea-ice area incresing ice fraction
21 C *==========================================================*
22 C | o incorporate surplus of energy to
23 C | make new ice or make ice grow laterally
24 C *==========================================================*
25 C \ev
26
27 C !USES:
28 IMPLICIT NONE
29
30 C == Global variables ==
31 #include "EEPARAMS.h"
32 #include "SIZE.h"
33 #include "THSICE_SIZE.h"
34 #include "THSICE_PARAMS.h"
35 #ifdef ALLOW_AUTODIFF_TAMC
36 # include "tamc.h"
37 # include "tamc_keys.h"
38 #endif
39
40 C !INPUT/OUTPUT PARAMETERS:
41 C == Routine Arguments ==
42 C bi,bj :: tile indices
43 C iMin,iMax :: computation domain: 1rst index range
44 C jMin,jMax :: computation domain: 2nd index range
45 C dBugFlag :: allow to print debugging stuff (e.g. on 1 grid point).
46 C--- Input:
47 C iceMask :: sea-ice fractional mask [0-1]
48 C fzMlOc (esurp) :: ocean mixed-layer freezing/melting potential [W/m2]
49 C tFrz (Tf) :: sea-water freezing temperature [oC] (function of S)
50 C tOce :: surface level oceanic temperature [oC]
51 C--- Modified (input&output):
52 C icFrac(iceFrac):: fraction of grid area covered in ice
53 C hIce (iceThick):: ice height [m]
54 C hSnow :: snow height [m]
55 C tSrf :: surface (ice or snow) temperature [oC]
56 C tIc1 :: temperature of ice layer 1 [oC]
57 C tIc2 :: temperature of ice layer 2 [oC]
58 C qIc1 (qicen) :: ice enthalpy (J/kg), 1rst level
59 C qIc2 (qicen) :: ice enthalpy (J/kg), 2nd level
60 C--- Output
61 C flx2oc (=) :: (additional) heat flux to ocean [W/m2] (+=dwn)
62 C frw2oc (=) :: (additional) fresh water flux to ocean [kg/m2/s] (+=dwn)
63 C fsalt (=) :: (additional) salt flux to ocean [g/m2/s] (+=dwn)
64 C--- Input:
65 C myTime :: current Time of simulation [s]
66 C myIter :: current Iteration number in simulation
67 C myThid :: my Thread Id number
68 INTEGER bi,bj
69 INTEGER iMin, iMax
70 INTEGER jMin, jMax
71 LOGICAL dBugFlag
72 c _RL iceMask(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
73 _RL fzMlOc (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
74 _RL tFrz (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
75 _RL tOce (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
76 _RL icFrac (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
77 _RL hIce (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
78 _RL hSnow (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
79 _RL tSrf (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
80 _RL tIc1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
81 _RL tIc2 (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
82 _RL qIc1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
83 _RL qIc2 (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
84 _RL flx2oc (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
85 _RL frw2oc (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
86 _RL fsalt (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
87 _RL myTime
88 INTEGER myIter
89 INTEGER myThid
90 CEOP
91
92 #ifdef ALLOW_THSICE
93 C !LOCAL VARIABLES:
94 C--- local copy of input/output argument list variables (see description above)
95 _RL esurp
96 _RL Tf
97 _RL iceFrac
98 _RL iceThick
99 _RL qicen(nlyr)
100
101 C == Local variables ==
102 C iceVol :: previous ice volume
103 C newIce :: new ice volume to produce
104 C hNewIce :: thickness of new ice to form
105 C iceFormed :: ice-volume formed (new ice volume = iceVol+iceFormed )
106 C qicAv :: mean enthalpy of ice (layer 1 & 2) [J/m^3]
107 _RL deltaTice ! time-step for ice model
108 _RL iceVol
109 _RL newIce
110 _RL hNewIce
111 _RL iceFormed
112 _RL qicAv
113 INTEGER i,j ! loop indices
114
115 C- define grid-point location where to print debugging values
116 #include "THSICE_DEBUG.h"
117
118 1010 FORMAT(A,I3,3F8.3)
119 1020 FORMAT(A,1P4E11.3)
120
121 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
122
123 deltaTice = thSIce_deltaT
124
125 #ifdef ALLOW_AUTODIFF_TAMC
126 DO j = 1-OLy, sNy+OLy
127 DO i = 1-OLx, sNx+OLx
128 flx2oc(i,j) = 0. _d 0
129 frw2oc(i,j) = 0. _d 0
130 fsalt (i,j) = 0. _d 0
131 ENDDO
132 ENDDO
133 #endif /* ALLOW_AUTODIFF_TAMC */
134
135 #ifdef ALLOW_AUTODIFF_TAMC
136 act1 = bi - myBxLo(myThid)
137 max1 = myBxHi(myThid) - myBxLo(myThid) + 1
138 act2 = bj - myByLo(myThid)
139 max2 = myByHi(myThid) - myByLo(myThid) + 1
140 act3 = myThid - 1
141 max3 = nTx*nTy
142 act4 = ikey_dynamics - 1
143 ticekey = (act1 + 1) + act2*max1
144 & + act3*max1*max2
145 & + act4*max1*max2*max3
146 #endif /* ALLOW_AUTODIFF_TAMC */
147
148 #ifdef ALLOW_AUTODIFF_TAMC
149 CADJ STORE hIce(:,:) = comlev1_bibj,key=ticekey,byte=isbyte
150 CADJ STORE hSnow(:,:) = comlev1_bibj,key=ticekey,byte=isbyte
151 CADJ STORE icFrac(:,:) = comlev1_bibj,key=ticekey,byte=isbyte
152 CADJ STORE qIc1(:,:) = comlev1_bibj,key=ticekey,byte=isbyte
153 CADJ STORE qIc2(:,:) = comlev1_bibj,key=ticekey,byte=isbyte
154 #endif
155 DO j = jMin, jMax
156 DO i = iMin, iMax
157 c#ifdef ALLOW_AUTODIFF_TAMC
158 c ikey_1 = i
159 c & + sNx*(j-1)
160 c & + sNx*sNy*act1
161 c & + sNx*sNy*max1*act2
162 c & + sNx*sNy*max1*max2*act3
163 c & + sNx*sNy*max1*max2*max3*act4
164 c#endif /* ALLOW_AUTODIFF_TAMC */
165 c#ifdef ALLOW_AUTODIFF_TAMC
166 cCADJ STORE hice(i,j) = comlev1_thsice_1, key=ikey_1
167 cCADJ STORE hsnow(i,j) = comlev1_thsice_1, key=ikey_1
168 cCADJ STORE icfrac(i,j) = comlev1_thsice_1, key=ikey_1
169 cCADJ STORE qic1(i,j) = comlev1_thsice_1, key=ikey_1
170 cCADJ STORE qic2(i,j) = comlev1_thsice_1, key=ikey_1
171 c#endif
172
173 IF (fzMlOc(i,j).GT.0. _d 0) THEN
174 esurp = fzMlOc(i,j)
175 Tf = tFrz(i,j)
176 iceFrac = icFrac(i,j)
177 iceThick= hIce(i,j)
178 qicen(1)= qIc1(i,j)
179 qicen(2)= qIc2(i,j)
180 C---
181 C-- start ice
182 iceFormed = 0. _d 0
183 iceVol = iceFrac*iceThick
184
185 C- enthalpy of new ice to form :
186 IF ( iceFrac.LE.0. _d 0 ) THEN
187 qicen(1)= -cpWater*Tmlt1
188 & + cpIce *(Tmlt1-Tf) + Lfresh*(1. _d 0-Tmlt1/Tf)
189 qicen(2)= -cpIce *Tf + Lfresh
190 ENDIF
191 qicAv = rhoi*(qicen(1)+qicen(2))*0.5 _d 0
192 newIce = esurp*deltaTice/qicAv
193
194 IF ( icFrac(i,j).EQ.0. _d 0 ) THEN
195 C- to keep identical results (as it use to be):
196 c-old_v IF ( newIce.GE.hThinIce*iceMaskMin ) THEN
197 C- here we allow to form ice earlier (as soon as min-ice-vol is reached)
198 c-new_v:
199 IF ( newIce.GT.hIceMin*iceMaskMin ) THEN
200 C- if there is no ice in grid-cell and enough ice to form:
201 C- make ice over iceMaskMin fraction, up to hThinIce,
202 C and if more ice to form, then increase fraction
203 iceThick = MIN(hThinIce,newIce/iceMaskMin)
204 iceThick = MAX(iceThick,newIce/iceMaskMax)
205 iceFrac = newIce/iceThick
206 iceFormed = newIce
207 ENDIF
208 ELSEIF ( iceVol.LT.hiMax*iceMaskMax ) THEN
209 C- if there is already some ice
210 C create ice with same thickness or hNewIceMax (the smallest of the 2)
211 hNewIce = MIN(iceThick,hNewIceMax)
212 iceFrac = MIN(icFrac(i,j)+newIce/hNewIce,iceMaskMax)
213 C- update thickness: area weighted average
214 c-new_v:
215 iceThick = MIN(hiMax,(iceVol+newIce)/iceFrac)
216 C- to keep identical results: comment the line above and uncomment line below:
217 c-old_v iceFrac = MIN(icFrac(i,j)+newIce/iceThick,iceMaskMax)
218 iceFormed = iceThick*iceFrac - iceVol
219 C- spread snow out over ice
220 hSnow(i,j) = hSnow(i,j)*icFrac(i,j)/iceFrac
221 ENDIF
222 C- oceanic fluxes:
223 flx2oc(i,j)= qicAv*iceFormed/deltaTice
224 frw2oc(i,j)= -rhoi*iceFormed/deltaTice
225 fsalt(i,j)= -(rhoi*saltIce)*iceFormed/deltaTice
226
227 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
228 #ifdef ALLOW_DBUG_THSICE
229 IF ( dBug(i,j,bi,bj) ) THEN
230 WRITE(6,1020) 'ThSI_EXT: iceH, newIce, newIceFrac=',
231 & iceThick, newIce, iceFrac-icFrac(i,j)
232 WRITE(6,1020) 'ThSI_EXT: iceFrac,flx2oc,fsalt,frw2oc=',
233 & iceFrac,flx2oc(i,j),fsalt(i,j),frw2oc(i,j)
234 ENDIF
235 #endif
236 #ifdef CHECK_ENERGY_CONSERV
237 CALL THSICE_CHECK_CONSERV( dBugFlag, i, j, bi, bj, 1,
238 I icFrac(i,j), iceFrac, iceThick, hSnow(i,j), qicen,
239 I flx2oc(i,j), frw2oc(i,j), fsalt(i,j),
240 I myTime, myIter, myThid )
241 #endif /* CHECK_ENERGY_CONSERV */
242 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
243 C-- Update Sea-Ice state output:
244 IF ( iceFrac.GT.0. _d 0 .AND. icFrac(i,j).EQ.0. _d 0) THEN
245 c hSnow(i,j) = 0. _d 0
246 tSrf(i,j) = tFrz(i,j)
247 tIc1(i,j) = tFrz(i,j)
248 tIc2(i,j) = tFrz(i,j)
249 qIc1(i,j) = qicen(1)
250 qIc2(i,j) = qicen(2)
251 ENDIF
252 icFrac(i,j) = iceFrac
253 hIce(i,j) = iceThick
254 ENDIF
255 ENDDO
256 ENDDO
257
258 #endif /* ALLOW_THSICE */
259
260 RETURN
261 END

  ViewVC Help
Powered by ViewVC 1.1.22