/[MITgcm]/MITgcm_contrib/jscott/code_changed/thsice_step_temp.F
ViewVC logotype

Annotation of /MITgcm_contrib/jscott/code_changed/thsice_step_temp.F

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


Revision 1.1 - (hide annotations) (download)
Fri Aug 11 19:29:23 2006 UTC (20 years ago) by jscott
Branch: MAIN
atm2d package

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

  ViewVC Help
Powered by ViewVC 1.1.22