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

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

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


Revision 1.6 - (hide annotations) (download)
Wed May 5 00:39:21 2004 UTC (20 years ago) by edhill
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, checkpoint57v_post, checkpoint52n_post, checkpoint53d_post, checkpoint58u_post, checkpoint58w_post, checkpoint54a_pre, checkpoint57m_post, checkpoint55c_post, checkpoint54e_post, checkpoint57s_post, checkpoint54a_post, checkpoint53c_post, checkpoint57k_post, checkpoint55d_pre, checkpoint57d_post, checkpoint57g_post, checkpoint60, checkpoint61, checkpoint57b_post, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint56b_post, checkpoint57i_post, checkpoint57y_post, checkpoint57e_post, checkpoint55h_post, checkpoint58n_post, checkpoint58x_post, checkpoint57g_pre, checkpoint54b_post, checkpoint53b_pre, checkpoint55b_post, checkpoint58t_post, checkpoint58h_post, checkpoint54d_post, checkpoint56c_post, checkpoint57y_pre, checkpoint55, checkpoint53a_post, checkpoint57f_pre, checkpoint57a_post, checkpoint54, checkpoint58q_post, checkpoint54f_post, checkpoint53b_post, checkpoint59q, checkpoint59p, checkpoint55g_post, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, checkpoint53, eckpoint57e_pre, checkpoint57h_done, checkpoint58f_post, checkpoint53g_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint57c_post, checkpoint58y_post, checkpoint55e_post, checkpoint58k_post, checkpoint58v_post, checkpoint53f_post, checkpoint55a_post, checkpoint53d_pre, checkpoint54c_post, checkpoint58s_post, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint57j_post, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post, checkpoint56a_post, checkpoint55d_post
Changes since 1.5: +3 -0 lines
 o adding cvs 'Header:' and 'Name:' strings

1 edhill 1.6 C $Header: $
2     C $Name: $
3    
4 molod 1.1 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 molod 1.3 C weighted by dp**kappa (interp1) or by dp.
14 molod 1.1 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     #include "CPP_OPTIONS.h"
40    
41     integer im1, im2, jm1, jm2, lmdyn, lmphy, Nsx, Nsy
42     integer idim1, idim2, jdim1, jdim2, bi, bj
43     _RL qphy(im1:im2,jm1:jm2,lmphy,Nsx,Nsy)
44     _RL pedyn(im1:im2,jm1:jm2,lmdyn+1,Nsx,Nsy)
45     _RL pephy(im1:im2,jm1:jm2,lmphy+1,Nsx,Nsy)
46     integer nlperdyn(im1:im2,jm1:jm2,lmdyn,Nsx,Nsy)
47     _RL qdyn(im1:im2,jm1:jm2,lmdyn,Nsx,Nsy)
48     integer Lbot(im1:im2,jm1:jm2,Nsx,Nsy)
49    
50 molod 1.2 integer i,j,L,Lout1,Lout1p1,Lout2,Lphy
51 molod 1.4 _RL getcon, kappa, dpkephy, dpkedyn, sum
52 molod 1.1
53     kappa = getcon('KAPPA')
54    
55 molod 1.4 c do loop for all dynamics (output) levels
56     do L = 1,lmdyn
57 molod 1.1 c do loop for all grid points
58 molod 1.4 do j = jdim1,jdim2
59     do i = idim1,idim2
60 molod 1.1 qdyn(i,j,L,bi,bj) = 0.
61     c Check to make sure we are above ground - otherwise do nothing
62     if(L.ge.Lbot(i,j,bi,bj))then
63     if(L.eq.Lbot(i,j,bi,bj)) then
64     Lout1 = 0
65     else
66     Lout1 = nlperdyn(i,j,L-1,bi,bj)
67     endif
68     Lout2 = nlperdyn(i,j,L,bi,bj)
69     c do loop for all physics levels contained in this dynamics level
70 molod 1.3 cinterp1 dpkedyn = (pedyn(i,j,L,bi,bj)**kappa)-
71     cinterp1 (pedyn(i,j,L+1,bi,bj)**kappa)
72     dpkedyn = pedyn(i,j,L,bi,bj)-pedyn(i,j,L+1,bi,bj)
73 molod 1.4 sum = 0.
74 molod 1.2 Lout1p1 = Lout1+1
75     do Lphy = Lout1p1,Lout2
76 molod 1.3 cinterp1 dpkephy = (pephy(i,j,Lphy,bi,bj)**kappa)-
77     cinterp1 (pephy(i,j,Lphy+1,bi,bj)**kappa)
78     dpkephy = pephy(i,j,Lphy,bi,bj)-pephy(i,j,Lphy+1,bi,bj)
79 molod 1.4 sum=sum+qphy(i,j,Lphy,bi,bj)*(dpkephy/dpkedyn)
80 molod 1.1 enddo
81 molod 1.4 qdyn(i,j,L,bi,bj) = sum
82 molod 1.1 endif
83     enddo
84     enddo
85     enddo
86    
87     return
88     end

  ViewVC Help
Powered by ViewVC 1.1.22