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

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

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


Revision 1.3 - (show annotations) (download)
Mon Mar 13 03:53:40 2006 UTC (18 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58e_post, checkpoint58d_post, checkpoint58c_post, checkpoint58b_post
Changes since 1.2: +13 -9 lines
change debug format.

1 C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_impl_temp.F,v 1.2 2004/05/07 21:33:34 jmc Exp $
2 C $Name: $
3
4 #include "THSICE_OPTIONS.h"
5
6 C !ROUTINE: THSICE_IMPL_TEMP
7 C !INTERFACE:
8 SUBROUTINE THSICE_IMPL_TEMP(
9 I netSW, sFlx,
10 O dTsurf,
11 I bi, bj, myTime, myIter, myThid)
12 C *==========================================================*
13 C | S/R THSICE_IMPL_TEMP
14 C | o Calculate sea-ice and surface temp. implicitly
15 C *==========================================================*
16 C | o return surface fluxes for atmosphere boundary layer
17 C | physics (and therefore called within atmospheric physics)
18 C *==========================================================*
19
20 C !USES:
21 IMPLICIT NONE
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
31 C !INPUT/OUTPUT PARAMETERS:
32 C === Routine arguments ===
33 C netSW :: net Short Wave surf. flux (+=down) [W/m2]
34 C sFlx :: surf. heat flux (+=down) except SW, function of surf. temp Ts:
35 C 0: Flx(Ts=0) ; 1: Flx(Ts=Ts^n) ; 2: d.Flx/dTs(Ts=Ts^n)
36 C dTsurf :: surf. temp adjusment: Ts^n+1 - Ts^n
37 C bi,bj :: Tile index
38 C myIter :: iteration counter for this thread
39 C myTime :: time counter for this thread
40 C myThid :: thread number for this instance of the routine.
41 _RL netSW (sNx,sNy)
42 _RL sFlx (sNx,sNy,0:2)
43 _RL dTsurf (sNx,sNy)
44 INTEGER bi,bj
45 _RL myTime
46 INTEGER myIter
47 INTEGER myThid
48
49 #ifdef ALLOW_THSICE
50 C !LOCAL VARIABLES:
51 C === Local variables ===
52 C flxSW :: net Short-Wave (+=down) at surface [W/m2]
53 C flxExcSw :: surf. heat flux (+=down) except SW, function of surf. temp Ts:
54 C 0: Flx(Ts=0) ; 1: Flx(Ts=Ts^n) ; 2: d.Flx/dTs(Ts=Ts^n)
55 C sHeating :: surf heating left to melt snow or ice (= Atmos-conduction)
56 C flxCnB :: heat flux conducted through the ice to bottom surface
57 C flxtmp :: net heat flux from the atmosphere ( >0 downward)
58 C evptmp :: evaporation to the atmosphere [kg/m2/s] (>0 if evaporate)
59 INTEGER i,j
60 INTEGER iMin, iMax
61 INTEGER jMin, jMax
62 _RL flxSW
63 _RL Tf
64 _RL flxtmp, evptmp
65 _RL flxExcSw(0:2)
66 _RL hIce, hSnow, Tsf, Tice(nlyr), qicen(nlyr)
67
68 LOGICAL dBug
69
70 iMin = 1
71 iMax = sNx
72 jMin = 1
73 jMax = sNy
74 dBug = .FALSE.
75 1010 FORMAT(A,1P4E14.6)
76
77 DO j = jMin, jMax
78 DO i = iMin, iMax
79 c dBug = ( bi.EQ.3 .AND. i.EQ.15 .AND. j.EQ.11 )
80
81 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
82 C part.1 : ice-covered fraction ;
83 C Solve for surface and ice temperature (implicitly) ; compute surf. fluxes
84 C-------
85 IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN
86 Tf = -mu_Tf*sOceMxL(i,j,bi,bj)
87 hIce = iceHeight(i,j,bi,bj)
88 hSnow = snowHeight(i,j,bi,bj)
89 flxExcSw(0) = sFlx(i,j,0)
90 flxExcSw(1) = sFlx(i,j,1)
91 flxExcSw(2) = sFlx(i,j,2)
92 flxSW = netSW(i,j)
93 Tsf = Tsrf(i,j,bi,bj)
94 qicen(1)= Qice1(i,j,bi,bj)
95 qicen(2)= Qice2(i,j,bi,bj)
96 IF ( dBug ) THEN
97 WRITE(6,'(A,2I4,2I2)') 'ThSI_IMPL_T: i,j=',i,j,bi,bj
98 WRITE(6,1010) 'ThSI_IMPL_T:-0- iceMask,hIc,hSn,Tsf=',
99 & iceMask(i,j,bi,bj), hIce, hSnow, Tsf
100 WRITE(6,1010) 'ThSI_IMPL_T:-0- Tice(1,2),Qice(1,2)=',
101 & Tice1(i,j,bi,bj), Tice2(i,j,bi,bj), qicen
102 ENDIF
103
104 CALL THSICE_SOLVE4TEMP(
105 I useBulkforce, flxExcSw, Tf, hIce, hSnow,
106 U flxSW, Tsf, qicen,
107 O Tice, sHeating(i,j,bi,bj), flxCndBt(i,j,bi,bj),
108 O dTsurf(i,j), flxtmp, evptmp,
109 I i,j, bi,bj, myThid)
110 C-- Update Fluxes :
111 Qsw(i,j,bi,bj) = -flxSW
112 C-- Update Sea-Ice state :
113 Tsrf(i,j,bi,bj) =Tsf
114 Tice1(i,j,bi,bj)=Tice(1)
115 Tice2(i,j,bi,bj)=Tice(2)
116 Qice1(i,j,bi,bj)=qicen(1)
117 Qice2(i,j,bi,bj)=qicen(2)
118
119 IF ( dBug ) THEN
120 WRITE(6,1010) 'ThSI_IMPL_T: Tsf, Tice(1,2), dTsurf=',
121 & Tsf, Tice, dTsurf(i,j)
122 WRITE(6,1010) 'ThSI_IMPL_T: sHeat, flxCndBt, Qice =',
123 & sHeating(i,j,bi,bj), flxCndBt(i,j,bi,bj), qicen
124 WRITE(6,1010) 'ThSI_IMPL_T: flxA, fxSW_bf,af=',
125 & flxtmp, netSW(i,j), flxSW
126 ENDIF
127 ELSE
128 dTsurf(i,j) = 0. _d 0
129 Qsw(i,j,bi,bj) = 0. _d 0
130 ENDIF
131
132 ENDDO
133 ENDDO
134
135 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
136 #endif /* ALLOW_THSICE */
137
138 RETURN
139 END

  ViewVC Help
Powered by ViewVC 1.1.22