1 |
cnh |
1.3 |
C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/model/src/ini_linear_phisurf.F,v 1.3 2001/09/26 18:09:15 cnh Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
cnh |
1.3 |
CBOP |
7 |
|
|
C !ROUTINE: INI_LINEAR_PHISURF |
8 |
|
|
C !INTERFACE: |
9 |
jmc |
1.1 |
SUBROUTINE INI_LINEAR_PHISURF( myThid ) |
10 |
cnh |
1.3 |
|
11 |
|
|
C !DESCRIPTION: \bv |
12 |
|
|
C *==========================================================* |
13 |
|
|
C | SUBROUTINE INI_LINEAR_PHISURF |
14 |
|
|
C | o Initialise the Linear Relation Phi_surf(eta) |
15 |
|
|
C *==========================================================* |
16 |
|
|
C | Presently: Initialise -Boyancy at surface level (Bo_surf) |
17 |
|
|
C | to setup the Linear relation: Phi_surf(eta)=Bo_surf*eta |
18 |
|
|
C | Futur: might add other things for Non-Linear FreeSurface |
19 |
|
|
C *==========================================================* |
20 |
|
|
C \ev |
21 |
|
|
|
22 |
|
|
C !USES: |
23 |
jmc |
1.1 |
IMPLICIT NONE |
24 |
|
|
C === Global variables === |
25 |
|
|
#include "SIZE.h" |
26 |
|
|
#include "EEPARAMS.h" |
27 |
|
|
#include "PARAMS.h" |
28 |
|
|
#include "GRID.h" |
29 |
|
|
#include "SURFACE.h" |
30 |
|
|
|
31 |
cnh |
1.3 |
C !INPUT/OUTPUT PARAMETERS: |
32 |
jmc |
1.1 |
C === Routine arguments === |
33 |
|
|
C myThid - Thread no. that called this routine. |
34 |
|
|
INTEGER myThid |
35 |
|
|
|
36 |
cnh |
1.3 |
C !LOCAL VARIABLES: |
37 |
jmc |
1.1 |
C === Local variables === |
38 |
|
|
C bi,bj - Loop counters |
39 |
|
|
C I,J,K |
40 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
41 |
|
|
INTEGER bi, bj |
42 |
|
|
INTEGER I, J, K |
43 |
|
|
_RL dPIdp |
44 |
cnh |
1.3 |
CEOP |
45 |
jmc |
1.1 |
|
46 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
47 |
|
|
|
48 |
|
|
C-- Initialise -Boyancy at surface level : Bo_surf |
49 |
|
|
C Bo_surf is defined as d/dr(Phi_surf) and set to g/rtoz (linear free surface) |
50 |
|
|
C with rtoz = conversion factor from r-unit to z-unit (=horiVertRatio) |
51 |
|
|
C an accurate formulation includes P_surf and T,S_surf effects on rho_surf: |
52 |
|
|
C (setting uniformLin_PhiSurf=.FALSE.): |
53 |
|
|
C z-ocean (rtoz=1) : Bo_surf = - Boyancy = gravity * rho_surf/rho_0 |
54 |
|
|
C p-atmos (rtoz=rho_c*g) : Bo_surf = (1/rho)_surf |
55 |
|
|
C Note on Phi_surf splitting : Non-linear Time-dependent effects on b_surf |
56 |
|
|
C [through eta & (T-tRef)_surf] are included in PhiHyd rather than in Bo_surf |
57 |
|
|
C-- |
58 |
|
|
IF ( buoyancyRelation .eq. 'OCEANIC' ) THEN |
59 |
|
|
C- gBaro = gravity (except for External mode test with reduced gravity) |
60 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
61 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
62 |
|
|
DO J=1-Oly,sNy+Oly |
63 |
|
|
DO I=1-Olx,sNx+Olx |
64 |
|
|
Bo_surf(I,J,bi,bj) = gBaro |
65 |
|
|
recip_Bo(I,J,bi,bj) = 1. _d 0 / gBaro |
66 |
|
|
ENDDO |
67 |
|
|
ENDDO |
68 |
|
|
ENDDO |
69 |
|
|
ENDDO |
70 |
|
|
ELSEIF ( uniformLin_PhiSurf ) THEN |
71 |
|
|
C- use a linear (in ps) uniform relation : Phi'_surf = 1/rhoConst * ps'_surf |
72 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
73 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
74 |
|
|
DO J=1-Oly,sNy+Oly |
75 |
|
|
DO I=1-Olx,sNx+Olx |
76 |
|
|
Bo_surf(I,J,bi,bj) = recip_rhoConst |
77 |
|
|
recip_Bo(I,J,bi,bj) = rhoConst |
78 |
|
|
ENDDO |
79 |
|
|
ENDDO |
80 |
|
|
ENDDO |
81 |
|
|
ENDDO |
82 |
|
|
ELSE |
83 |
|
|
C- use a linearized (in ps) Non-uniform relation : Bo_surf(Po_surf,tRef_surf) |
84 |
|
|
C--- Bo = d/d_p(Phi_surf) = tRef_surf*d/d_p(PI) ; PI = Cp*(p/Po)^kappa |
85 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
86 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
87 |
|
|
DO J=1-Oly,sNy+Oly |
88 |
|
|
DO I=1-Olx,sNx+Olx |
89 |
jmc |
1.2 |
IF ( Ro_surf(I,J,bi,bj).GT.0. _d 0 |
90 |
|
|
& .AND. ksurfC(I,J,bi,bj).LE.Nr ) THEN |
91 |
jmc |
1.1 |
dPIdp = (atm_cp*atm_kappa/atm_po)* |
92 |
|
|
& (Ro_surf(I,J,bi,bj)/atm_po)**(atm_kappa-1. _d 0) |
93 |
jmc |
1.2 |
Bo_surf(I,J,bi,bj) = dPIdp*tRef(ksurfC(I,J,bi,bj)) |
94 |
jmc |
1.1 |
recip_Bo(I,J,bi,bj) = 1. _d 0 / Bo_surf(I,J,bi,bj) |
95 |
|
|
ELSE |
96 |
|
|
Bo_surf(I,J,bi,bj) = 0. |
97 |
|
|
recip_Bo(I,J,bi,bj) = 0. |
98 |
|
|
ENDIF |
99 |
|
|
ENDDO |
100 |
|
|
ENDDO |
101 |
|
|
ENDDO |
102 |
|
|
ENDDO |
103 |
|
|
ENDIF |
104 |
|
|
|
105 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
106 |
|
|
|
107 |
|
|
C-- Update overlap regions |
108 |
|
|
_EXCH_XY_R8(Bo_surf, myThid) |
109 |
|
|
_EXCH_XY_R8(recip_Bo, myThid) |
110 |
|
|
|
111 |
|
|
IF ( buoyancyRelation .eq. 'ATMOSPHERIC' .AND. |
112 |
|
|
& .NOT.uniformLin_PhiSurf ) THEN |
113 |
|
|
CALL WRITE_FLD_XY_RL( 'Bo_surf',' ',Bo_surf,0,myThid) |
114 |
|
|
ENDIF |
115 |
|
|
|
116 |
|
|
RETURN |
117 |
|
|
END |