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

Contents of /MITgcm/model/src/ini_p_ground.F

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


Revision 1.2 - (show annotations) (download)
Wed Sep 26 18:09:15 2001 UTC (22 years, 8 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, release1_p13_pre, checkpoint46f_post, checkpoint44f_post, checkpoint46b_post, checkpoint43a-release1mods, release1_p13, checkpoint46l_pre, chkpt44d_post, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint44e_pre, release1_b1, checkpoint43, release1_chkpt44d_post, release1_p11, icebear5, icebear4, icebear3, icebear2, checkpoint46d_pre, release1-branch_tutorials, checkpoint45d_post, checkpoint46j_pre, chkpt44a_post, checkpoint44h_pre, checkpoint46a_post, checkpoint46j_post, checkpoint46k_post, chkpt44c_pre, checkpoint45a_post, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, release1_p10, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint44g_post, checkpoint46e_pre, checkpoint45b_post, checkpoint46b_pre, release1-branch-end, release1_final_v1, checkpoint46c_pre, checkpoint46, checkpoint44b_post, checkpoint46h_pre, checkpoint46a_pre, checkpoint45c_post, ecco_ice2, ecco_ice1, checkpoint44h_post, checkpoint46g_post, release1_p12_pre, ecco_c44_e22, ecco_c44_e25, chkpt44a_pre, checkpoint46i_post, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, checkpoint46c_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, checkpoint46e_post, release1_beta1, checkpoint44b_pre, checkpoint42, checkpoint41, checkpoint44, checkpoint45, checkpoint46h_post, chkpt44c_post, checkpoint44f_pre, checkpoint46d_post, release1-branch_branchpoint
Branch point for: c24_e25_ice, release1_final, release1-branch, release1, ecco-branch, release1_50yr, icebear, release1_coupled
Changes since 1.1: +20 -10 lines
Bringing comments up to data and formatting for document extraction.

1 C $Header: /u/gcmpack/models/MITgcmUV/model/src/ini_p_ground.F,v 1.1 2001/07/06 21:48:31 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INI_P_GROUND
8 C !INTERFACE:
9 SUBROUTINE INI_P_GROUND(
10 I Hfld,
11 O Pfld,
12 I myThid )
13 C !DESCRIPTION: \bv
14 C *==========================================================*
15 C | SUBROUTINE INI_P_GROUND
16 C | o Convert Topography [m] to (reference) Surface Pressure
17 C | according to tRef profile,
18 C | using same discretisation as in calc_phi_hyd
19 C |
20 C *==========================================================*
21 C \ev
22
23 C !USES:
24 IMPLICIT NONE
25 C == Global variables ==
26 #include "SIZE.h"
27 #include "GRID.h"
28 #include "EEPARAMS.h"
29 #include "PARAMS.h"
30
31 C !INPUT/OUTPUT PARAMETERS:
32 C == Routine arguments ==
33 C Hfld (input) :: Ground elevation [m]
34 C Pfld (output) :: reference Pressure at the ground [Pa]
35 _RS Hfld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
36 _RS Pfld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
37 INTEGER myThid
38
39 c #ifdef INCLUDE_PHIHYD_CALCULATION_CODE
40
41 C !LOCAL VARIABLES:
42 C == Local variables ==
43 INTEGER bi,bj,i,j,K, Ks
44 _RL ddPI, Po_surf
45 _RL phiRef(2*Nr+1), rHalf(2*Nr+1)
46 CEOP
47
48 DO K=1,Nr
49 rHalf(2*K-1) = rF(K)
50 rHalf(2*K) = rC(K)
51 ENDDO
52 rHalf(2*Nr+1) = rF(Nr+1)
53
54 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
55 C- Compute Reference Geopotential at Half levels :
56 C Tracer level: phiRef(2K) ; Interface_W level: phiRef(2K+1)
57
58 phiRef(1) = 0.
59
60 IF (Integr_GeoPot.EQ.1) THEN
61 C- Finite Volume Form, linear by half level :
62 DO K=1,2*Nr
63 Ks = (K+1)/2
64 ddPI=atm_cp*( ((rHalf( K )/atm_po)**atm_kappa)
65 & -((rHalf(K+1)/atm_po)**atm_kappa) )
66 phiRef(K+1) = phiRef(K)+ddPI*tRef(Ks)
67 ENDDO
68 C------
69 ELSE
70 C- Finite Difference Form, linear between Tracer level :
71 C works with Integr_GeoPot = 0, 2 or 3
72 K = 1
73 ddPI=atm_cp*( ((rF(K)/atm_po)**atm_kappa)
74 & -((rC(K)/atm_po)**atm_kappa) )
75 phiRef(2*K) = phiRef(1) + ddPI*tRef(K)
76 DO K=1,Nr-1
77 ddPI=atm_cp*( ((rC( K )/atm_po)**atm_kappa)
78 & -((rC(K+1)/atm_po)**atm_kappa) )
79 phiRef(2*K+1) = phiRef(2*K) + ddPI*0.5*tRef(K)
80 phiRef(2*K+2) = phiRef(2*K)
81 & + ddPI*0.5*(tRef(K)+tRef(K+1))
82 ENDDO
83 K = Nr
84 ddPI=atm_cp*( ((rC( K )/atm_po)**atm_kappa)
85 & -((rF(K+1)/atm_po)**atm_kappa) )
86 phiRef(2*K+1) = phiRef(2*K) + ddPI*tRef(K)
87 C------
88 ENDIF
89
90 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
91
92 C- Convert phiRef to Z unit :
93 DO K=1,2*Nr+1
94 phiRef(K) = phiRef(K)*recip_gravity
95 ENDDO
96
97 C- Write to check :
98 write(6,'(2A)') 'INI_P_GROUND: PhiRef/g [m] at Center ',
99 & '(integer) and Interface (half-int.) levels:'
100 DO K=1,2*Nr+1
101 write(6,'(A,F5.1,A,F10.1,A,F12.3)') ' K=', K*0.5,
102 & ' ; r=', rHalf(K), ' ; phiRef/g=', phiRef(K)
103 ENDDO
104
105 C- Find Po_surf : Linear between 2 half levels :
106 DO bj = myByLo(myThid), myByHi(myThid)
107 DO bi = myBxLo(myThid), myBxHi(myThid)
108 DO j=1,sNy
109 DO i=1,sNx
110 Ks = 1
111 DO K=1,2*Nr
112 IF (Hfld(i,j,bi,bj).GE.phiRef(K)) Ks = K
113 ENDDO
114 Po_surf = rHalf(Ks) + (rHalf(Ks+1)-rHalf(Ks))*
115 & (Hfld(i,j,bi,bj)-phiRef(Ks))/(phiRef(Ks+1)-phiRef(Ks))
116
117 c IF (Hfld(i,j,bi,bj).LT.phiRef(1)) Po_surf= rHalf(1)
118 c IF (Hfld(i,j,bi,bj).GT.phiRef(2*Nr+1)) Po_surf= rHalf(2*Nr+1)
119 Pfld(i,j,bi,bj) = Po_surf
120 ENDDO
121 ENDDO
122 ENDDO
123 ENDDO
124
125 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
126
127 c #endif/* INCLUDE_PHIHYD_CALCULATION_CODE */
128
129 RETURN
130 END

  ViewVC Help
Powered by ViewVC 1.1.22