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

Annotation of /MITgcm/pkg/thsice/thsice_step_temp.F

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


Revision 1.7 - (hide annotations) (download)
Wed Jul 8 23:35:05 2009 UTC (14 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62l, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.6: +2 -2 lines
add code for Near Infra-Red albedo (from Jeff); run-time flag: thSIce_calc_albNIR

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

  ViewVC Help
Powered by ViewVC 1.1.22