1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_aim2sioce.F,v 1.7 2007/04/04 02:00:36 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "AIM_OPTIONS.h" |
5 |
#ifdef ALLOW_THSICE |
6 |
#include "THSICE_OPTIONS.h" |
7 |
#endif |
8 |
|
9 |
CBOP |
10 |
C !ROUTINE: AIM_AIM2SIOCE |
11 |
C !INTERFACE: |
12 |
SUBROUTINE AIM_AIM2SIOCE( |
13 |
I land_frc, siceFrac, |
14 |
O prcAtm, |
15 |
I bi, bj, myTime, myIter, myThid) |
16 |
|
17 |
C !DESCRIPTION: \bv |
18 |
C *==========================================================* |
19 |
C | S/R AIM_AIM2SIOCE |
20 |
C | o Interface between AIM and thSIce pkg or (coupled) ocean |
21 |
C *==========================================================* |
22 |
C | o compute surface fluxes over ocean (ice-free + ice covered) |
23 |
C | for diagnostics, thsice package and (slab, coupled) ocean |
24 |
C *==========================================================* |
25 |
C \ev |
26 |
|
27 |
C !USES: |
28 |
IMPLICIT NONE |
29 |
|
30 |
C == Global variables === |
31 |
C-- size for MITgcm & Physics package : |
32 |
#include "AIM_SIZE.h" |
33 |
|
34 |
#include "EEPARAMS.h" |
35 |
#include "PARAMS.h" |
36 |
#include "FFIELDS.h" |
37 |
|
38 |
C-- Physics package |
39 |
#include "AIM_PARAMS.h" |
40 |
#include "com_physcon.h" |
41 |
#include "com_physvar.h" |
42 |
|
43 |
#ifdef ALLOW_THSICE |
44 |
#include "THSICE_SIZE.h" |
45 |
#include "THSICE_PARAMS.h" |
46 |
#include "THSICE_VARS.h" |
47 |
#endif |
48 |
|
49 |
C updated fields (in commom blocks): |
50 |
C if using thSIce: |
51 |
C Qsw(inp) :: SW radiation through the sea-ice down to the ocean (+=up) |
52 |
C Qsw(out) :: SW radiation down to the ocean (ice-free + ice-covered)(+=up) |
53 |
C Qnet(out) :: Net heat flux out of the ocean (ice-free ocean only)(+=up) |
54 |
C and the Ice-Covered contribution will be added in S/R THSICE_STEP_FWD |
55 |
C EmPmR(out) :: Net fresh water flux out off the ocean (ice-free ocean only) |
56 |
C and the Ice-Covered contribution will be added in S/R THSICE_STEP_FWD |
57 |
C sHeating(in/out) :: air - seaice surface heat flux left to melt the ice |
58 |
C snowPrc(out):: snow precip over sea-ice |
59 |
C icFrwAtm :: Evaporation over sea-ice [kg/m2/s] (>0 if evaporate) |
60 |
C icFlxSW :: net SW heat flux through the ice to the ocean [W/m2] (+=dw) |
61 |
C if not using thSIce: |
62 |
C Qsw(out) :: SW radiation down to the ocean (ice-free + ice-covered)(+=up) |
63 |
C Qnet(out) :: Net heat flux out of the ocean (ice-free + ice-covered)(+=up) |
64 |
C EmPmR(out) :: Net fresh water flux out off the ocean (ice-free + ice-covered) |
65 |
|
66 |
C !INPUT/OUTPUT PARAMETERS: |
67 |
C == Routine arguments == |
68 |
C land_frc :: land fraction [0-1] |
69 |
C siceFrac :: sea-ice fraction (relative to full grid-cell) [0-1] |
70 |
C prcAtm :: total precip from the atmosphere [kg/m2/s] |
71 |
C bi,bj :: Tile indices |
72 |
C myTime :: Current time of simulation ( s ) |
73 |
C myIter :: Current iteration number in simulation |
74 |
C myThid :: My Thread Id number |
75 |
_RS land_frc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
76 |
_RL siceFrac(sNx,sNy) |
77 |
_RL prcAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
78 |
INTEGER bi, bj, myIter, myThid |
79 |
_RL myTime |
80 |
CEOP |
81 |
|
82 |
#ifdef ALLOW_AIM |
83 |
C == Local variables == |
84 |
C i,j,I2 :: loop counters |
85 |
C convPrcEvp :: units conversion factor for Precip & Evap: |
86 |
C :: from AIM units (g/m2/s) to model EmPmR units ( kg/m2/s ) |
87 |
_RL convPrcEvp |
88 |
_RL icFrac, opFrac |
89 |
INTEGER i,j,I2 |
90 |
|
91 |
C-- Initialisation : |
92 |
|
93 |
C-- Atmospheric Physics Fluxes |
94 |
|
95 |
C from g/m2/s to kg/m2/s : |
96 |
convPrcEvp = 1. _d -3 |
97 |
|
98 |
DO j=1,sNy |
99 |
DO i=1,sNx |
100 |
IF ( land_frc(i,j,bi,bj).GE.1. _d 0 ) THEN |
101 |
C- Full Land grid-cell: set all fluxes to zero (this has no effect on the |
102 |
C model integration and just put this to get meaningfull diagnostics) |
103 |
prcAtm(i,j) = 0. _d 0 |
104 |
Qnet(i,j,bi,bj) = 0. _d 0 |
105 |
EmPmR(i,j,bi,bj)= 0. _d 0 |
106 |
Qsw(i,j,bi,bj) = 0. _d 0 |
107 |
ELSE |
108 |
I2 = i+(j-1)*sNx |
109 |
|
110 |
C- Total Precip (no distinction between ice-covered / ice-free fraction): |
111 |
prcAtm(i,j) = ( PRECNV(I2,myThid) |
112 |
& + PRECLS(I2,myThid) ) |
113 |
|
114 |
C- Net surface heat flux over ice-free ocean (+=down) |
115 |
C note: with aim_splitSIOsFx=F, ice-free & ice covered contribution are |
116 |
C already merged together and Qnet is the mean heat flux over the grid box. |
117 |
Qnet(i,j,bi,bj) = |
118 |
& SSR(I2,2,myThid) |
119 |
& - SLR(I2,2,myThid) |
120 |
& - SHF(I2,2,myThid) |
121 |
& - EVAP(I2,2,myThid)*ALHC |
122 |
|
123 |
C- E-P over ice-free ocean [m/s]: (same as above is aim_splitSIOsFx=F) |
124 |
EmPmR(i,j,bi,bj) = ( EVAP(I2,2,myThid) |
125 |
& - prcAtm(i,j) ) * convPrcEvp |
126 |
|
127 |
C- Net short wave (ice-free ocean) into the ocean (+=down) |
128 |
Qsw(i,j,bi,bj) = SSR(I2,2,myThid) |
129 |
|
130 |
ENDIF |
131 |
ENDDO |
132 |
ENDDO |
133 |
|
134 |
#ifdef ALLOW_THSICE |
135 |
IF ( useThSIce ) THEN |
136 |
DO j=1,sNy |
137 |
DO i=1,sNx |
138 |
I2 = i+(j-1)*sNx |
139 |
C- Mixed-Layer Ocean: (for thsice slab_ocean and coupler) |
140 |
C NOTE: masking is now applied much earlier, during initialisation |
141 |
c IF (land_frc(i,j,bi,bj).EQ.1. _d 0) hOceMxL(i,j,bi,bj) = 0. |
142 |
|
143 |
C- Evaporation over sea-ice: (for thsice) |
144 |
icFrwAtm(i,j,bi,bj) = EVAP(I2,3,myThid)*convPrcEvp |
145 |
|
146 |
C- short-wave downward heat flux (ice-free ocean + ice-covered): |
147 |
C note: at this point we already called THSICE_IMPL_TEMP to solve for |
148 |
C seaice temp and SW flux through the ice. SW is not modified after, and |
149 |
C can therefore combine the open-ocean & ice-covered ocean SW fluxes. |
150 |
icFrac = iceMask(i,j,bi,bj) |
151 |
opFrac = 1. _d 0 - icFrac |
152 |
Qsw(i,j,bi,bj) = icFrac*icFlxSW(i,j,bi,bj) |
153 |
& + opFrac*Qsw(i,j,bi,bj) |
154 |
|
155 |
ENDDO |
156 |
ENDDO |
157 |
|
158 |
IF ( aim_energPrecip ) THEN |
159 |
C-- Add energy flux related to Precip. (snow, T_rain) over sea-ice |
160 |
DO j=1,sNy |
161 |
DO i=1,sNx |
162 |
IF ( iceMask(i,j,bi,bj).GT.0. _d 0 ) THEN |
163 |
I2 = i+(j-1)*sNx |
164 |
IF ( EnPrec(I2,myThid).GE.0. _d 0 ) THEN |
165 |
C- positive => add to surface heating |
166 |
sHeating(i,j,bi,bj) = sHeating(i,j,bi,bj) |
167 |
& + EnPrec(I2,myThid)*prcAtm(i,j) |
168 |
snowPrc(i,j,bi,bj) = 0. _d 0 |
169 |
ELSE |
170 |
C- negative => make snow |
171 |
snowPrc(i,j,bi,bj) = prcAtm(i,j)*convPrcEvp |
172 |
ENDIF |
173 |
ELSE |
174 |
snowPrc(i,j,bi,bj) = 0. _d 0 |
175 |
ENDIF |
176 |
ENDDO |
177 |
ENDDO |
178 |
ENDIF |
179 |
|
180 |
ELSEIF ( aim_splitSIOsFx ) THEN |
181 |
#else /* ALLOW_THSICE */ |
182 |
IF ( aim_splitSIOsFx ) THEN |
183 |
#endif /* ALLOW_THSICE */ |
184 |
C- aim_splitSIOsFx=T: fluxes over sea-ice (3) & ice-free ocean (2) were |
185 |
C computed separately and here we merge the 2 fractions |
186 |
DO j=1,sNy |
187 |
DO i=1,sNx |
188 |
I2 = i+(j-1)*sNx |
189 |
IF ( siceFrac(i,j) .GT. 0. ) THEN |
190 |
icFrac = siceFrac(i,j)/(1. _d 0 - land_frc(i,j,bi,bj)) |
191 |
opFrac = 1. _d 0 - icFrac |
192 |
|
193 |
C- Net surface heat flux over sea-ice + ice-free ocean (+=down) |
194 |
Qnet(i,j,bi,bj) = Qnet(i,j,bi,bj)*opFrac |
195 |
& + ( SSR(I2,3,myThid) |
196 |
& - SLR(I2,3,myThid) |
197 |
& - SHF(I2,3,myThid) |
198 |
& - EVAP(I2,3,myThid)*ALHC |
199 |
& )*icFrac |
200 |
C- E-P over sea-ice + ice-free ocean [m/s]: |
201 |
EmPmR(i,j,bi,bj) = EmPmR(i,j,bi,bj)*opFrac |
202 |
& + ( EVAP(I2,3,myThid) |
203 |
& - prcAtm(i,j) ) * convPrcEvp * icFrac |
204 |
|
205 |
C- Net short wave (ice-free ocean) into the ocean (+=down) |
206 |
Qsw(i,j,bi,bj) = opFrac*Qsw(i,j,bi,bj) |
207 |
& + icFrac*SSR(I2,3,myThid) |
208 |
|
209 |
ENDIF |
210 |
ENDDO |
211 |
ENDDO |
212 |
|
213 |
C-- end of If useThSIce / elseif aim_splitSIOsFx blocks |
214 |
ENDIF |
215 |
|
216 |
IF ( aim_energPrecip ) THEN |
217 |
C-- Ice free fraction: Add energy flux related to Precip. (snow, T_rain): |
218 |
DO j=1,sNy |
219 |
DO i=1,sNx |
220 |
I2 = i+(j-1)*sNx |
221 |
Qnet(i,j,bi,bj) = Qnet(i,j,bi,bj) |
222 |
& + EnPrec(I2,myThid)*prcAtm(i,j) |
223 |
ENDDO |
224 |
ENDDO |
225 |
ENDIF |
226 |
|
227 |
DO j=1,sNy |
228 |
DO i=1,sNx |
229 |
C- Total Precip : convert units |
230 |
prcAtm(i,j) = prcAtm(i,j) * convPrcEvp |
231 |
C- Oceanic convention: Heat flux are > 0 upward ; reverse sign. |
232 |
Qsw(i,j,bi,bj) = -Qsw(i,j,bi,bj) |
233 |
Qnet(i,j,bi,bj)= -Qnet(i,j,bi,bj) |
234 |
ENDDO |
235 |
ENDDO |
236 |
|
237 |
#endif /* ALLOW_AIM */ |
238 |
|
239 |
RETURN |
240 |
END |