/[MITgcm]/MITgcm/model/src/ini_linear_phisurf.F
ViewVC logotype

Annotation of /MITgcm/model/src/ini_linear_phisurf.F

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


Revision 1.5 - (hide annotations) (download)
Wed Sep 25 19:36:50 2002 UTC (21 years, 8 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint46l_post, checkpoint46l_pre, checkpoint47a_post, checkpoint46j_pre, checkpoint46j_post, checkpoint46k_post, checkpoint46m_post, checkpoint46i_post, checkpoint47, checkpoint46h_post
Changes since 1.4: +5 -4 lines
o cleaned up the use of rhoNil and rhoConst.
  - rhoNil should only appear in the LINEAR equation of state, everywhere
    else rhoNil is replaced by rhoConst, e.g. find_rho computes rho-rhoConst
    and the dynamical equations are all divided by rhoConst
o introduced new parameter rhoConstFresh, a reference density of fresh
  water, to remove the fresh water flux's dependence on rhoNil. The default
  value is 999.8 kg/m^3
o cleanup up external_forcing.F and external_forcing_surf.F
  - can now be used by both OCEANIC and OCEANICP

1 mlosch 1.5 C $Header: /u/gcmpack/MITgcm/model/src/ini_linear_phisurf.F,v 1.4 2002/09/18 16:38:02 mlosch 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 mlosch 1.4 _RL rhoLoc
44 jmc 1.1 _RL dPIdp
45 cnh 1.3 CEOP
46 jmc 1.1
47     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
48    
49     C-- Initialise -Boyancy at surface level : Bo_surf
50     C Bo_surf is defined as d/dr(Phi_surf) and set to g/rtoz (linear free surface)
51     C with rtoz = conversion factor from r-unit to z-unit (=horiVertRatio)
52     C an accurate formulation includes P_surf and T,S_surf effects on rho_surf:
53     C (setting uniformLin_PhiSurf=.FALSE.):
54     C z-ocean (rtoz=1) : Bo_surf = - Boyancy = gravity * rho_surf/rho_0
55     C p-atmos (rtoz=rho_c*g) : Bo_surf = (1/rho)_surf
56     C Note on Phi_surf splitting : Non-linear Time-dependent effects on b_surf
57     C [through eta & (T-tRef)_surf] are included in PhiHyd rather than in Bo_surf
58     C--
59     IF ( buoyancyRelation .eq. 'OCEANIC' ) THEN
60     C- gBaro = gravity (except for External mode test with reduced gravity)
61     DO bj=myByLo(myThid),myByHi(myThid)
62     DO bi=myBxLo(myThid),myBxHi(myThid)
63     DO J=1-Oly,sNy+Oly
64     DO I=1-Olx,sNx+Olx
65     Bo_surf(I,J,bi,bj) = gBaro
66     recip_Bo(I,J,bi,bj) = 1. _d 0 / gBaro
67     ENDDO
68     ENDDO
69     ENDDO
70     ENDDO
71     ELSEIF ( uniformLin_PhiSurf ) THEN
72     C- use a linear (in ps) uniform relation : Phi'_surf = 1/rhoConst * ps'_surf
73     DO bj=myByLo(myThid),myByHi(myThid)
74     DO bi=myBxLo(myThid),myBxHi(myThid)
75     DO J=1-Oly,sNy+Oly
76     DO I=1-Olx,sNx+Olx
77     Bo_surf(I,J,bi,bj) = recip_rhoConst
78     recip_Bo(I,J,bi,bj) = rhoConst
79     ENDDO
80     ENDDO
81     ENDDO
82     ENDDO
83 mlosch 1.4 ELSEIF ( buoyancyRelation .eq. 'OCEANICP' ) THEN
84     DO bj=myByLo(myThid),myByHi(myThid)
85     DO bi=myBxLo(myThid),myBxHi(myThid)
86     DO J=1-Oly,sNy+Oly
87     DO I=1-Olx,sNx+Olx
88     IF ( Ro_surf(I,J,bi,bj).GT.0. _d 0
89     & .AND. ksurfC(I,J,bi,bj).LE.Nr ) THEN
90     k = ksurfC(I,J,bi,bj)
91     CALL FIND_RHO_SCALAR(
92     & tRef(k), sRef(k), Ro_surf(I,J,bi,bj),
93     & rhoLoc, myThid )
94 mlosch 1.5 rhoLoc = rhoLoc + rhoConst
95     if ( rhoLoc .eq. 0. _d 0 ) then
96 mlosch 1.4 Bo_surf(I,J,bi,bj) = 0. _d 0
97     else
98 mlosch 1.5 Bo_surf(I,J,bi,bj) = 1./rhoLoc
99 mlosch 1.4 endif
100 mlosch 1.5 recip_Bo(I,J,bi,bj) = rhoLoc
101 mlosch 1.4 ELSE
102     Bo_surf(I,J,bi,bj) = 0. _d 0
103     recip_Bo(I,J,bi,bj) = 0. _d 0
104     ENDIF
105     ENDDO
106     ENDDO
107     ENDDO
108     ENDDO
109     ELSEIF ( buoyancyRelation .eq. 'ATMOSPHERIC' ) THEN
110 jmc 1.1 C- use a linearized (in ps) Non-uniform relation : Bo_surf(Po_surf,tRef_surf)
111     C--- Bo = d/d_p(Phi_surf) = tRef_surf*d/d_p(PI) ; PI = Cp*(p/Po)^kappa
112     DO bj=myByLo(myThid),myByHi(myThid)
113     DO bi=myBxLo(myThid),myBxHi(myThid)
114     DO J=1-Oly,sNy+Oly
115     DO I=1-Olx,sNx+Olx
116 jmc 1.2 IF ( Ro_surf(I,J,bi,bj).GT.0. _d 0
117     & .AND. ksurfC(I,J,bi,bj).LE.Nr ) THEN
118 jmc 1.1 dPIdp = (atm_cp*atm_kappa/atm_po)*
119     & (Ro_surf(I,J,bi,bj)/atm_po)**(atm_kappa-1. _d 0)
120 jmc 1.2 Bo_surf(I,J,bi,bj) = dPIdp*tRef(ksurfC(I,J,bi,bj))
121 jmc 1.1 recip_Bo(I,J,bi,bj) = 1. _d 0 / Bo_surf(I,J,bi,bj)
122     ELSE
123     Bo_surf(I,J,bi,bj) = 0.
124     recip_Bo(I,J,bi,bj) = 0.
125     ENDIF
126     ENDDO
127     ENDDO
128     ENDDO
129     ENDDO
130 mlosch 1.4 ELSE
131     STOP 'INI_LINEAR_PHISURF: We should never reach this point!'
132 jmc 1.1 ENDIF
133    
134     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
135    
136     C-- Update overlap regions
137     _EXCH_XY_R8(Bo_surf, myThid)
138     _EXCH_XY_R8(recip_Bo, myThid)
139    
140 mlosch 1.4 IF ( ( buoyancyRelation .eq. 'ATMOSPHERIC' .OR.
141     & buoyancyRelation .eq. 'OCEANICP' )
142     & .AND. .NOT.uniformLin_PhiSurf ) THEN
143 jmc 1.1 CALL WRITE_FLD_XY_RL( 'Bo_surf',' ',Bo_surf,0,myThid)
144     ENDIF
145    
146     RETURN
147     END

  ViewVC Help
Powered by ViewVC 1.1.22