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

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

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


Revision 1.1 - (hide annotations) (download)
Thu Jan 29 14:22:24 2004 UTC (20 years, 4 months ago) by molod
Branch: MAIN
CVS Tags: hrcube4, checkpoint52j_post, checkpoint52k_post, checkpoint52j_pre, hrcube_3
Initial check in of fizhi (fake!)

1 molod 1.1 subroutine fizhi_wrapper (myTime, myIter, myThid)
2     c-----------------------------------------------------------------------
3     c Subroutine fizhi_wrapper - 'Wrapper' routine to interface
4     c with physics driver.
5     c 1) Set up "bi, bj loop" and some timers and clocks.
6     c 2) Call do_fizhi - driver for physics which computes tendencies
7     c 3) Interpolate tendencies to dynamics grid in vertical
8     c 4) Convert u,v tendencies to C-Grid
9     c
10     c Calls: do_fizhi (get u,v,t,s tend, step tke, etc and tc, etc. forward)
11     c phys2dyn (4 calls - all physics tendencies)
12     c AtoC (u and v tendencies)
13     c-----------------------------------------------------------------------
14     implicit none
15     #include "CPP_OPTIONS.h"
16     #include "SIZE.h"
17     #include "GRID.h"
18     #include "land_SIZE.h"
19     #include "fizhi_SIZE.h"
20     #include "DYNVARS.h"
21     #include "fizhi_coms.h"
22     #include "gridalt_mapping.h"
23     #include "land_coms.h"
24     #include "EEPARAMS.h"
25     #include "SURFACE.h"
26    
27     integer myTime, myIter, myThid
28    
29     c pe on dynamics and physics grid refers to bottom edge
30     _RL pephy(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nrphys+1,nSx,nSy)
31     _RL pedyn(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr+1,nSx,nSy)
32    
33     integer i, j, L, Lbotij, bi, bj
34     integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2
35    
36     im1 = 1-OLx
37     im2 = sNx+OLx
38     jm1 = 1-OLy
39     jm2 = sNy+OLy
40     idim1 = 1
41     idim2 = sNx
42     jdim1 = 1
43     jdim2 = sNy
44    
45     do bj = myByLo(myThid), myByHi(myThid)
46     do bi = myBxLo(myThid), myBxHi(myThid)
47    
48     c Construct the physics grid pressures
49     do j = 1,sNy
50     do i = 1,sNx
51     pephy(i,j,1,bi,bj)=Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj)
52     do L = 2,Nrphys+1
53     pephy(i,j,L,bi,bj)=pephy(i,j,L-1,bi,bj)-dpphys(i,j,L-1,bi,bj)
54     enddo
55     c Do not use a zero field as the top edge pressure for interpolation
56     if(pephy(i,j,Nrphys+1,bi,bj).lt.1.e-5)
57     . pephy(i,j,Nrphys+1,bi,bj) = 1.e-5
58     enddo
59     enddo
60     C Build pressures on dynamics grid
61     do j = 1,sNy
62     do i = 1,sNx
63     do L = 1,Nr
64     pedyn(i,j,L,bi,bj) = 0.
65     enddo
66     enddo
67     enddo
68     do j = 1,sNy
69     do i = 1,sNx+1
70     Lbotij = ksurfC(i,j,bi,bj)
71     if(Lbotij.ne.0.)
72     . pedyn(i,j,Lbotij,bi,bj) = Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj)
73     enddo
74     enddo
75     do j = 1,sNy
76     do i = 1,sNx
77     Lbotij = ksurfC(i,j,bi,bj)
78     do L = Lbotij+1,Nr+1
79     pedyn(i,j,L,bi,bj) = pedyn(i,j,L-1,bi,bj) -
80     . drF(L-1)*hfacC(i,j,L-1,bi,bj)
81     enddo
82     c Do not use a zero field as the top edge pressure for interpolation
83     if(pedyn(i,j,Nr+1,bi,bj).lt.1.e-5)
84     . pedyn(i,j,Nr+1,bi,bj) = 1.e-5
85     enddo
86     enddo
87     c
88     c Compute physics increments
89     call do_fizhi(uphy,vphy,thphy,sphy,pephy,
90     . ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke,
91     . xC,yC,
92     . im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,1,sNx,1,sNy,bi,bj,nchp,
93     . duphy,dvphy,dthphy,dsphy)
94     c Interpolate (A-Grid) physics increments to dynamics grid
95     call phys2dyn(duphy,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,
96     . 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,guphy)
97     call phys2dyn(dvphy,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,
98     . 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gvphy)
99     call phys2dyn(dthphy,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,
100     . 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gthphy)
101     call phys2dyn(dsphy,pephy,im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,
102     . 1,sNx,1,sNy,bi,bj,pedyn,ksurfC,Nr,nlperdyn,gsphy)
103    
104     enddo
105     enddo
106    
107     c Convert guphy and gvphy from A-grid to C-grid for use by dynamics
108     call AtoC(myThid,guphy,gvphy,maskC,im1,im2,jm1,jm2,Nr,
109     . Nsx,Nsy,1,sNx,1,sNy,guphy,gvphy)
110    
111     return
112     end

  ViewVC Help
Powered by ViewVC 1.1.22