/[MITgcm]/MITgcm_contrib/bbl/code/bbl_calc_rho.F
ViewVC logotype

Annotation of /MITgcm_contrib/bbl/code/bbl_calc_rho.F

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


Revision 1.2 - (hide annotations) (download)
Sat Aug 6 03:11:42 2011 UTC (13 years, 11 months ago) by dimitri
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
moving pkg/bbl to main branch

1 dimitri 1.2 C $Header: /u/gcmpack/MITgcm_contrib/bbl/code/bbl_calc_rho.F,v 1.1 2011/03/06 02:11:05 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     _RL rhoLoc (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr+1,nSx,nSy)
49     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     C- Compute rhoLoc at level Nr based on bbl_theta and bbl_salt.
89     IF ( k .EQ. Nr ) THEN
90     kl = Nr + 1
91     CALL FIND_RHO_2D(
92     I 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, Nr,
93     I bbl_theta,
94     I bbl_salt,
95     O rhoLoc(1-OLx,1-OLy,kl,bi,bj),
96     I Nr, bi, bj, myThid )
97     ENDIF
98    
99     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
100    
101     RETURN
102     END

  ViewVC Help
Powered by ViewVC 1.1.22