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

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

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


Revision 1.5 - (show annotations) (download)
Sun Apr 9 14:47:25 2006 UTC (18 years, 1 month ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint58e_post, checkpoint58n_post, checkpoint58h_post, checkpoint58j_post, checkpoint58f_post, checkpoint58d_post, checkpoint58i_post, checkpoint58g_post, checkpoint58o_post, checkpoint58k_post, checkpoint58p_post, checkpoint58m_post
Changes since 1.4: +7 -2 lines
RETURN-statement not allowed in AD mode.

1 C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_slab_ocean.F,v 1.4 2005/11/04 01:34:35 jmc Exp $
2 C $Name: $
3
4 #include "THSICE_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: THSICE_SLAB_OCEAN
8 C !INTERFACE:
9 SUBROUTINE THSICE_SLAB_OCEAN(
10 O dTsurf,
11 I bi, bj, myThid )
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | S/R THSICE_SLAB_OCEAN
15 C | o Slab ocean for atmosphere (and sea-ice) model
16 C *==========================================================*
17 C | o add ocean-surface fluxes + restoring term
18 C | and step forward ocean mixed-layer Temp. & Salinity
19 C *==========================================================*
20 C \ev
21
22 C !USES:
23 IMPLICIT NONE
24
25 C == Global variables ==
26 C-- MITgcm
27 #include "SIZE.h"
28 #include "EEPARAMS.h"
29 #include "PARAMS.h"
30 #include "FFIELDS.h"
31
32 C-- Sea-Ice package
33 #include "THSICE_PARAMS.h"
34 #include "THSICE_VARS.h"
35
36 C-- Physics package
37 #ifdef ALLOW_AIM
38 #include "AIM_FFIELDS.h"
39 #endif
40
41 C !INPUT/OUTPUT PARAMETERS:
42 C == Routine Arguments ==
43 _RL dTsurf(sNx,sNy)
44 INTEGER bi,bj
45 INTEGER myThid
46 CEOP
47
48 #ifdef ALLOW_THSICE
49
50 C == Local variables ==
51 C i,j :: Loop counters
52 _RL dtFac, fwFac, heatFac
53 #ifdef ALLOW_AIM
54 _RL oceTfreez, locTemp, dtFacR
55 #endif
56 INTEGER i,j
57
58 cph the following structure is not supported by TAF
59 cph IF ( .NOT.stepFwd_oceMxL ) RETURN
60 IF ( stepFwd_oceMxL ) THEN
61
62 C-- add heat flux and fresh-water + salt flux :
63 dtFac = ocean_deltaT/rhosw
64 fwFac = ocean_deltaT*sMxL_default*rhofw/rhosw
65 heatFac = ocean_deltaT/(cpwater*rhosw)
66 DO j=1,sNy
67 DO i=1,sNx
68 IF ( hOceMxL(i,j,bi,bj).NE.0. _d 0 ) THEN
69 dTsurf(i,j) = tOceMxL(i,j,bi,bj)
70 tOceMxL(i,j,bi,bj) = tOceMxL(i,j,bi,bj)
71 & - heatFac*Qnet(i,j,bi,bj) / hOceMxL(i,j,bi,bj)
72 sOceMxL(i,j,bi,bj) = sOceMxL(i,j,bi,bj)
73 & + (fwFac*EmPmR(i,j,bi,bj) - dtFac*saltFlux(i,j,bi,bj))
74 & / hOceMxL(i,j,bi,bj)
75 ENDIF
76 ENDDO
77 ENDDO
78
79 #ifdef ALLOW_AIM
80 IF ( tauRelax_MxL .GT. 0. _d 0 ) THEN
81 C-- add restoring (backward) toward climatological Temp. & fixed Salinity
82 dtFac = ocean_deltaT/tauRelax_MxL
83 dtFacR = 1. _d 0 /(1. _d 0 + dtFac)
84 oceTfreez = - 1.9 _d 0
85 DO j=1,sNy
86 DO i=1,sNx
87 IF ( hOceMxL(i,j,bi,bj).NE.0. _d 0 ) THEN
88 sOceMxL(i,j,bi,bj) =
89 & (sOceMxL(i,j,bi,bj) + dtFac*sMxL_default)*dtFacR
90 oceTfreez = -mu_Tf*sOceMxL(i,j,bi,bj)
91 locTemp = ( aim_sWght0*aim_sst0(i,j,bi,bj)
92 & + aim_sWght1*aim_sst1(i,j,bi,bj)
93 & ) - celsius2K
94 locTemp = MAX( locTemp , oceTfreez )
95 tOceMxL(i,j,bi,bj) =
96 & (tOceMxL(i,j,bi,bj) + dtFac*locTemp)*dtFacR
97 ENDIF
98 ENDDO
99 ENDDO
100 ENDIF
101 #endif /* ALLOW_AIM */
102
103 C- Diagnose surf. temp. change
104 DO j=1,sNy
105 DO i=1,sNx
106 IF ( hOceMxL(i,j,bi,bj).NE.0. _d 0 ) THEN
107 dTsurf(i,j) = tOceMxL(i,j,bi,bj) - dTsurf(i,j)
108 ENDIF
109 ENDDO
110 ENDDO
111
112 c-- End of IF ( stepFwd_oceMxL ) THEN
113 ENDIF
114
115 #endif /* ALLOW_THSICE */
116
117 RETURN
118 END

  ViewVC Help
Powered by ViewVC 1.1.22