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

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

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


Revision 1.6 - (hide annotations) (download)
Wed Oct 18 21:07:03 2006 UTC (17 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint58r_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpoint59, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post
Changes since 1.5: +33 -23 lines
- clean-up multi-threaded problems (reported by debugger tcheck on ACES)
  by moving time-interpolation weight (aim_sWght0,1) out of common block.

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

  ViewVC Help
Powered by ViewVC 1.1.22