/[MITgcm]/MITgcm/pkg/aim_v23/aim_surf_bc.F
ViewVC logotype

Contents of /MITgcm/pkg/aim_v23/aim_surf_bc.F

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


Revision 1.9 - (show annotations) (download)
Sun Nov 14 19:54:01 2004 UTC (19 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57g_pre, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint57g_post, checkpoint56b_post, checkpoint57y_post, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint58, checkpoint57, checkpoint56, checkpoint58f_post, checkpoint57n_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58m_post, checkpoint57l_post, checkpoint57t_post, checkpoint57v_post, checkpoint57f_post, checkpoint57a_post, checkpoint57h_pre, checkpoint57h_post, checkpoint57y_pre, checkpoint58o_post, checkpoint57c_post, checkpoint58p_post, checkpoint58e_post, checkpoint57c_pre, checkpoint58n_post, checkpoint57e_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, eckpoint57e_pre, checkpoint58k_post, checkpoint56a_post, checkpoint58l_post, checkpoint57h_done, checkpoint57j_post, checkpoint57f_pre, checkpoint58g_post, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint57a_pre, checkpoint57o_post, checkpoint57k_post, checkpoint57w_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post
Changes since 1.8: +15 -33 lines
read landFraction file much earlier (from initialise_fixed).

1 C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_surf_bc.F,v 1.8 2004/06/24 23:43:11 jmc Exp $
2 C $Name: $
3
4 #include "AIM_OPTIONS.h"
5
6 SUBROUTINE AIM_SURF_BC( tYear, myTime, myIter, bi, bj, myThid )
7 C *================================================================*
8 C | S/R AIM_SURF_BC
9 C | Set surface Boundary Conditions
10 C | for the atmospheric physics package
11 C *================================================================*
12 c | was part of S/R FORDATE in Franco Molteni SPEEDY code (ver23).
13 C | For now, surface BC are loaded from files (S/R AIM_FIELDS_LOAD)
14 C | and imposed (= surf. forcing).
15 C | In the future, will add
16 C | a land model and a coupling interface with an ocean GCM
17 C *================================================================*
18 IMPLICIT NONE
19
20 C -------------- Global variables --------------
21 C-- size for MITgcm & Physics package :
22 #include "AIM_SIZE.h"
23
24 C-- MITgcm
25 #include "EEPARAMS.h"
26 #include "PARAMS.h"
27 c #include "DYNVARS.h"
28 c #include "GRID.h"
29 c #include "SURFACE.h"
30
31 C-- Physics package
32 #include "AIM_PARAMS.h"
33 #include "AIM_FFIELDS.h"
34 c #include "AIM_GRID.h"
35 #include "com_forcon.h"
36 #include "com_forcing.h"
37 c #include "com_physvar.h"
38
39 C-- Coupled to the Ocean :
40 #ifdef COMPONENT_MODULE
41 #include "CPL_PARAMS.h"
42 #include "ATMCPL.h"
43 #endif
44
45 C == Routine arguments ==
46 C tYear - Fraction into year
47 C myTime - Current time of simulation ( s )
48 C myIter - Current iteration number in simulation
49 C bi,bj - Tile index
50 C myThid - Number of this instance of the routine
51 INTEGER myIter, bi, bj, myThid
52 _RL tYear, myTime
53
54 #ifdef ALLOW_AIM
55 C == Local variables ==
56 C i,j,k,I2,k - Loop counters
57 INTEGER i,j,I2,k
58 _RL SDEP1, IDEP2, SDEP2, SWWIL2, RSW, soilw_0, soilw_1
59 _RL RSD, alb_land, oceTfreez
60 c _RL DALB, alb_sea
61
62 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
63 C- Set Land-sea mask (in [0,1]) from aim_landFr to fMask1:
64 DO j=1,sNy
65 DO i=1,sNx
66 I2 = i+(j-1)*sNx
67 fMask1(I2,1,myThid) = aim_landFr(i,j,bi,bj)
68 ENDDO
69 ENDDO
70
71 IF (aim_useFMsurfBC) THEN
72 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
73
74 C-- Compute surface forcing at present time (linear Interp in time)
75 C using F.Molteni surface BC form ; fields needed are:
76 C 1. Sea Surface temperatures (in situ Temp. [K])
77 C 2. Land Surface temperatures (in situ Temp. [K])
78 C 3. Soil moisture (between 0-1)
79 C 4. Snow depth, Sea Ice : used to compute albedo (=> local arrays)
80 C 5. Albedo (between 0-1)
81
82 C- Surface Temperature:
83 DO j=1,sNy
84 DO i=1,sNx
85 I2 = i+(j-1)*sNx
86 sst1(I2,myThid) = aim_sWght0*aim_sst0(i,j,bi,bj)
87 & + aim_sWght1*aim_sst1(i,j,bi,bj)
88 stl1(I2,myThid) = aim_sWght0*aim_lst0(i,j,bi,bj)
89 & + aim_sWght1*aim_lst1(i,j,bi,bj)
90 ENDDO
91 ENDDO
92
93 C- Soil Water availability : (from F.M. INFORC S/R)
94 SDEP1 = 70. _d 0
95 IDEP2 = 3. _d 0
96 SDEP2 = IDEP2*SDEP1
97
98 SWWIL2= SDEP2*SWWIL
99 RSW = 1. _d 0/(SDEP1*SWCAP+SDEP2*(SWCAP-SWWIL))
100
101 DO j=1,sNy
102 DO i=1,sNx
103 I2 = i+(j-1)*sNx
104 soilw_0 = ( aim_sw10(i,j,bi,bj)
105 & +aim_veget(i,j,bi,bj)*
106 & MAX(IDEP2*aim_sw20(i,j,bi,bj)-SWWIL2, 0. _d 0)
107 & )*RSW
108 soilw_1 = ( aim_sw11(i,j,bi,bj)
109 & +aim_veget(i,j,bi,bj)*
110 & MAX(IDEP2*aim_sw21(i,j,bi,bj)-SWWIL2, 0. _d 0)
111 & )*RSW
112 soilw1(I2,myThid) = aim_sWght0*soilw_0
113 & + aim_sWght1*soilw_1
114 soilw1(I2,myThid) = MIN(1. _d 0, soilw1(I2,myThid) )
115 ENDDO
116 ENDDO
117
118 C- Set snow depth & sea-ice fraction :
119 DO j=1,sNy
120 DO i=1,sNx
121 I2 = i+(j-1)*sNx
122 snow1(I2) = aim_sWght0*aim_snw0(i,j,bi,bj)
123 & + aim_sWght1*aim_snw1(i,j,bi,bj)
124 oice1(I2) = aim_sWght0*aim_oic0(i,j,bi,bj)
125 & + aim_sWght1*aim_oic1(i,j,bi,bj)
126 ENDDO
127 ENDDO
128
129 IF (aim_splitSIOsFx) THEN
130 C- Split Ocean and Sea-Ice surf. temp. ; remove ice-fraction < 1 %
131 c oceTfreez = tFreeze - 1.9 _d 0
132 oceTfreez = celsius2K - 1.9 _d 0
133 DO J=1,NGP
134 sti1(J,myThid) = sst1(J,myThid)
135 IF ( oice1(J) .GT. 1. _d -2 ) THEN
136 sst1(J,myThid) = MAX(sst1(J,myThid),oceTfreez)
137 sti1(J,myThid) = sst1(J,myThid)
138 & +(sti1(J,myThid)-sst1(J,myThid))/oice1(J)
139 ELSE
140 oice1(J) = 0. _d 0
141 ENDIF
142 ENDDO
143 ELSE
144 DO J=1,NGP
145 sti1(J,myThid) = sst1(J,myThid)
146 ENDDO
147 ENDIF
148
149 C- Surface Albedo : (from F.M. FORDATE S/R)
150 c_FM DALB=ALBICE-ALBSEA
151 RSD=1. _d 0/SDALB
152 DO j=1,sNy
153 DO i=1,sNx
154 c_FM SNOWC=MIN(1.,RSD*SNOW1(I,J))
155 c_FM ALBL=ALB0(I,J)+MAX(ALBSN-ALB0(I,J),0.0)*SNOWC
156 c_FM ALBS=ALBSEA+DALB*OICE1(I,J)
157 c_FM ALB1(I,J)=FMASK1(I,J)*ALBL+FMASK0(I,J)*ALBS
158 I2 = i+(j-1)*sNx
159 alb_land = aim_albedo(i,j,bi,bj)
160 & + MAX( 0. _d 0, ALBSN-aim_albedo(i,j,bi,bj) )
161 & *MIN( 1. _d 0, RSD*snow1(I2))
162 c alb_sea = ALBSEA + DALB*oice1(I2)
163 c alb1(I2,0,myThid) = alb_sea
164 c & + (alb_land - alb_sea)*fMask1(I2,1,myThid)
165 alb1(I2,1,myThid) = alb_land
166 alb1(I2,2,myThid) = ALBSEA
167 alb1(I2,3,myThid) = ALBICE
168 ENDDO
169 ENDDO
170
171 C-- else aim_useFMsurfBC
172 ELSE
173 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
174
175 C- Set surface forcing fields needed by atmos. physics package
176 C 1. Albedo (between 0-1)
177 C 2. Sea Surface temperatures (in situ Temp. [K])
178 C 3. Land Surface temperatures (in situ Temp. [K])
179 C 4. Soil moisture (between 0-1)
180 C Snow depth, Sea Ice (<- no need for now)
181
182 C Set surface albedo data (in [0,1]) from aim_albedo to alb1 :
183 IF (aim_useMMsurfFc) THEN
184 DO j=1,sNy
185 DO i=1,sNx
186 I2 = i+(j-1)*sNx
187 alb1(I2,1,myThid) = aim_albedo(i,j,bi,bj)
188 alb1(I2,2,myThid) = aim_albedo(i,j,bi,bj)
189 alb1(I2,3,myThid) = aim_albedo(i,j,bi,bj)
190 ENDDO
191 ENDDO
192 ELSE
193 DO j=1,sNy
194 DO i=1,sNx
195 I2 = i+(j-1)*sNx
196 alb1(I2,1,myThid) = 0.
197 alb1(I2,2,myThid) = 0.
198 alb1(I2,3,myThid) = 0.
199 ENDDO
200 ENDDO
201 ENDIF
202 C Set surface temperature data from aim_S/LSurfTemp to sst1 & stl1 :
203 IF (aim_useMMsurfFc) THEN
204 DO j=1,sNy
205 DO i=1,sNx
206 I2 = i+(j-1)*sNx
207 sst1(I2,myThid) = aim_surfTemp(i,j,bi,bj)
208 stl1(I2,myThid) = aim_surfTemp(i,j,bi,bj)
209 sti1(I2,myThid) = aim_surfTemp(i,j,bi,bj)
210 ENDDO
211 ENDDO
212 ELSE
213 DO j=1,sNy
214 DO i=1,sNx
215 I2 = i+(j-1)*sNx
216 sst1(I2,myThid) = 300.
217 stl1(I2,myThid) = 300.
218 sti1(I2,myThid) = 300.
219 ENDDO
220 ENDDO
221 ENDIF
222
223 C- Set soil water availability (in [0,1]) from aim_soilWater to soilw1 :
224 IF (aim_useMMsurfFc) THEN
225 DO j=1,sNy
226 DO i=1,sNx
227 I2 = i+(j-1)*sNx
228 soilw1(I2,myThid) = aim_soilWater(i,j,bi,bj)
229 ENDDO
230 ENDDO
231 ELSE
232 DO j=1,sNy
233 DO i=1,sNx
234 I2 = i+(j-1)*sNx
235 soilw1(I2,myThid) = 0.
236 ENDDO
237 ENDDO
238 ENDIF
239
240 C- Set Snow depth and Sea Ice
241 C (not needed here since albedo is loaded from file)
242 DO j=1,sNy
243 DO i=1,sNx
244 I2 = i+(j-1)*sNx
245 oice1(I2) = 0.
246 snow1(I2) = 0.
247 ENDDO
248 ENDDO
249
250 C-- endif/else aim_useFMsurfBC
251 ENDIF
252
253 #ifdef COMPONENT_MODULE
254 IF ( useCoupler ) THEN
255 C-- take surface data from the ocean component
256 C to replace MxL fields (if use sea-ice) or directly AIM SST
257 CALL ATM_APPLY_IMPORT(
258 I aim_landFr,
259 U sst1(1,mythid), oice1,
260 I myTime, myIter, bi, bj, myThid )
261 ENDIF
262 #endif /* COMPONENT_MODULE */
263
264 #ifdef ALLOW_LAND
265 IF (useLand) THEN
266 C- Use land model output instead of prescribed Temp & moisture
267 CALL AIM_LAND2AIM(
268 I aim_landFr, aim_veget, aim_albedo, snow1,
269 U stl1(1,mythid), soilw1(1,mythid), alb1(1,1,myThid),
270 I myTime, myIter, bi, bj, myThid )
271 ENDIF
272 #endif /* ALLOW_LAND */
273
274 #ifdef ALLOW_THSICE
275 IF (useThSIce) THEN
276 C- Use thermo. sea-ice model output instead of prescribed Temp & albedo
277 CALL AIM_SICE2AIM(
278 I aim_landFr,
279 U sst1(1,mythid), oice1,
280 O sti1(1,mythid), alb1(1,3,myThid),
281 I myTime, myIter, bi, bj, myThid )
282 ENDIF
283 #endif /* ALLOW_THSICE */
284
285 C-- set the sea-ice & open ocean fraction :
286 DO J=1,NGP
287 fMask1(J,3,myThid) =(1. _d 0 - fMask1(J,1,myThid))
288 & *oice1(J)
289 fMask1(J,2,myThid) = 1. _d 0 - fMask1(J,1,myThid)
290 & - fMask1(J,3,myThid)
291 ENDDO
292
293 C-- set the mean albedo :
294 DO J=1,NGP
295 alb1(J,0,myThid) = fMask1(J,1,myThid)*alb1(J,1,myThid)
296 & + fMask1(J,2,myThid)*alb1(J,2,myThid)
297 & + fMask1(J,3,myThid)*alb1(J,3,myThid)
298 ENDDO
299
300 C-- initialize surf. temp. change to zero:
301 DO k=1,3
302 DO J=1,NGP
303 dTsurf(J,k,myThid) = 0.
304 ENDDO
305 ENDDO
306
307 IF (.NOT.aim_splitSIOsFx) THEN
308 DO J=1,NGP
309 fMask1(J,3,myThid) = 0. _d 0
310 fMask1(J,2,myThid) = 1. _d 0 - fMask1(J,1,myThid)
311 ENDDO
312 ENDIF
313
314 #endif /* ALLOW_AIM */
315
316 RETURN
317 END

  ViewVC Help
Powered by ViewVC 1.1.22