/[MITgcm]/MITgcm/pkg/frazil/frazil_calc_rhs.F
ViewVC logotype

Contents of /MITgcm/pkg/frazil/frazil_calc_rhs.F

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


Revision 1.4 - (show annotations) (download)
Mon Mar 26 01:47:08 2012 UTC (12 years, 1 month ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64o, checkpoint64a, checkpoint63r, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint64n, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint64b, checkpoint63m, checkpoint64e, checkpoint63q, checkpoint64d, checkpoint64c, checkpoint64g, checkpoint64f, checkpoint63l, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint63n, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint64i, checkpoint63o, checkpoint63p, checkpoint64h, checkpoint63s, checkpoint64k, checkpoint64, checkpoint65, checkpoint64j, checkpoint64m, checkpoint64l, HEAD
Changes since 1.3: +8 -1 lines
move FrzForcT diag from frazil_diagnostics_state.F to frazil_calc_rhs.F
http://mitgcm.org/pipermail/mitgcm-devel/2012-March/005384.html

1 C $Header: /u/gcmpack/MITgcm/pkg/frazil/frazil_calc_rhs.F,v 1.3 2012/03/04 23:11:20 dimitri Exp $
2 C $Name: $
3
4 #include "FRAZIL_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: FRAZIL_CALC_RHS
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE FRAZIL_CALC_RHS(
11 I myTime, myIter, myThid )
12
13 C !DESCRIPTION:
14 C Check water temperature and if colder than freezing
15 C point bring excess negative heat to the surface.
16
17 C !USES: ===============================================================
18 IMPLICIT NONE
19 #include "EEPARAMS.h"
20 #include "SIZE.h"
21 #include "PARAMS.h"
22 #include "GRID.h"
23 #include "DYNVARS.h"
24 #include "FFIELDS.h"
25 #ifdef ALLOW_FRAZIL
26 # include "FRAZIL.h"
27 #endif
28
29 C !INPUT/OUTPUT PARAMETERS:
30 C myTime :: current time in simulation
31 C myIter :: current iteration number in simulation
32 C myThid :: my Thread Id number
33 _RL myTime
34 INTEGER myIter
35 INTEGER myThid
36 CEOP
37
38 #ifdef ALLOW_FRAZIL
39
40 C !LOCAL VARIABLES:
41 C Tfreezing :: freezing threshold temperature
42 INTEGER bi,bj,i,j,k,kTop
43 _RL Tfreezing, Tresid, pLoc, sLoc, tLoc
44 _RL a0, a1, a2, b
45 PARAMETER( a0 = -0.0575 _d 0 )
46 PARAMETER( a1 = 1.710523 _d -3 )
47 PARAMETER( a2 = -2.154996 _d -4 )
48 PARAMETER( b = -7.53 _d -4 )
49
50 _RL SW_TEMP
51 EXTERNAL SW_TEMP
52
53 DO bj=myByLo(myThid),myByHi(myThid)
54 DO bi=myBxLo(myThid),myBxHi(myThid)
55
56 C Initialize FrazilForcingT to zero
57 DO k=1,Nr
58 DO j=1-Oly,sNy+OLy
59 DO i=1-Olx,sNx+Olx
60 FrazilForcingT(i,j,k,bi,bj) = 0. _d 0
61 ENDDO
62 ENDDO
63 ENDDO
64
65 C Check for water below freezing point.
66 DO k = 2, Nr
67 DO j=1-OLy,sNy+OLy
68 DO i=1-OLx,sNx+OLx
69 IF ( maskC(i,j,k-1,bi,bj) .NE. 0. _d 0 .AND.
70 & maskC(i,j,k, bi,bj) .NE. 0. _d 0 ) THEN
71
72 pLoc = ABS(RC(k))
73 sLoc = MAX(salt(i,j,k,bi,bj), 0. _d 0)
74 tLoc = SW_TEMP(sLoc,theta(i,j,k,bi,bj),pLoc,0. _d 0)
75
76 C Freezing point of seawater
77 C REFERENCE: UNESCO TECH. PAPERS IN THE MARINE SCIENCE NO. 28. 1978
78 C EIGHTH REPORT JPOTS
79 C ANNEX 6 FREEZING POINT OF SEAWATER F.J. MILLERO PP.29-35.
80 C
81 C UNITS:
82 C PRESSURE P DECIBARS
83 C SALINITY S PSS-78
84 C TEMPERATURE TF DEGREES CELSIUS
85 C FREEZING PT.
86 C************************************************************
87 C CHECKVALUE: TF= -2.588567 DEG. C FOR S=40.0, P=500. DECIBARS
88 Tfreezing = (a0 + a1*sqrt(sLoc) + a2*sLoc) * sLoc + b*pLoc
89
90 IF (tLoc .LT. Tfreezing) THEN
91 C Move the negative heat to surface level.
92 kTop = kSurfC(i,j,bi,bj)
93 Tresid = ( Tfreezing - tloc )
94 & * HeatCapacity_Cp * rUnit2mass
95 & * drF(k) * _hFacC(i,j,k,bi,bj)
96 FrazilForcingT(i,j,k,bi,bj) = Tresid / dTtracerLev(k)
97 FrazilForcingT(i,j,kTop,bi,bj) =
98 & FrazilForcingT(i,j,kTop,bi,bj)
99 & - Tresid / dTtracerLev(kTop)
100 ENDIF
101 ENDIF
102 ENDDO
103 ENDDO
104 ENDDO
105 ENDDO
106 ENDDO
107
108 # ifdef ALLOW_DIAGNOSTICS
109 IF ( useDiagnostics ) THEN
110 CALL DIAGNOSTICS_FILL( FrazilForcingT, 'FrzForcT',
111 & 0,Nr, 0, 1, 1, myThid )
112 ENDIF
113 # endif /* ALLOW_DIAGNOSTICS */
114
115 #endif /* ALLOW_FRAZIL */
116
117 RETURN
118 END

  ViewVC Help
Powered by ViewVC 1.1.22