/[MITgcm]/MITgcm/pkg/fizhi/fizhi_wrapper.F
ViewVC logotype

Contents of /MITgcm/pkg/fizhi/fizhi_wrapper.F

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


Revision 1.8 - (show annotations) (download)
Tue Jun 15 20:22:26 2004 UTC (20 years ago) by molod
Branch: MAIN
Changes since 1.7: +27 -28 lines
Developing

1 C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_wrapper.F,v 1.7 2004/06/14 20:34:50 molod Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5 subroutine fizhi_wrapper (myTime, myIter, myThid)
6 c-----------------------------------------------------------------------
7 c Subroutine fizhi_wrapper - 'Wrapper' routine to interface
8 c with physics driver.
9 c 1) Set up "bi, bj loop" and some timers and clocks.
10 c 2) Call do_fizhi - driver for physics which computes tendencies
11 c 3) Interpolate tendencies to dynamics grid in vertical
12 c 4) Convert u,v tendencies to C-Grid
13 c
14 c Calls: do_fizhi (get u,v,t,s tend, step tke, etc and tc, etc. forward)
15 c phys2dyn (4 calls - all physics tendencies)
16 c AtoC (u and v tendencies)
17 c-----------------------------------------------------------------------
18 implicit none
19 #include "SIZE.h"
20 #include "GRID.h"
21 #include "EEPARAMS.h"
22 #include "SURFACE.h"
23 #include "DYNVARS.h"
24 #include "fizhi_land_SIZE.h"
25 #include "fizhi_SIZE.h"
26 #include "fizhi_coms.h"
27 #include "gridalt_mapping.h"
28
29 integer myTime, myIter, myThid
30
31 c pe on dynamics and physics grid refers to bottom edge
32 _RL pephy4fiz(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nrphys+1,nSx,nSy)
33 _RL pephy(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nrphys+1,nSx,nSy)
34 _RL pedyn(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr+1,nSx,nSy)
35 _RL tempphy(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nrphys,nSx,nSy)
36
37 integer i, j, L, Lbotij, bi, bj
38 integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2
39
40 idim1 = 1-OLx
41 idim2 = sNx+OLx
42 jdim1 = 1-OLy
43 jdim2 = sNy+OLy
44 im1 = 1
45 im2 = sNx
46 jm1 = 1
47 jm2 = sNy
48
49 do bj = myByLo(myThid), myByHi(myThid)
50 do bi = myBxLo(myThid), myBxHi(myThid)
51
52 c Construct the physics grid pressures
53 C Note: Need one array to send to fizhi (top-down) and another
54 C For the interpolations between physics and dynamics (bottom-up)
55 do j = 1,sNy
56 do i = 1,sNx
57 pephy(i,j,1,bi,bj)=(Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj))/
58 . rstarExpC(i,j,bi,bj)
59 do L = 2,Nrphys+1
60 pephy(i,j,L,bi,bj)=pephy(i,j,L-1,bi,bj)-dpphys(i,j,L-1,bi,bj)
61 enddo
62 c Do not use a zero field as the top edge pressure for interpolation
63 do L = 1,Nrphys+1
64 pephy4fiz(i,j,Nrphys+2-L,bi,bj)=pephy(i,j,L,bi,bj)
65 enddo
66 if(pephy(i,j,Nrphys+1,bi,bj).lt.1.e-5)
67 . pephy(i,j,Nrphys+1,bi,bj) = 1.e-5
68 enddo
69 enddo
70 C Build pressures on dynamics grid
71 do j = 1,sNy
72 do i = 1,sNx
73 do L = 1,Nr
74 pedyn(i,j,L,bi,bj) = 0.
75 enddo
76 enddo
77 enddo
78 do j = 1,sNy
79 do i = 1,sNx
80 Lbotij = ksurfC(i,j,bi,bj)
81 if(Lbotij.ne.0.)
82 . pedyn(i,j,Lbotij,bi,bj) = (Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj))/
83 . rstarExpC(i,j,bi,bj)
84 enddo
85 enddo
86 do j = 1,sNy
87 do i = 1,sNx
88 Lbotij = ksurfC(i,j,bi,bj)
89 do L = Lbotij+1,Nr+1
90 pedyn(i,j,L,bi,bj) = pedyn(i,j,L-1,bi,bj) -
91 . drF(L-1)*hfacC(i,j,L-1,bi,bj)
92 enddo
93 c Do not use a zero field as the top edge pressure for interpolation
94 if(pedyn(i,j,Nr+1,bi,bj).lt.1.e-5)
95 . pedyn(i,j,Nr+1,bi,bj) = 1.e-5
96 enddo
97 enddo
98 enddo
99 enddo
100
101 CALL TIMER_START ('DO_FIZHI [FIZHI_WRAPPER]',mythid)
102 do bj = myByLo(myThid), myByHi(myThid)
103 do bi = myBxLo(myThid), myBxHi(myThid)
104 c
105 c Compute physics increments
106 call do_fizhi(uphy,vphy,thphy,sphy,pephy4fiz,xC,yC,
107 . ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke,
108 . idim1,idim2,jdim1,jdim2,Nrphys,Nsx,Nsy,im1,im2,jm1,jm2,bi,bj,
109 . nchp,
110 . duphy,dvphy,dthphy,dsphy)
111 enddo
112 enddo
113 CALL TIMER_STOP ('DO_FIZHI [FIZHI_WRAPPER]',mythid)
114
115 CALL TIMER_START ('PHYS2DYN [FIZHI_WRAPPER]',mythid)
116 do bj = myByLo(myThid), myByHi(myThid)
117 do bi = myBxLo(myThid), myBxHi(myThid)
118 c Interpolate (A-Grid) physics increments to dynamics grid
119 C First flip the physics arrays (which are top-down)
120 C into bottom-up arrays for interpolation to dynamics grid
121 do j = 1,sNy
122 do i = 1,sNx
123 do L = 1,Nrphys
124 tempphys(i,j,Nrphys+1-L,bi,bj)=duphy(i,j,L,bi,bj)
125 enddo
126 enddo
127 enddo
128 call phys2dyn(tmpphys,pephy,idim1,idim2,jdim1,jdim2,Nrphys,
129 . Nsx,Nsy,im1,im2,jm1,jm2,bi,bj,pedyn,ksurfC,Nr,nlperdyn,guphy)
130 do j = 1,sNy
131 do i = 1,sNx
132 do L = 1,Nrphys
133 tempphys(i,j,Nrphys+1-L,bi,bj)=dvphy(i,j,L,bi,bj)
134 enddo
135 enddo
136 enddo
137 call phys2dyn(tmpphys,pephy,idim1,idim2,jdim1,jdim2,Nrphys,
138 . Nsx,Nsy,im1,im2,jm1,jm2,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gvphy)
139 do j = 1,sNy
140 do i = 1,sNx
141 do L = 1,Nrphys
142 tempphys(i,j,Nrphys+1-L,bi,bj)=dthphy(i,j,L,bi,bj)
143 enddo
144 enddo
145 enddo
146 call phys2dyn(tmpphys,pephy,idim1,idim2,jdim1,jdim2,Nrphys,
147 . Nsx,Nsy,im1,im2,jm1,jm2,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gthphy)
148 do j = 1,sNy
149 do i = 1,sNx
150 do L = 1,Nrphys
151 tempphys(i,j,Nrphys+1-L,bi,bj)=dsphy(i,j,L,bi,bj)
152 enddo
153 enddo
154 enddo
155 call phys2dyn(tmpphys,pephy,idim1,idim2,jdim1,jdim2,Nrphys,
156 . Nsx,Nsy,im1,im2,jm1,jm2,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gsphy)
157
158 enddo
159 enddo
160 CALL TIMER_STOP ('PHYS2DYN [FIZHI_WRAPPER]',mythid)
161
162 c Convert guphy and gvphy from A-grid to C-grid for use by dynamics
163 CALL TIMER_START ('ATOC [FIZHI_WRAPPER]',mythid)
164 call AtoC(myThid,guphy,gvphy,maskC,idim1,idim2,jdim1,jdim2,Nr,
165 . Nsx,Nsy,im1,im2,jm1,jm2,guphy,gvphy)
166 CALL TIMER_STOP ('ATOC [FIZHI_WRAPPER]',mythid)
167
168 CALL TIMER_START ('EXCHANGES [FIZHI_WRAPPER]',mythid)
169 c Call the c-grid exchange routine to fill in the halo regions (du,dv)
170 call exch_uv_xyz_RL(guphy,gvphy,.TRUE.,myThid)
171 c Call the a-grid exchange routine to fill in the halo regions (dth,ds)
172 call exch_RL_cube(gthphy,OLx, OLx, OLy, OLy, Nr,OLx, OLy,
173 . FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
174 call exch_RL_cube(gsphy,OLx, OLx, OLy, OLy, Nr,OLx, OLy,
175 . FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid )
176 CALL TIMER_STOP ('EXCHANGES [FIZHI_WRAPPER]',mythid)
177
178 return
179 end

  ViewVC Help
Powered by ViewVC 1.1.22