/[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.8 - (show annotations) (download)
Sat Jul 7 00:08:09 2012 UTC (11 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.7: +4 -4 lines
Error occurred while calculating annotation data.
uses standard #indude ${PKG}_OPTIONS.h

1 C $Header: /u/gcmpack/MITgcm/pkg/gridalt/phys2dyn.F,v 1.7 2008/11/18 21:39:38 jmc Exp $
2 C $Name: $
3
4 #include "GRIDALT_OPTIONS.h"
5
6 subroutine phys2dyn(qphy,pephy,im1,im2,jm1,jm2,lmphy,Nsx,Nsy,
7 . idim1,idim2,jdim1,jdim2,bi,bj,pedyn,Lbot,lmdyn,nlperdyn,qdyn)
8 C***********************************************************************
9 C Purpose:
10 C To interpolate an arbitrary quantity from the 'dynamics' eta (pstar)
11 C grid to the higher resolution physics grid
12 C Algorithm:
13 C Routine works one layer (edge to edge pressure) at a time.
14 C Physics -> Dynamics computes the physics layer mean value,
15 C weighted by dp**kappa (interp1) or by dp.
16 C
17 C Input:
18 C qphy..... [im,jm,lmphy] Arbitrary Quantity on Input Grid
19 C pephy.... [im,jm,lmphy+1] Pressures at bottom edges of input levels
20 C im1,2 ... Limits for Longitude Dimension of Input
21 C jm1,2 ... Limits for Latitude Dimension of Input
22 C lmphy.... Vertical Dimension of Input
23 C Nsx...... Number of processes in x-direction
24 C Nsy...... Number of processes in y-direction
25 C idim1,2.. Beginning and ending i-values to calculate
26 C jdim1,2.. Beginning and ending j-values to calculate
27 C bi....... Index of process number in x-direction
28 C bj....... Index of process number in x-direction
29 C pedyn.... [im,jm,lmdyn+1] Pressures at bottom edges of output levels
30 C lmdyn.... Vertical Dimension of Output
31 C nlperdyn. Mapping Array-Highest Physics level in each dynmics level
32 C
33 C Output:
34 C qdyn..... [im,jm,lmdyn] Quantity at output grid (physics grid)
35 C
36 C Notes:
37 C 1) This algorithm assumes that the output (physics) grid levels
38 C fit exactly into the input (dynamics) grid levels
39 C***********************************************************************
40 implicit none
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