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