1 |
mlosch |
1.2 |
C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_step_temp.F,v 1.1 2006/05/25 18:01:50 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "THSICE_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: THSICE_STEP_TEMP |
8 |
|
|
C !INTERFACE: |
9 |
|
|
SUBROUTINE THSICE_STEP_TEMP( |
10 |
|
|
I bi, bj, iMin, iMax, jMin, jMax, |
11 |
|
|
I myTime, myIter, myThid ) |
12 |
|
|
C !DESCRIPTION: \bv |
13 |
|
|
C *==========================================================* |
14 |
|
|
C | S/R THSICE_STEP_TEMP |
15 |
|
|
C | o Step Forward Surface and SeaIce Temperature. |
16 |
|
|
C *==========================================================* |
17 |
|
|
C \ev |
18 |
|
|
|
19 |
|
|
C !USES: |
20 |
|
|
IMPLICIT NONE |
21 |
|
|
|
22 |
|
|
C === Global variables === |
23 |
|
|
#include "SIZE.h" |
24 |
|
|
#include "EEPARAMS.h" |
25 |
|
|
#include "PARAMS.h" |
26 |
|
|
#include "FFIELDS.h" |
27 |
|
|
#include "THSICE_SIZE.h" |
28 |
|
|
#include "THSICE_PARAMS.h" |
29 |
|
|
#include "THSICE_VARS.h" |
30 |
|
|
#include "THSICE_TAVE.h" |
31 |
|
|
INTEGER siLo, siHi, sjLo, sjHi |
32 |
|
|
PARAMETER ( siLo = 1-OLx , siHi = sNx+OLx ) |
33 |
|
|
PARAMETER ( sjLo = 1-OLy , sjHi = sNy+OLy ) |
34 |
|
|
|
35 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
36 |
|
|
C === Routine arguments === |
37 |
|
|
C- input: |
38 |
|
|
C bi,bj :: tile indices |
39 |
|
|
C iMin,iMax :: computation domain: 1rst index range |
40 |
|
|
C jMin,jMax :: computation domain: 2nd index range |
41 |
|
|
C myTime :: time counter for this thread |
42 |
|
|
C myIter :: iteration counter for this thread |
43 |
|
|
C myThid :: thread number for this instance of the routine. |
44 |
|
|
C-- Modify fluxes hold in commom blocks |
45 |
|
|
C- input: |
46 |
|
|
C icFlxSW :: (Inp) short-wave heat flux (+=down): downward comp. only |
47 |
|
|
C- output |
48 |
|
|
C icFlxSW :: (Out) net SW flux into ocean (+=down) |
49 |
|
|
C icFlxAtm:: net flux of energy from the atmosphere [W/m2] (+=down) |
50 |
|
|
C icFrwAtm:: evaporation to the atmosphere (kg/m2/s) (>0 if evaporate) |
51 |
|
|
C-- |
52 |
|
|
INTEGER bi,bj |
53 |
|
|
INTEGER iMin, iMax |
54 |
|
|
INTEGER jMin, jMax |
55 |
|
|
_RL myTime |
56 |
|
|
INTEGER myIter |
57 |
|
|
INTEGER myThid |
58 |
|
|
CEOP |
59 |
|
|
|
60 |
|
|
#ifdef ALLOW_THSICE |
61 |
|
|
C !LOCAL VARIABLES: |
62 |
|
|
C === Local variables === |
63 |
|
|
C tFrzOce :: sea-water freezing temperature [oC] (function of S) |
64 |
|
|
C dTsrf :: surf. temp adjusment: Ts^n+1 - Ts^n |
65 |
|
|
INTEGER i,j |
66 |
|
|
_RL tFrzOce(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
67 |
|
|
c _RL dTsrf (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
68 |
|
|
_RL tmpflx(1:2), tmpdTs(1:2) |
69 |
|
|
#ifdef SHORTWAVE_HEATING |
70 |
|
|
_RL opFrac, icFrac |
71 |
|
|
#endif |
72 |
|
|
LOGICAL dBugFlag |
73 |
|
|
|
74 |
|
|
C- define grid-point location where to print debugging values |
75 |
|
|
#include "THSICE_DEBUG.h" |
76 |
|
|
|
77 |
|
|
1010 FORMAT(A,1P4E14.6) |
78 |
|
|
|
79 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
80 |
|
|
|
81 |
|
|
dBugFlag = debugLevel.GE.debLevB |
82 |
|
|
C- Initialise flxAtm,evpAtm |
83 |
|
|
DO j = 1-OLy, sNy+OLy |
84 |
|
|
DO i = 1-OLx, sNx+OLx |
85 |
|
|
icFlxAtm(i,j,bi,bj) = 0. |
86 |
|
|
icFrwAtm(i,j,bi,bj) = 0. |
87 |
|
|
ENDDO |
88 |
|
|
ENDDO |
89 |
|
|
|
90 |
|
|
c IF ( fluidIsWater ) THEN |
91 |
|
|
CALL THSICE_ALBEDO( |
92 |
|
|
I bi, bj, siLo, siHi, sjLo, sjHi, |
93 |
|
|
I iMin,iMax, jMin,jMax, |
94 |
|
|
I iceMask(siLo,sjLo,bi,bj), iceHeight(siLo,sjLo,bi,bj), |
95 |
|
|
I snowHeight(siLo,sjLo,bi,bj), Tsrf(siLo,sjLo,bi,bj), |
96 |
|
|
I snowAge(siLo,sjLo,bi,bj), |
97 |
|
|
O siceAlb(siLo,sjLo,bi,bj), |
98 |
|
|
I myTime, myIter, myThid ) |
99 |
|
|
|
100 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
101 |
|
|
C part.1 : ice-covered fraction ; |
102 |
|
|
C Solve for surface and ice temperature (implicitly) ; compute surf. fluxes |
103 |
|
|
C------- |
104 |
|
|
DO j = jMin, jMax |
105 |
|
|
DO i = iMin, iMax |
106 |
|
|
IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN |
107 |
|
|
#ifdef ALLOW_DBUG_THSICE |
108 |
|
|
IF ( dBug(i,j,bi,bj) ) THEN |
109 |
|
|
WRITE(6,'(A,2I4,2I2)') 'ThSI_STEP_T: i,j=',i,j,bi,bj |
110 |
|
|
WRITE(6,1010) 'ThSI_STEP_T: iceMask, hIc, hSn, Tsf =', |
111 |
|
|
& iceMask(i,j,bi,bj), iceHeight(i,j,bi,bj), |
112 |
|
|
& snowHeight(i,j,bi,bj), Tsrf(i,j,bi,bj) |
113 |
|
|
ENDIF |
114 |
|
|
#endif |
115 |
|
|
C- surface net SW flux: |
116 |
|
|
icFlxSW(i,j,bi,bj) = icFlxSW(i,j,bi,bj) |
117 |
|
|
& *(1. _d 0 - siceAlb(i,j,bi,bj)) |
118 |
|
|
tFrzOce(i,j) = -mu_Tf*sOceMxL(i,j,bi,bj) |
119 |
|
|
ELSE |
120 |
|
|
tFrzOce(i,j) = 0. _d 0 |
121 |
|
|
ENDIF |
122 |
|
|
ENDDO |
123 |
|
|
ENDDO |
124 |
|
|
|
125 |
|
|
CALL THSICE_SOLVE4TEMP( |
126 |
|
|
I bi, bj, siLo, siHi, sjLo, sjHi, |
127 |
mlosch |
1.2 |
I iMin,iMax, jMin,jMax, dBugFlag, |
128 |
|
|
I useBulkForce, useEXF, |
129 |
jmc |
1.1 |
I iceMask(siLo,sjLo,bi,bj), iceHeight(siLo,sjLo,bi,bj), |
130 |
|
|
I snowHeight(siLo,sjLo,bi,bj), tFrzOce, tmpflx, |
131 |
|
|
U icFlxSW(siLo,sjLo,bi,bj), Tsrf(siLo,sjLo,bi,bj), |
132 |
|
|
U Qice1(siLo,sjLo,bi,bj), Qice2(siLo,sjLo,bi,bj), |
133 |
|
|
O Tice1(siLo,sjLo,bi,bj), Tice2(siLo,sjLo,bi,bj), tmpdTs, |
134 |
|
|
O sHeating(siLo,sjLo,bi,bj), flxCndBt(siLo,sjLo,bi,bj), |
135 |
|
|
O icFlxAtm(siLo,sjLo,bi,bj), icFrwAtm(siLo,sjLo,bi,bj), |
136 |
|
|
I myTime, myIter, myThid ) |
137 |
|
|
|
138 |
|
|
#ifdef SHORTWAVE_HEATING |
139 |
|
|
DO j = jMin, jMax |
140 |
|
|
DO i = iMin, iMax |
141 |
|
|
IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN |
142 |
|
|
icFrac = iceMask(i,j,bi,bj) |
143 |
|
|
opFrac = 1. _d 0 - icFrac |
144 |
|
|
C-- Update Fluxes : |
145 |
|
|
Qsw(i,j,bi,bj) = opFrac*Qsw(i,j,bi,bj) |
146 |
|
|
& - icFrac*icFlxSW(i,j,bi,bj) |
147 |
|
|
ENDIF |
148 |
|
|
ENDDO |
149 |
|
|
ENDDO |
150 |
|
|
#endif /* SHORTWAVE_HEATING */ |
151 |
|
|
c ENDIF |
152 |
|
|
|
153 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
154 |
|
|
#endif /* ALLOW_THSICE */ |
155 |
|
|
|
156 |
|
|
RETURN |
157 |
|
|
END |