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

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

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


Revision 1.14 - (show annotations) (download)
Fri May 23 09:56:25 2008 UTC (15 years, 11 months ago) by dimitri
Branch: MAIN
Changes since 1.13: +3 -2 lines
Oops.  I forgot to mask snow.

1 C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_ini_vars.F,v 1.13 2008/05/22 15:54:37 dimitri Exp $
2 C $Name: $
3
4 #include "THSICE_OPTIONS.h"
5 #ifdef ALLOW_AIM
6 # include "AIM_OPTIONS.h"
7 #endif
8
9 CBOP
10 C !ROUTINE: THSICE_INI_VARS
11 C !INTERFACE:
12 SUBROUTINE THSICE_INI_VARS( myThid )
13
14 C !DESCRIPTION: \bv
15 C *==========================================================*
16 C | S/R THSICE_INI_VARS
17 C | o initialize THermo_SeaICE variables
18 C *==========================================================*
19 C \ev
20
21 C !USES:
22 IMPLICIT NONE
23
24 C === Global variables ===
25 #include "SIZE.h"
26 #include "EEPARAMS.h"
27 #include "PARAMS.h"
28 #include "FFIELDS.h"
29 #include "DYNVARS.h"
30 #include "THSICE_PARAMS.h"
31 #include "THSICE_VARS.h"
32 #ifdef ALLOW_AIM
33 # include "AIM_FFIELDS.h"
34 #endif
35
36 C !INPUT/OUTPUT PARAMETERS:
37 C == Routine arguments ==
38 C myThid :: My Thread Id. number
39 INTEGER myThid
40 CEOP
41
42 #ifdef ALLOW_THSICE
43 C == Local variables ==
44 C bi,bj :: Loop counters
45 C i,j :: Loop counters
46 INTEGER bi, bj
47 INTEGER i, j
48 INTEGER prec
49 c CHARACTER*(MAX_LEN_FNAM) fn
50 _RL v2Loc
51
52
53 c set up ice arrays to zero if starting ice
54 DO bj = myByLo(myThid), myByHi(myThid)
55 DO bi = myBxLo(myThid), myBxHi(myThid)
56 C- state variables :
57 DO j=1-OLy,sNy+OLy
58 DO i=1-OLx,sNx+OLx
59 iceMask(i,j,bi,bj) = 0. _d 0
60 iceHeight(i,j,bi,bj)= 0. _d 0
61 snowHeight(i,j,bi,bj)=0. _d 0
62 Tsrf(i,j,bi,bj) = 0. _d 0
63 Tice1(i,j,bi,bj) = 0. _d 0
64 Tice2(i,j,bi,bj) = 0. _d 0
65 Qice1(i,j,bi,bj) = 0. _d 0
66 Qice2(i,j,bi,bj) = 0. _d 0
67 snowAge(i,j,bi,bj) = 0. _d 0
68 ENDDO
69 ENDDO
70 C- fluxes :
71 DO j=1-OLy,sNy+OLy
72 DO i=1-OLx,sNx+OLx
73 sHeating(i,j,bi,bj) = 0. _d 0
74 flxCndBt(i,j,bi,bj) = 0. _d 0
75 snowPrc(i,j,bi,bj) = 0. _d 0
76 siceAlb(i,j,bi,bj) = 0. _d 0
77 icFlxSW (i,j,bi,bj) = 0. _d 0
78 icFlxAtm(i,j,bi,bj) = 0. _d 0
79 icFrwAtm(i,j,bi,bj) = 0. _d 0
80 C- needed when using advection/diffusion:
81 oceFWfx(i,j,bi,bj) = 0. _d 0
82 oceSflx(i,j,bi,bj) = 0. _d 0
83 oceQnet(i,j,bi,bj) = 0. _d 0
84 ENDDO
85 ENDDO
86 C- oceanic mixed layer state :
87 v2Loc = vMxL_default*vMxL_default
88 DO j=1-OLy,sNy+OLy
89 DO i=1-OLx,sNx+OLx
90 hOceMxL(i,j,bi,bj) = hMxL_default
91 tOceMxL(i,j,bi,bj) = 0. _d 0
92 sOceMxL(i,j,bi,bj) = sMxL_default
93 v2ocMxL(i,j,bi,bj) = v2Loc
94 ENDDO
95 ENDDO
96 #ifdef ALLOW_AIM
97 IF ( useAIM ) THEN
98 C- Mask mixed layer depth : depth is used in thsice slab_ocean
99 C and this mask is used in thsice_advdiff and if coupled
100 DO j=1-OLy,sNy+OLy
101 DO i=1-OLx,sNx+OLx
102 IF ( aim_landFr(i,j,bi,bj).EQ.1. _d 0 )
103 & hOceMxL(i,j,bi,bj) = 0.
104 ENDDO
105 ENDDO
106 ENDIF
107 #endif /* ALLOW_AIM */
108 ENDDO
109 ENDDO
110
111 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
112
113 IF ( startIceModel.LE.0 .AND. nIter0.NE.0 ) THEN
114 C-- Read ice pickup fields
115 _BARRIER
116 prec=precFloat64
117 CALL THSICE_READ_PICKUP( prec, nIter0, myThid )
118
119 ELSE
120 C-- Read initial conditions:
121 _BEGIN_MASTER( myThid )
122 IF ( thSIceThick_InitFile .NE. ' ' ) THEN
123 CALL READ_REC_XY_RL(thSIceThick_InitFile,iceHeight,1,0,myThid)
124 ENDIF
125 IF ( thSIceFract_InitFile .NE. ' ' ) THEN
126 CALL READ_REC_XY_RL(thSIceFract_InitFile,iceMask,1,0,myThid)
127 ELSE
128 C default to 100% ice concentration when thickness is non-zero
129 DO bj = myByLo(myThid), myByHi(myThid)
130 DO bi = myBxLo(myThid), myBxHi(myThid)
131 DO j=1-OLy,sNy+OLy
132 DO i=1-OLx,sNx+OLx
133 IF (iceHeight(i,j,bi,bj) .NE. 0. _d 0)
134 & iceMask(i,j,bi,bj) = 1. _d 0
135 ENDDO
136 ENDDO
137 ENDDO
138 ENDDO
139 ENDIF
140 IF ( thSIceSnowH_InitFile .NE. ' ' ) THEN
141 CALL READ_REC_XY_RL(thSIceSnowH_InitFile,snowHeight,1,0,myThid)
142 ELSE
143 C default to <= 20 cm snow thickness where there is ice
144 DO bj = myByLo(myThid), myByHi(myThid)
145 DO bi = myBxLo(myThid), myBxHi(myThid)
146 DO j=1-OLy,sNy+OLy
147 DO i=1-OLx,sNx+OLx
148 IF (iceMask(i,j,bi,bj) .NE. 0. _d 0)
149 & snowHeight(i,j,bi,bj) = 0.2 _d 0
150 ENDDO
151 ENDDO
152 ENDDO
153 ENDDO
154 ENDIF
155 IF ( thSIceSnowA_InitFile .NE. ' ' ) THEN
156 CALL READ_REC_XY_RL(thSIceSnowA_InitFile,snowAge,1,0,myThid)
157 ELSE
158 C default to 3 days for snow age
159 DO bj = myByLo(myThid), myByHi(myThid)
160 DO bi = myBxLo(myThid), myBxHi(myThid)
161 DO j=1-OLy,sNy+OLy
162 DO i=1-OLx,sNx+OLx
163 IF (snowHeight(i,j,bi,bj) .NE. 0. _d 0)
164 & snowAge(i,j,bi,bj) = 259200. _d 0
165 ENDDO
166 ENDDO
167 ENDDO
168 ENDDO
169 ENDIF
170 IF ( thSIceEnthp_InitFile .NE. ' ' ) THEN
171 CALL READ_REC_XY_RL(thSIceEnthp_InitFile,Qice1,1,0,myThid)
172 CALL READ_REC_XY_RL(thSIceEnthp_InitFile,Qice2,2,0,myThid)
173 ELSE
174 C default to 3.4e5 J/kg for enthalpy where there is sea ice
175 DO bj = myByLo(myThid), myByHi(myThid)
176 DO bi = myBxLo(myThid), myBxHi(myThid)
177 DO j=1-OLy,sNy+OLy
178 DO i=1-OLx,sNx+OLx
179 IF (iceMask(i,j,bi,bj) .NE. 0. _d 0) THEN
180 Qice1(i,j,bi,bj) = 3.4 _d 5
181 Qice2(i,j,bi,bj) = 3.4 _d 5
182 ENDIF
183 ENDDO
184 ENDDO
185 ENDDO
186 ENDDO
187 ENDIF
188 IF ( thSIceTsurf_InitFile .NE. ' ' ) THEN
189 CALL READ_REC_XY_RS(thSIceTsurf_InitFile,Tsrf,1,0,myThid)
190 ENDIF
191 _END_MASTER(myThid)
192 ENDIF
193
194 _EXCH_XY_R8(iceMask,myThid)
195 _EXCH_XY_R8(iceHeight, myThid)
196 _EXCH_XY_R8(snowHeight,myThid)
197 _EXCH_XY_R8(Tsrf, myThid)
198 _EXCH_XY_R8(Tice1, myThid)
199 _EXCH_XY_R8(Tice2, myThid)
200 _EXCH_XY_R8(Qice1, myThid)
201 _EXCH_XY_R8(Qice2, myThid)
202 _EXCH_XY_R8(snowAge,myThid)
203
204 C-- Initialise Sea-Ice Loading for SeaIce-Dynamics :
205 IF ( useSEAICE ) THEN
206 DO bj = myByLo(myThid), myByHi(myThid)
207 DO bi = myBxLo(myThid), myBxHi(myThid)
208 DO j=1-OLy,sNy+OLy
209 DO i=1-OLx,sNx+OLx
210 sIceLoad(i,j,bi,bj) = ( snowHeight(i,j,bi,bj)*rhos
211 & + iceHeight(i,j,bi,bj)*rhoi
212 & )*iceMask(i,j,bi,bj)
213 ENDDO
214 ENDDO
215 ENDDO
216 ENDDO
217 ENDIF
218
219 #endif /* ALLOW_THSICE */
220
221 RETURN
222 END

  ViewVC Help
Powered by ViewVC 1.1.22