/[MITgcm]/MITgcm/pkg/bbl/bbl_calc_rho.F
ViewVC logotype

Annotation of /MITgcm/pkg/bbl/bbl_calc_rho.F

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


Revision 1.2 - (hide annotations) (download)
Sun Aug 7 07:08:15 2011 UTC (12 years, 10 months ago) by dimitri
Branch: MAIN
Changes since 1.1: +4 -5 lines
o adding package bbl (Bottom Boundary Layer)
  description in MITgcm/pkg/bbl/bbl_description.tex
  example/test experiment in MITgcm_contrib/bbl

1 dimitri 1.2 C $Header: /u/gcmpack/MITgcm/pkg/bbl/bbl_calc_rho.F,v 1.1 2011/08/06 03:13:22 dimitri Exp $
2 dimitri 1.1 C $Name: $
3    
4     #include "BBL_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: BBL_CALC_RHO
8     C !INTERFACE:
9     SUBROUTINE BBL_CALC_RHO(
10     I tFld, sFld,
11     O rhoLoc,
12     I k, bi, bj, myTime, myIter, myThid )
13    
14     C !DESCRIPTION: \bv
15     C *==========================================================*
16     C | SUBROUTINE BBL_CALC_RHO
17     C | o Calculates [rho(S,T,z)-rhoConst] of a 2-D slice
18     C | filling land-points with BBL density.
19     C | Top cell to kLowC computes rhoLoc at level k
20     C | based on tFld(k) and sFld(k).
21     C | kLowC+1 to Nr+1 computes rhoLoc at level k-1
22     C | based on bbl_theta and bbl_salt.
23     C *==========================================================*
24     C \ev
25    
26     C !USES:
27     IMPLICIT NONE
28    
29     C === Global variables ===
30     #include "SIZE.h"
31     #include "EEPARAMS.h"
32     #include "PARAMS.h"
33     #include "GRID.h"
34     #include "BBL.h"
35    
36     C !INPUT/OUTPUT PARAMETERS:
37     C === Routine arguments ===
38     C tFld :: Pot.Temperature (3-D array)
39     C sFld :: Salinity (3-D array)
40     C rhoLoc :: In-situ density [kg/m3] (2-D array) computed at z=rC ;
41     C k :: current vertical index
42     C bi,bj :: Tile indices
43     C myTime :: Current time in simulation
44     C myIter :: Current time-step number
45     C myThid :: my Thread Id number
46     _RL tFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
47     _RL sFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
48 dimitri 1.2 _RL rhoLoc (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
49 dimitri 1.1 INTEGER k, bi, bj
50     _RL myTime
51     INTEGER myIter, myThid
52     CEOP
53    
54     C !LOCAL VARIABLES:
55     C === Local variables ===
56     C msgBuf :: Informational/error message buffer
57     c CHARACTER*(MAX_LEN_MBUF) msgBuf
58     _RL rBBL (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
59     INTEGER i,j,kl
60    
61     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
62    
63     C- Compute rhoLoc at level k based on tFld(k) and sFld(k).
64     CALL FIND_RHO_2D(
65     I 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, k,
66     I tFld(1-OLx,1-OLy,k,bi,bj),
67     I sFld(1-OLx,1-OLy,k,bi,bj),
68     O rhoLoc(1-OLx,1-OLy,k,bi,bj),
69     I k, bi, bj, myThid )
70    
71     C- Compute rBBL at level k-1 based on bbl_theta and bbl_salt.
72     kl = MAX(k-1,1)
73     CALL FIND_RHO_2D(
74     I 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, kl,
75     I bbl_theta,
76     I bbl_salt,
77     O rBBL,
78     I kl, bi, bj, myThid )
79    
80     C- For k > kLowC replace rhoLoc with rBBL
81     DO j=1-OLy,sNy+OLy
82     DO i=1-OLx,sNx+OLx
83     IF ( k .GT. kLowC(i,j,bi,bj) )
84     & rhoLoc(i,j,k,bi,bj) = rBBL(i,j)
85     ENDDO
86     ENDDO
87    
88 dimitri 1.2 C- Compute bbl_rho_nr at level Nr based on bbl_theta and bbl_salt.
89 dimitri 1.1 IF ( k .EQ. Nr ) THEN
90     CALL FIND_RHO_2D(
91     I 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, Nr,
92     I bbl_theta,
93     I bbl_salt,
94 dimitri 1.2 O bbl_rho_nr(1-OLx,1-OLy,bi,bj),
95 dimitri 1.1 I Nr, bi, bj, myThid )
96     ENDIF
97    
98     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
99    
100     RETURN
101     END

  ViewVC Help
Powered by ViewVC 1.1.22