/[MITgcm]/MITgcm/pkg/gridalt/phys2dyn.F
ViewVC logotype

Contents of /MITgcm/pkg/gridalt/phys2dyn.F

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


Revision 1.7 - (show annotations) (download)
Tue Nov 18 21:39:38 2008 UTC (15 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63p, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint62, checkpoint63, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.6: +17 -3 lines
move getcon.F to pkg/fizhi (but kappa was already commented out)

1 C $Header: /u/gcmpack/MITgcm/pkg/gridalt/phys2dyn.F,v 1.6 2004/05/05 00:39:21 edhill Exp $
2 C $Name: $
3
4 subroutine phys2dyn(qphy,pephy,im1,im2,jm1,jm2,lmphy,Nsx,Nsy,
5 . idim1,idim2,jdim1,jdim2,bi,bj,pedyn,Lbot,lmdyn,nlperdyn,qdyn)
6 C***********************************************************************
7 C Purpose:
8 C To interpolate an arbitrary quantity from the 'dynamics' eta (pstar)
9 C grid to the higher resolution physics grid
10 C Algorithm:
11 C Routine works one layer (edge to edge pressure) at a time.
12 C Physics -> Dynamics computes the physics layer mean value,
13 C weighted by dp**kappa (interp1) or by dp.
14 C
15 C Input:
16 C qphy..... [im,jm,lmphy] Arbitrary Quantity on Input Grid
17 C pephy.... [im,jm,lmphy+1] Pressures at bottom edges of input levels
18 C im1,2 ... Limits for Longitude Dimension of Input
19 C jm1,2 ... Limits for Latitude Dimension of Input
20 C lmphy.... Vertical Dimension of Input
21 C Nsx...... Number of processes in x-direction
22 C Nsy...... Number of processes in y-direction
23 C idim1,2.. Beginning and ending i-values to calculate
24 C jdim1,2.. Beginning and ending j-values to calculate
25 C bi....... Index of process number in x-direction
26 C bj....... Index of process number in x-direction
27 C pedyn.... [im,jm,lmdyn+1] Pressures at bottom edges of output levels
28 C lmdyn.... Vertical Dimension of Output
29 C nlperdyn. Mapping Array-Highest Physics level in each dynmics level
30 C
31 C Output:
32 C qdyn..... [im,jm,lmdyn] Quantity at output grid (physics grid)
33 C
34 C Notes:
35 C 1) This algorithm assumes that the output (physics) grid levels
36 C fit exactly into the input (dynamics) grid levels
37 C***********************************************************************
38 implicit none
39 cinterp1 #include "PACKAGES_CONFIG.h"
40 #include "CPP_OPTIONS.h"
41
42 integer im1, im2, jm1, jm2, lmdyn, lmphy, Nsx, Nsy
43 integer idim1, idim2, jdim1, jdim2, bi, bj
44 _RL qphy(im1:im2,jm1:jm2,lmphy,Nsx,Nsy)
45 _RL pedyn(im1:im2,jm1:jm2,lmdyn+1,Nsx,Nsy)
46 _RL pephy(im1:im2,jm1:jm2,lmphy+1,Nsx,Nsy)
47 integer nlperdyn(im1:im2,jm1:jm2,lmdyn,Nsx,Nsy)
48 _RL qdyn(im1:im2,jm1:jm2,lmdyn,Nsx,Nsy)
49 integer Lbot(im1:im2,jm1:jm2,Nsx,Nsy)
50
51 integer i,j,L,Lout1,Lout1p1,Lout2,Lphy
52 _RL dpkephy, dpkedyn, sum
53
54 cinterp1 _RL kappa
55 #ifdef ALLOW_FIZHI
56 cinterp1 _RL getcon
57 #else
58 cinterp1 #include 'SIZE.h'
59 cinterp1 #include 'EEPARAMS.h'
60 cinterp1 #include 'PARAMS.h'
61 #endif
62
63 #ifdef ALLOW_FIZHI
64 cinterp1 kappa = getcon('KAPPA')
65 #else
66 cinterp1 kappa = atm_kappa
67 #endif
68
69 c do loop for all dynamics (output) levels
70 do L = 1,lmdyn
71 c do loop for all grid points
72 do j = jdim1,jdim2
73 do i = idim1,idim2
74 qdyn(i,j,L,bi,bj) = 0.
75 c Check to make sure we are above ground - otherwise do nothing
76 if(L.ge.Lbot(i,j,bi,bj))then
77 if(L.eq.Lbot(i,j,bi,bj)) then
78 Lout1 = 0
79 else
80 Lout1 = nlperdyn(i,j,L-1,bi,bj)
81 endif
82 Lout2 = nlperdyn(i,j,L,bi,bj)
83 c do loop for all physics levels contained in this dynamics level
84 cinterp1 dpkedyn = (pedyn(i,j,L,bi,bj)**kappa)-
85 cinterp1 (pedyn(i,j,L+1,bi,bj)**kappa)
86 dpkedyn = pedyn(i,j,L,bi,bj)-pedyn(i,j,L+1,bi,bj)
87 sum = 0.
88 Lout1p1 = Lout1+1
89 do Lphy = Lout1p1,Lout2
90 cinterp1 dpkephy = (pephy(i,j,Lphy,bi,bj)**kappa)-
91 cinterp1 (pephy(i,j,Lphy+1,bi,bj)**kappa)
92 dpkephy = pephy(i,j,Lphy,bi,bj)-pephy(i,j,Lphy+1,bi,bj)
93 sum=sum+qphy(i,j,Lphy,bi,bj)*(dpkephy/dpkedyn)
94 enddo
95 qdyn(i,j,L,bi,bj) = sum
96 endif
97 enddo
98 enddo
99 enddo
100
101 return
102 end

  ViewVC Help
Powered by ViewVC 1.1.22