6 |
CBOP |
CBOP |
7 |
C !ROUTINE: THSICE_STEP_FWD |
C !ROUTINE: THSICE_STEP_FWD |
8 |
C !INTERFACE: |
C !INTERFACE: |
9 |
SUBROUTINE THSICE_STEP_FWD( |
SUBROUTINE THSICE_STEP_FWD( |
10 |
I bi, bj, iMin, iMax, jMin, jMax, |
I bi, bj, iMin, iMax, jMin, jMax, |
11 |
I prcAtm, |
I prcAtm, |
|
U evpAtm, flxSW, |
|
12 |
I myTime, myIter, myThid ) |
I myTime, myIter, myThid ) |
13 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
14 |
C *==========================================================* |
C *==========================================================* |
15 |
C | S/R THSICE_STEP_FWD |
C | S/R THSICE_STEP_FWD |
16 |
C | o Step Forward Therm-SeaIce model. |
C | o Step Forward Therm-SeaIce model. |
17 |
C *==========================================================* |
C *==========================================================* |
18 |
C \ev |
C \ev |
29 |
#include "THSICE_PARAMS.h" |
#include "THSICE_PARAMS.h" |
30 |
#include "THSICE_VARS.h" |
#include "THSICE_VARS.h" |
31 |
#include "THSICE_TAVE.h" |
#include "THSICE_TAVE.h" |
32 |
|
#include "THSICE_2DYN.h" |
33 |
|
INTEGER siLo, siHi, sjLo, sjHi |
34 |
|
PARAMETER ( siLo = 1-OLx , siHi = sNx+OLx ) |
35 |
|
PARAMETER ( sjLo = 1-OLy , sjHi = sNy+OLy ) |
36 |
|
|
37 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
38 |
C === Routine arguments === |
C === Routine arguments === |
39 |
|
C- input: |
40 |
C bi,bj :: tile indices |
C bi,bj :: tile indices |
41 |
C iMin,iMax :: computation domain: 1rst index range |
C iMin,iMax :: computation domain: 1rst index range |
42 |
C jMin,jMax :: computation domain: 2nd index range |
C jMin,jMax :: computation domain: 2nd index range |
43 |
|
C prcAtm :: total precip from the atmosphere [kg/m2/s] |
44 |
|
C myTime :: current Time of simulation [s] |
45 |
|
C myIter :: current Iteration number in simulation |
46 |
|
C myThid :: my Thread Id number |
47 |
|
C-- Use fluxes hold in commom blocks |
48 |
C- input: |
C- input: |
49 |
C prcAtm :: total precip from the atmosphere [kg/m2/s] |
C icFlxSW :: net short-wave heat flux (+=down) below sea-ice, into ocean |
50 |
C evpAtm :: (Inp) evaporation to the atmosphere [kg/m2/s] (>0 if evaporate) |
C icFlxAtm :: net Atmospheric surf. heat flux over sea-ice [W/m2], (+=down) |
51 |
C flxSW :: (Inp) short-wave heat flux (+=down): downward comp. only |
C icFrwAtm :: evaporation over sea-ice to the atmosphere [kg/m2/s] (+=up) |
|
C (part.1), becomes net SW flux into ocean (part.2). |
|
52 |
C- output |
C- output |
53 |
C evpAtm :: (Out) net fresh-water flux (E-P) from the atmosphere [m/s] (+=up) |
C icFlxAtm :: net Atmospheric surf. heat flux over ice+ocean [W/m2], (+=down) |
54 |
C flxSW :: (Out) net surf. heat flux from the atmosphere [W/m2], (+=down) |
C icFrwAtm :: net fresh-water flux (E-P) from the atmosphere [m/s] (+=up) |
|
C myTime :: time counter for this thread |
|
|
C myIter :: iteration counter for this thread |
|
|
C myThid :: thread number for this instance of the routine. |
|
55 |
INTEGER bi,bj |
INTEGER bi,bj |
56 |
INTEGER iMin, iMax |
INTEGER iMin, iMax |
57 |
INTEGER jMin, jMax |
INTEGER jMin, jMax |
58 |
_RL prcAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL prcAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RL evpAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
|
_RL flxSW (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
59 |
_RL myTime |
_RL myTime |
60 |
INTEGER myIter |
INTEGER myIter |
61 |
INTEGER myThid |
INTEGER myThid |
64 |
#ifdef ALLOW_THSICE |
#ifdef ALLOW_THSICE |
65 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
66 |
C === Local variables === |
C === Local variables === |
67 |
C snowPr :: snow precipitation [kg/m2/s] |
C iceFrac :: fraction of grid area covered in ice |
|
C agingTime :: aging time scale (s) |
|
|
C ageFac :: snow aging factor [1] |
|
|
C albedo :: surface albedo [0-1] |
|
|
C flxAtm :: net heat flux from the atmosphere (+=down) [W/m2] |
|
|
C frwAtm :: net fresh-water flux (E-P) to the atmosphere [kg/m2/s] |
|
|
C Fbot :: the oceanic heat flux already incorporated (ice_therm) |
|
68 |
C flx2oc :: net heat flux from the ice to the ocean (+=down) [W/m2] |
C flx2oc :: net heat flux from the ice to the ocean (+=down) [W/m2] |
69 |
C frw2oc :: fresh-water flux from the ice to the ocean |
C frw2oc :: fresh-water flux from the ice to the ocean |
70 |
C fsalt :: mass salt flux to the ocean |
C fsalt :: mass salt flux to the ocean |
71 |
C frzmltMxL :: ocean mixed-layer freezing/melting potential [W/m2] |
C frzmltMxL :: ocean mixed-layer freezing/melting potential [W/m2] |
72 |
C TFrzOce :: sea-water freezing temperature [oC] (function of S) |
C tFrzOce :: sea-water freezing temperature [oC] (function of S) |
73 |
INTEGER i,j |
C isIceFree :: true for ice-free grid-cell that remains ice-free |
74 |
_RL snowPr |
C ageFac :: snow aging factor [1] |
75 |
_RL agingTime, ageFac |
C snowFac :: snowing refreshing-age factor [units of 1/snowPr] |
76 |
_RL albedo |
LOGICAL isIceFree(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
77 |
_RL flxAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL iceFrac (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
78 |
_RL frwAtm |
_RL flx2oc (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
79 |
_RL flx2oc |
_RL frw2oc (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
80 |
_RL frw2oc |
_RL fsalt (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
81 |
_RL fsalt |
_RL tFrzOce (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
82 |
_RL TFrzOce, cphm, frzmltMxL |
_RL frzmltMxL(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
83 |
_RL Fbot, esurp |
_RL ageFac |
84 |
|
_RL snowFac |
85 |
|
_RL cphm |
86 |
_RL opFrac, icFrac |
_RL opFrac, icFrac |
87 |
_RL oceV2s, oceTs |
#ifdef ALLOW_DIAGNOSTICS |
88 |
_RL compact, hIce, hSnow, Tsf, Tice(nlyr), qicen(nlyr) |
_RL tmpFac |
89 |
_RL tmpflx(0:2), tmpdTs |
#endif |
90 |
|
INTEGER i,j |
91 |
LOGICAL dBug |
LOGICAL dBugFlag |
|
|
|
|
1010 FORMAT(A,1P4E11.3) |
|
|
dBug = .FALSE. |
|
|
C- Initialise flxAtm |
|
|
DO j = 1-Oly, sNy+Oly |
|
|
DO i = 1-Olx, sNx+Olx |
|
|
flxAtm(i,j) = 0. |
|
|
ENDDO |
|
|
ENDDO |
|
92 |
|
|
93 |
IF ( buoyancyRelation(1:7) .EQ. 'OCEANIC' ) THEN |
C- define grid-point location where to print debugging values |
94 |
DO j = jMin, jMax |
#include "THSICE_DEBUG.h" |
95 |
DO i = iMin, iMax |
|
96 |
c dBug = ( bi.EQ.3 .AND. i.EQ.15 .AND. j.EQ.11 ) |
1010 FORMAT(A,1P4E14.6) |
97 |
|
|
98 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
C part.1 : ice-covered fraction ; |
|
|
C Solve for surface and ice temperature (implicitly) ; compute surf. fluxes |
|
|
C------- |
|
|
IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN |
|
|
icFrac = iceMask(i,j,bi,bj) |
|
|
TFrzOce = -mu_Tf*sOceMxL(i,j,bi,bj) |
|
|
hIce = iceHeight(i,j,bi,bj) |
|
|
hSnow = snowHeight(i,j,bi,bj) |
|
|
Tsf = Tsrf(i,j,bi,bj) |
|
|
qicen(1)= Qice1(i,j,bi,bj) |
|
|
qicen(2)= Qice2(i,j,bi,bj) |
|
|
IF ( dBug ) THEN |
|
|
WRITE(6,'(A,2I4,2I2)') 'ThSI_FWD: i,j=',i,j,bi,bj |
|
|
WRITE(6,1010) 'ThSI_FWD:-0- iceMask, hIc, hSn, Tsf =', |
|
|
& icFrac, hIce,hSnow,Tsf |
|
|
ENDIF |
|
|
|
|
|
CALL THSICE_ALBEDO( |
|
|
I hIce, hSnow, Tsf, snowAge(i,j,bi,bj), |
|
|
O albedo, |
|
|
I myThid ) |
|
|
flxSW(i,j) = flxSW(i,j)*(1. _d 0 - albedo) |
|
|
|
|
|
CALL THSICE_SOLVE4TEMP( |
|
|
I useBulkforce, tmpflx, TFrzOce, hIce, hSnow, |
|
|
U flxSW(i,j), Tsf, qicen, |
|
|
O Tice, sHeating(i,j,bi,bj), flxCndBt(i,j,bi,bj), |
|
|
O tmpdTs, flxAtm(i,j), evpAtm(i,j), |
|
|
I i,j, bi,bj, myThid) |
|
99 |
|
|
100 |
#ifdef SHORTWAVE_HEATING |
C- Initialise |
101 |
C-- Update Fluxes : |
dBugFlag = debugLevel.GE.debLevB |
102 |
opFrac= 1. _d 0-icFrac |
DO j = 1-OLy, sNy+OLy |
103 |
Qsw(i,j,bi,bj)=-icFrac*flxSW(i,j) +opFrac*Qsw(i,j,bi,bj) |
DO i = 1-OLx, sNx+OLx |
104 |
|
isIceFree(i,j) = .FALSE. |
105 |
|
saltFlux(i,j,bi,bj) = 0. _d 0 |
106 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
107 |
|
iceFrac(i,j) = 0. |
108 |
#endif |
#endif |
|
C-- Update Sea-Ice state : |
|
|
Tsrf(i,j,bi,bj) =Tsf |
|
|
Tice1(i,j,bi,bj)=Tice(1) |
|
|
Tice2(i,j,bi,bj)=Tice(2) |
|
|
Qice1(i,j,bi,bj)=qicen(1) |
|
|
Qice2(i,j,bi,bj)=qicen(2) |
|
|
#ifdef ALLOW_TIMEAVE |
|
|
ice_albedo_Ave(i,j,bi,bj) = ice_albedo_Ave(i,j,bi,bj) |
|
|
& + icFrac*albedo*thSIce_deltaT |
|
|
#endif /*ALLOW_TIMEAVE*/ |
|
|
IF ( dBug ) THEN |
|
|
WRITE(6,1010) 'ThSI_FWD: Tsf, Tice(1,2), frzmltMxL =', |
|
|
& Tsf, Tice, frzmltMxL |
|
|
WRITE(6,1010) 'ThSI_FWD: sHeat,fxCndBt, fxAtm,evAtm=', |
|
|
& sHeating(i,j,bi,bj), flxCndBt(i,j,bi,bj), |
|
|
& flxAtm(i,j), evpAtm(i,j) |
|
|
ENDIF |
|
|
ENDIF |
|
109 |
ENDDO |
ENDDO |
110 |
|
ENDDO |
111 |
|
|
112 |
|
ageFac = 1. _d 0 - thSIce_deltaT/snowAgTime |
113 |
|
snowFac = thSIce_deltaT/(rhos*hNewSnowAge) |
114 |
|
DO j = jMin, jMax |
115 |
|
DO i = iMin, iMax |
116 |
|
IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN |
117 |
|
C-- Snow aging : |
118 |
|
snowAge(i,j,bi,bj) = thSIce_deltaT |
119 |
|
& + snowAge(i,j,bi,bj)*ageFac |
120 |
|
IF ( snowPrc(i,j,bi,bj).GT.0. _d 0 ) |
121 |
|
& snowAge(i,j,bi,bj) = snowAge(i,j,bi,bj) |
122 |
|
& * EXP( - snowFac*snowPrc(i,j,bi,bj) ) |
123 |
|
c & * EXP( -(thSIce_deltaT*snowPrc(i,j,bi,bj)/rhos) |
124 |
|
c & /hNewSnowAge ) |
125 |
|
C------- |
126 |
|
C note: Any flux of mass (here fresh water) that enter or leave the system |
127 |
|
C with a non zero energy HAS TO be counted: add snow precip. |
128 |
|
icFlxAtm(i,j,bi,bj) = icFlxAtm(i,j,bi,bj) |
129 |
|
& - Lfresh*snowPrc(i,j,bi,bj) |
130 |
|
C-- |
131 |
|
ENDIF |
132 |
ENDDO |
ENDDO |
133 |
|
ENDDO |
134 |
|
|
135 |
|
#ifdef ALLOW_DIAGNOSTICS |
136 |
|
IF ( useDiagnostics ) THEN |
137 |
|
tmpFac = 1. _d 0 |
138 |
|
CALL DIAGNOSTICS_FRACT_FILL( |
139 |
|
I snowPrc, iceMask,tmpFac,1,'SIsnwPrc', |
140 |
|
I 0,1,1,bi,bj,myThid) |
141 |
|
CALL DIAGNOSTICS_FRACT_FILL( |
142 |
|
I siceAlb, iceMask,tmpFac,1,'SIalbedo', |
143 |
|
I 0,1,1,bi,bj,myThid) |
144 |
ENDIF |
ENDIF |
145 |
dBug = .FALSE. |
#endif /* ALLOW_DIAGNOSTICS */ |
146 |
|
DO j = jMin, jMax |
147 |
|
DO i = iMin, iMax |
148 |
|
siceAlb(i,j,bi,bj) = iceMask(i,j,bi,bj)*siceAlb(i,j,bi,bj) |
149 |
|
ENDDO |
150 |
|
ENDDO |
151 |
|
|
152 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
153 |
C part.2 : ice-covered fraction ; |
C part.2 : ice-covered fraction ; |
154 |
C change in ice/snow thickness and ice-fraction |
C change in ice/snow thickness and ice-fraction |
155 |
C note: can only reduce the ice-fraction but not increase it. |
C note: can only reduce the ice-fraction but not increase it. |
156 |
C------- |
C------- |
|
agingTime = 50. _d 0 * 86400. _d 0 |
|
|
ageFac = 1. _d 0 - thSIce_deltaT/agingTime |
|
157 |
DO j = jMin, jMax |
DO j = jMin, jMax |
158 |
DO i = iMin, iMax |
DO i = iMin, iMax |
|
c dBug = ( bi.EQ.3 .AND. i.EQ.15 .AND. j.EQ.11 ) |
|
159 |
|
|
160 |
TFrzOce = -mu_Tf*sOceMxL(i,j,bi,bj) |
tFrzOce(i,j) = -mu_Tf*sOceMxL(i,j,bi,bj) |
|
oceTs = tOceMxL(i,j,bi,bj) |
|
161 |
cphm = cpwater*rhosw*hOceMxL(i,j,bi,bj) |
cphm = cpwater*rhosw*hOceMxL(i,j,bi,bj) |
162 |
frzmltMxL = (TFrzOce-oceTs)*cphm/ocean_deltaT |
frzmltMxL(i,j) = ( tFrzOce(i,j)-tOceMxL(i,j,bi,bj) ) |
163 |
|
& * cphm/ocean_deltaT |
164 |
Fbot = 0. _d 0 |
iceFrac(i,j) = iceMask(i,j,bi,bj) |
165 |
saltFlux(i,j,bi,bj) = 0. _d 0 |
flx2oc(i,j) = icFlxSW(i,j,bi,bj) |
|
compact= iceMask(i,j,bi,bj) |
|
166 |
C------- |
C------- |
167 |
IF (dBug .AND. (frzmltMxL.GT.0. .OR. compact.GT.0.) ) THEN |
#ifdef ALLOW_DBUG_THSICE |
168 |
|
IF ( dBug(i,j,bi,bj) ) THEN |
169 |
|
IF (frzmltMxL(i,j).GT.0. .OR. iceFrac(i,j).GT.0.) THEN |
170 |
WRITE(6,'(A,2I4,2I2)') 'ThSI_FWD: i,j=',i,j,bi,bj |
WRITE(6,'(A,2I4,2I2)') 'ThSI_FWD: i,j=',i,j,bi,bj |
171 |
WRITE(6,1010) 'ThSI_FWD:-1- iceMask, hIc, hSn, Tsf =', |
WRITE(6,1010) 'ThSI_FWD:-1- iceMask, hIc, hSn, Tsf =', |
172 |
& compact, iceHeight(i,j,bi,bj), |
& iceFrac(i,j), iceHeight(i,j,bi,bj), |
173 |
& snowHeight(i,j,bi,bj), Qnet(i,j,bi,bj) |
& snowHeight(i,j,bi,bj), Tsrf(i,j,bi,bj) |
174 |
WRITE(6,1010) 'ThSI_FWD: ocTs, TFrzOce, frzmltMxL =', |
WRITE(6,1010) 'ThSI_FWD: ocTs,tFrzOce,frzmltMxL,Qnet=', |
175 |
& oceTs, TFrzOce, frzmltMxL |
& tOceMxL(i,j,bi,bj), tFrzOce(i,j), |
176 |
|
& frzmltMxL(i,j), Qnet(i,j,bi,bj) |
177 |
|
ENDIF |
178 |
|
IF (iceFrac(i,j).GT.0.) |
179 |
|
& WRITE(6,1010) 'ThSI_FWD: icFrac,flxAtm,evpAtm,flxSnw=', |
180 |
|
& iceFrac(i,j), icFlxAtm(i,j,bi,bj), |
181 |
|
& icFrwAtm(i,j,bi,bj),-Lfresh*snowPrc(i,j,bi,bj) |
182 |
ENDIF |
ENDIF |
183 |
C------- |
#endif |
184 |
IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN |
ENDDO |
185 |
|
ENDDO |
|
oceV2s = v2ocMxL(i,j,bi,bj) |
|
|
snowPr = snowPrc(i,j,bi,bj) |
|
|
hIce = iceHeight(i,j,bi,bj) |
|
|
hSnow = snowHeight(i,j,bi,bj) |
|
|
Tsf = Tsrf(i,j,bi,bj) |
|
|
qicen(1)= Qice1(i,j,bi,bj) |
|
|
qicen(2)= Qice2(i,j,bi,bj) |
|
|
flx2oc = flxSW(i,j) |
|
|
|
|
|
CALL THSICE_CALC_THICKN( |
|
|
I frzmltMxL, TFrzOce, oceTs, oceV2s, snowPr, |
|
|
I sHeating(i,j,bi,bj), flxCndBt(i,j,bi,bj), evpAtm(i,j), |
|
|
U compact, hIce, hSnow, Tsf, qicen, flx2oc, |
|
|
O frw2oc, fsalt, Fbot, |
|
|
I dBug, myThid) |
|
|
|
|
|
C- note : snowPr was not supposed to be modified in THSICE_THERM ; |
|
|
C but to reproduce old results, is reset to zero if Tsf >= 0 |
|
|
snowPrc(i,j,bi,bj) = snowPr |
|
|
|
|
|
C-- Snow aging : |
|
|
snowAge(i,j,bi,bj) = thSIce_deltaT |
|
|
& + snowAge(i,j,bi,bj)*ageFac |
|
|
IF ( snowPr.GT.0. _d 0 ) |
|
|
& snowAge(i,j,bi,bj) = snowAge(i,j,bi,bj) |
|
|
& * EXP( -(thSIce_deltaT*snowPr/rhos)/hNewSnowAge ) |
|
|
C-- |
|
|
|
|
|
C-- Diagnostic of Atmospheric Fluxes over sea-ice : |
|
|
frwAtm = evpAtm(i,j) - prcAtm(i,j) |
|
|
C note: Any flux of mass (here fresh water) that enter or leave the system |
|
|
C with a non zero energy HAS TO be counted: add snow precip. |
|
|
flxAtm(i,j) = flxAtm(i,j) - Lfresh*snowPrc(i,j,bi,bj) |
|
|
|
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
|
IF (dBug) WRITE(6,1010) 'ThSI_FWD: icFrac,flxAtm,evpAtm,flxSnw=', |
|
|
& iceMask(i,j,bi,bj),flxAtm(i,j),evpAtm(i,j),-Lfresh*snowPr |
|
|
IF (dBug) WRITE(6,1010) 'ThSI_FWD: compact,flx2oc,fsalt,frw2oc=', |
|
|
& compact,flx2oc,fsalt,frw2oc |
|
|
#ifdef CHECK_ENERGY_CONSERV |
|
|
icFrac = iceMask(i,j,bi,bj) |
|
|
CALL THSICE_CHECK_CONSERV( dBug, i, j, bi, bj, 0, |
|
|
I icFrac, compact, hIce, hSnow, qicen, |
|
|
I flx2oc, frw2oc, fsalt, flxAtm(i,j), frwAtm, |
|
|
I myTime, myIter, myThid ) |
|
|
#endif /* CHECK_ENERGY_CONSERV */ |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
186 |
|
|
187 |
C-- Update Sea-Ice state : |
CALL THSICE_CALC_THICKN( |
188 |
c iceMask(i,j,bi,bj)=compact |
I bi, bj, siLo, siHi, sjLo, sjHi, |
189 |
iceHeight(i,j,bi,bj) = hIce |
I iMin,iMax, jMin,jMax, dBugFlag, |
190 |
snowHeight(i,j,bi,bj)= hSnow |
I iceMask(siLo,sjLo,bi,bj), tFrzOce, |
191 |
Tsrf(i,j,bi,bj) =Tsf |
I tOceMxL(siLo,sjLo,bi,bj), v2ocMxL(siLo,sjLo,bi,bj), |
192 |
Qice1(i,j,bi,bj)=qicen(1) |
I snowPrc(siLo,sjLo,bi,bj), prcAtm, |
193 |
Qice2(i,j,bi,bj)=qicen(2) |
I sHeating(siLo,sjLo,bi,bj), flxCndBt(siLo,sjLo,bi,bj), |
194 |
|
U iceFrac, iceHeight(siLo,sjLo,bi,bj), |
195 |
|
U snowHeight(siLo,sjLo,bi,bj), Tsrf(siLo,sjLo,bi,bj), |
196 |
|
U Qice1(siLo,sjLo,bi,bj), Qice2(siLo,sjLo,bi,bj), |
197 |
|
U icFrwAtm(siLo,sjLo,bi,bj), frzmltMxL, flx2oc, |
198 |
|
O frw2oc, fsalt, |
199 |
|
I myTime, myIter, myThid ) |
200 |
|
|
201 |
C-- Net fluxes : |
C-- Net fluxes : |
202 |
frw2oc = frw2oc + (prcAtm(i,j)-snowPrc(i,j,bi,bj)) |
DO j = jMin, jMax |
203 |
|
DO i = iMin, iMax |
204 |
|
IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN |
205 |
C- weighted average net fluxes: |
C- weighted average net fluxes: |
206 |
icFrac = iceMask(i,j,bi,bj) |
icFrac = iceMask(i,j,bi,bj) |
207 |
opFrac= 1. _d 0-icFrac |
opFrac= 1. _d 0-icFrac |
208 |
flxAtm(i,j) = icFrac*flxAtm(i,j) - opFrac*Qnet(i,j,bi,bj) |
icFlxAtm(i,j,bi,bj) = icFrac*icFlxAtm(i,j,bi,bj) |
209 |
frwAtm = icFrac*frwAtm + opFrac*rhofw*EmPmR(i,j,bi,bj) |
& - opFrac*Qnet(i,j,bi,bj) |
210 |
Qnet(i,j,bi,bj)=-icFrac*flx2oc +opFrac*Qnet(i,j,bi,bj) |
icFrwAtm(i,j,bi,bj) = icFrac*icFrwAtm(i,j,bi,bj) |
211 |
EmPmR(i,j,bi,bj)=-icFrac*frw2oc/rhofw+opFrac*EmPmR(i,j,bi,bj) |
& + opFrac*rhofw*EmPmR(i,j,bi,bj) |
212 |
saltFlux(i,j,bi,bj)=-icFrac*fsalt |
Qnet(i,j,bi,bj) = -icFrac*flx2oc(i,j) + opFrac*Qnet(i,j,bi,bj) |
213 |
|
EmPmR(i,j,bi,bj)= -icFrac*frw2oc(i,j)/rhofw |
214 |
IF (dBug) WRITE(6,1010) |
& + opFrac*EmPmR(i,j,bi,bj) |
215 |
& 'ThSI_FWD:-3- compact, hIc, hSn, Qnet =', |
saltFlux(i,j,bi,bj) = -icFrac*fsalt(i,j) |
216 |
& compact,hIce,hSnow,Qnet(i,j,bi,bj) |
|
217 |
|
#ifdef ALLOW_DBUG_THSICE |
218 |
|
IF (dBug(i,j,bi,bj)) WRITE(6,1010) |
219 |
|
& 'ThSI_FWD:-3- iceFrac, hIc, hSn, Qnet =', |
220 |
|
& iceFrac(i,j), iceHeight(i,j,bi,bj), |
221 |
|
& snowHeight(i,j,bi,bj), Qnet(i,j,bi,bj) |
222 |
|
#endif |
223 |
|
|
224 |
ELSEIF (hOceMxL(i,j,bi,bj).gt.0. _d 0) THEN |
ELSEIF (hOceMxL(i,j,bi,bj).gt.0. _d 0) THEN |
225 |
flxAtm(i,j) = -Qnet(i,j,bi,bj) |
icFlxAtm(i,j,bi,bj) = -Qnet(i,j,bi,bj) |
226 |
frwAtm = rhofw*EmPmR(i,j,bi,bj) |
icFrwAtm(i,j,bi,bj) = rhofw*EmPmR(i,j,bi,bj) |
227 |
ELSE |
ELSE |
228 |
flxAtm(i,j) = 0. _d 0 |
icFlxAtm(i,j,bi,bj) = 0. _d 0 |
229 |
frwAtm = 0. _d 0 |
icFrwAtm(i,j,bi,bj) = 0. _d 0 |
230 |
ENDIF |
ENDIF |
231 |
|
ENDDO |
232 |
|
ENDDO |
233 |
|
|
234 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
235 |
C part.3 : freezing of sea-water |
C part.3 : freezing of sea-water |
236 |
C over ice-free fraction and what is left from ice-covered fraction |
C over ice-free fraction and what is left from ice-covered fraction |
237 |
C------- |
C------- |
238 |
c compact= iceMask(i,j,bi,bj) |
CALL THSICE_EXTEND( |
239 |
hIce = iceHeight(i,j,bi,bj) |
I bi, bj, siLo, siHi, sjLo, sjHi, |
240 |
hSnow = snowHeight(i,j,bi,bj) |
I iMin,iMax, jMin,jMax, dBugFlag, |
241 |
|
I frzmltMxL, tFrzOce, |
242 |
esurp = frzmltMxL - Fbot*iceMask(i,j,bi,bj) |
I tOceMxL(siLo,sjLo,bi,bj), |
243 |
IF (esurp.GT.0. _d 0) THEN |
U iceFrac, iceHeight(siLo,sjLo,bi,bj), |
244 |
icFrac = compact |
U snowHeight(siLo,sjLo,bi,bj), Tsrf(siLo,sjLo,bi,bj), |
245 |
qicen(1)= Qice1(i,j,bi,bj) |
U Tice1(siLo,sjLo,bi,bj), Tice2(siLo,sjLo,bi,bj), |
246 |
qicen(2)= Qice2(i,j,bi,bj) |
U Qice1(siLo,sjLo,bi,bj), Qice2(siLo,sjLo,bi,bj), |
247 |
CALL THSICE_EXTEND( |
O flx2oc, frw2oc, fsalt, |
248 |
I esurp, TFrzOce, |
I myTime, myIter, myThid ) |
249 |
U oceTs, compact, hIce, hSnow, qicen, |
|
250 |
O flx2oc, frw2oc, fsalt, |
DO j = jMin, jMax |
251 |
I dBug, myThid ) |
DO i = iMin, iMax |
252 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
IF (frzmltMxL(i,j).GT.0. _d 0) THEN |
|
IF (dBug) WRITE(6,1010) 'ThSI_FWD: compact,flx2oc,fsalt,frw2oc=' |
|
|
& ,compact,flx2oc,fsalt,frw2oc |
|
|
#ifdef CHECK_ENERGY_CONSERV |
|
|
tmpflx(1) = 0. |
|
|
tmpflx(2) = 0. |
|
|
CALL THSICE_CHECK_CONSERV( dBug, i, j, bi, bj, 1, |
|
|
I icFrac, compact, hIce, hSnow, qicen, |
|
|
I flx2oc, frw2oc, fsalt, tmpflx(1), tmpflx(2), |
|
|
I myTime, myIter, myThid ) |
|
|
#endif /* CHECK_ENERGY_CONSERV */ |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
|
C-- Update Sea-Ice state : |
|
|
IF ( compact.GT.0. _d 0 .AND. icFrac.EQ.0. _d 0) THEN |
|
|
Tsrf(i,j,bi,bj) = TFrzOce |
|
|
Tice1(i,j,bi,bj) = TFrzOce |
|
|
Tice2(i,j,bi,bj) = TFrzOce |
|
|
Qice1(i,j,bi,bj) = qicen(1) |
|
|
Qice2(i,j,bi,bj) = qicen(2) |
|
|
ENDIF |
|
|
iceHeight(i,j,bi,bj) = hIce |
|
|
snowHeight(i,j,bi,bj)= hSnow |
|
253 |
C-- Net fluxes : |
C-- Net fluxes : |
254 |
Qnet(i,j,bi,bj) = Qnet(i,j,bi,bj) - flx2oc |
Qnet(i,j,bi,bj) = Qnet(i,j,bi,bj) - flx2oc(i,j) |
255 |
EmPmR(i,j,bi,bj)= EmPmR(i,j,bi,bj)- frw2oc/rhofw |
EmPmR(i,j,bi,bj)= EmPmR(i,j,bi,bj)- frw2oc(i,j)/rhofw |
256 |
saltFlux(i,j,bi,bj)=saltFlux(i,j,bi,bj) - fsalt |
saltFlux(i,j,bi,bj)=saltFlux(i,j,bi,bj) - fsalt(i,j) |
257 |
|
|
258 |
IF (dBug) WRITE(6,1010) |
#ifdef ALLOW_DBUG_THSICE |
259 |
& 'ThSI_FWD:-4- compact, hIc, hSn, Qnet =', |
IF (dBug(i,j,bi,bj)) WRITE(6,1010) |
260 |
& compact,hIce,hSnow,Qnet(i,j,bi,bj) |
& 'ThSI_FWD:-4- iceFrac, hIc, hSn, Qnet =', |
261 |
C-- - if esurp > 0 : end |
& iceFrac(i,j), iceHeight(i,j,bi,bj), |
262 |
|
& snowHeight(i,j,bi,bj), Qnet(i,j,bi,bj) |
263 |
|
#endif |
264 |
ENDIF |
ENDIF |
265 |
|
|
266 |
IF ( compact .GT. 0. _d 0 ) THEN |
IF ( hOceMxL(i,j,bi,bj).GT.0. _d 0 ) |
267 |
iceMask(i,j,bi,bj)=compact |
& isIceFree(i,j) = iceMask(i,j,bi,bj).LE.0. _d 0 |
268 |
IF ( hSnow .EQ. 0. _d 0 ) snowAge(i,j,bi,bj) = 0. _d 0 |
& .AND. iceFrac(i,j) .LE.0. _d 0 |
269 |
|
IF ( iceFrac(i,j) .GT. 0. _d 0 ) THEN |
270 |
|
iceMask(i,j,bi,bj)=iceFrac(i,j) |
271 |
|
IF ( snowHeight(i,j,bi,bj).EQ.0. _d 0 ) |
272 |
|
& snowAge(i,j,bi,bj) = 0. _d 0 |
273 |
ELSE |
ELSE |
274 |
iceMask(i,j,bi,bj) = 0. _d 0 |
iceMask(i,j,bi,bj) = 0. _d 0 |
275 |
iceHeight(i,j,bi,bj)= 0. _d 0 |
iceHeight(i,j,bi,bj)= 0. _d 0 |
276 |
snowHeight(i,j,bi,bj)=0. _d 0 |
snowHeight(i,j,bi,bj)=0. _d 0 |
277 |
snowAge(i,j,bi,bj) = 0. _d 0 |
snowAge(i,j,bi,bj) = 0. _d 0 |
278 |
Tsrf(i,j,bi,bj) = oceTs |
Tsrf(i,j,bi,bj) = tOceMxL(i,j,bi,bj) |
279 |
Tice1(i,j,bi,bj) = 0. _d 0 |
Tice1(i,j,bi,bj) = 0. _d 0 |
280 |
Tice2(i,j,bi,bj) = 0. _d 0 |
Tice2(i,j,bi,bj) = 0. _d 0 |
281 |
Qice1(i,j,bi,bj) = 0. _d 0 |
Qice1(i,j,bi,bj) = 0. _d 0 |
282 |
Qice2(i,j,bi,bj) = 0. _d 0 |
Qice2(i,j,bi,bj) = 0. _d 0 |
283 |
ENDIF |
ENDIF |
284 |
|
|
|
C-- Return atmospheric fluxes in evpAtm & flxSW (same sign and units): |
|
|
evpAtm(i,j) = frwAtm |
|
|
flxSW (i,j) = flxAtm(i,j) |
|
|
|
|
285 |
#ifdef ATMOSPHERIC_LOADING |
#ifdef ATMOSPHERIC_LOADING |
286 |
C-- Compute Sea-Ice Loading (= mass of sea-ice + snow / area unit) |
C-- Compute Sea-Ice Loading (= mass of sea-ice + snow / area unit) |
287 |
sIceLoad(i,j,bi,bj) = ( snowHeight(i,j,bi,bj)*rhos |
sIceLoad(i,j,bi,bj) = ( snowHeight(i,j,bi,bj)*rhos |
292 |
ENDDO |
ENDDO |
293 |
ENDDO |
ENDDO |
294 |
|
|
295 |
|
IF ( thSIceAdvScheme.GT.0 ) THEN |
296 |
|
C-- note: those fluxes should to be added directly to Qnet, EmPmR & saltFlux |
297 |
|
DO j = jMin, jMax |
298 |
|
DO i = iMin, iMax |
299 |
|
IF ( hOceMxL(i,j,bi,bj).GT.0. _d 0 ) THEN |
300 |
|
Qnet(i,j,bi,bj) = Qnet(i,j,bi,bj) - oceQnet(i,j,bi,bj) |
301 |
|
EmPmR(i,j,bi,bj)= EmPmR(i,j,bi,bj)- oceFWfx(i,j,bi,bj)/rhofw |
302 |
|
saltFlux(i,j,bi,bj)=saltFlux(i,j,bi,bj) - oceSflx(i,j,bi,bj) |
303 |
|
ENDIF |
304 |
|
ENDDO |
305 |
|
ENDDO |
306 |
|
ENDIF |
307 |
|
|
308 |
|
#ifdef ALLOW_BULK_FORCE |
309 |
|
IF ( useBulkForce ) THEN |
310 |
|
CALL BULKF_FLUX_ADJUST( |
311 |
|
I bi, bj, iMin, iMax, jMin, jMax, |
312 |
|
I isIceFree, myTime, myIter, myThid ) |
313 |
|
ENDIF |
314 |
|
#endif /* ALLOW_BULK_FORCE */ |
315 |
|
|
316 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
317 |
#endif /* ALLOW_THSICE */ |
#endif /* ALLOW_THSICE */ |
318 |
|
|