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

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

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

revision 1.2 by dimitri, Sat Mar 3 16:04:38 2012 UTC revision 1.3 by dimitri, Sun Mar 4 23:11:20 2012 UTC
# Line 16  C point bring excess negative heat to th Line 16  C point bring excess negative heat to th
16    
17  C !USES: ===============================================================  C !USES: ===============================================================
18        IMPLICIT NONE        IMPLICIT NONE
 #include "SIZE.h"  
19  #include "EEPARAMS.h"  #include "EEPARAMS.h"
20    #include "SIZE.h"
21  #include "PARAMS.h"  #include "PARAMS.h"
 #include "DYNVARS.h"  
22  #include "GRID.h"  #include "GRID.h"
23    #include "DYNVARS.h"
24  #include "FFIELDS.h"  #include "FFIELDS.h"
25  #include "FRAZIL.h"  #ifdef ALLOW_FRAZIL
26    # include "FRAZIL.h"
27    #endif
28    
29  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
30  C     == Routine Arguments ==  C     myTime :: current time in simulation
31  C     myTime - Current time in simulation  C     myIter :: current iteration number in simulation
32  C     myIter - Current iteration number in simulation  C     myThid :: my Thread Id number
33  C     myThid :: Thread no. that called this routine.        _RL     myTime
       _RL myTime  
34        INTEGER myIter        INTEGER myIter
35        INTEGER myThid        INTEGER myThid
36    CEOP
37    
38  #ifdef ALLOW_FRAZIL  #ifdef ALLOW_FRAZIL
39  C !LOCAL VARIABLES: ====================================================  
40  C     Tfreezing :: Freezing threshold temperature.  C     !LOCAL VARIABLES:
41    C     Tfreezing :: freezing threshold temperature
42        INTEGER bi,bj,i,j,k,kTop        INTEGER bi,bj,i,j,k,kTop
43        _RL Tfreezing, Tresid, pLoc, sLoc, tLoc        _RL Tfreezing, Tresid, pLoc, sLoc, tLoc
44        _RL a0, a1, a2, b        _RL a0, a1, a2, b
# Line 46  C     Tfreezing :: Freezing threshold te Line 49  C     Tfreezing :: Freezing threshold te
49    
50        _RL SW_TEMP        _RL SW_TEMP
51        EXTERNAL SW_TEMP        EXTERNAL SW_TEMP
 CEOP  
52    
 C--   Check for water below freezing point.  
53        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
54         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
55          DO j=1-OLy,sNy+OLy  
56           DO i=1-OLx,sNx+OLx  C     Initialize FrazilForcingT to zero
57            kTop = kSurfC(i,j,bi,bj)          DO k=1,Nr
58            DO k = (kTop+1), Nr           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.             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       &          maskC(i,j,k,  bi,bj) .NE. 0. _d 0 ) THEN
71    
# Line 78  C  CHECKVALUE: TF= -2.588567 DEG. C FOR Line 89  C  CHECKVALUE: TF= -2.588567 DEG. C FOR
89    
90              IF (tLoc .LT. Tfreezing) THEN              IF (tLoc .LT. Tfreezing) THEN
91  C     Move the negative heat to surface level.  C     Move the negative heat to surface level.
92               Tresid = Tfreezing - tloc               kTop = kSurfC(i,j,bi,bj)
93               FrazilForcingT(i,j,k,bi,bj) =               Tresid = ( Tfreezing - tloc )
      &            Tresid / dTtracerLev(k)  
94       &            * HeatCapacity_Cp * rUnit2mass       &            * HeatCapacity_Cp * rUnit2mass
95       &            * drF(k) * _hFacC(i,j,k,bi,bj)       &            * 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) =               FrazilForcingT(i,j,kTop,bi,bj) =
98         &            FrazilForcingT(i,j,kTop,bi,bj)
99       &            - Tresid / dTtracerLev(kTop)       &            - Tresid / dTtracerLev(kTop)
      &            * HeatCapacity_Cp * rUnit2mass  
      &            * drF(k) * _hFacC(i,j,k,bi,bj)  
100              ENDIF              ENDIF
101             ENDIF             ENDIF
102            ENDDO            ENDDO

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22