subroutine plume2dyn(qplume,idimin,jdimin,Lmplume, . idim1,idim2,jdim1,jdim2,Lmout,Nsx,Nsy,bi,bj,qdyn) C*********************************************************************** C Purpose: C To interpolate an arbitrary quantity from higher resolution plumes C grid to the model's dynamics grid C Algorithm: C Plumes -> Dynamics computes the plumes are mean value C C Input: C qplume... [im,jm,Lmplume] Arbitrary Quantity on Input Grid C pephy.... [im,jm,Lmplume+1] Pressures at bottom edges of input levels C idimin... Longitude Dimension of Input C jdimin... Latitude Dimension of Input C Lmplume.. Vertical Dimension of Input C Nsx...... Number of processes in x-direction C Nsy...... Number of processes in y-direction C idim1,2.. Beginning and ending i-values to calculate C jdim1,2.. Beginning and ending j-values to calculate C bi....... Index of process number in x-direction C bj....... Index of process number in x-direction C pedyn.... [im,jm,Lmout+1] Pressures at bottom edges of output levels C Lmout.... Vertical Dimension of Output C nlperdyn. Mapping Array-Highest Physics level in each dynmics level C C Output: C qdyn..... [im,jm,Lmout] Quantity at output grid (physics grid) C C Notes: C 1) This algorithm assumes that the output (physics) grid levels C fit exactly into the input (dynamics) grid levels C*********************************************************************** implicit none #include "CPP_OPTIONS.h" integer idimin, jdimin, Lmout, Lmplume, Nsx, Nsy integer idim1, idim2, jdim1, jdim2, bi, bj _RL qplume(idimin,jdimin,Lmplume,Nsx,Nsy) _RL pedyn(idimin,jdimin,Lmout+1,Nsx,Nsy) _RL pephy(idimin,jdimin,Lmplume+1,Nsx,Nsy) integer nlperdyn(idimin,jdimin,Lmout,Nsx,Nsy) _RL qdyn(idimin,jdimin,Lmout,Nsx,Nsy) integer Lbot(idimin,jdimin,Nsx,Nsy) integer i,j,L,Lout1,Lout1p1,Lout2,Lphy _RL getcon, kappa, dpkephy, dpkedyn, sum kappa = getcon('KAPPA') c do loop for all dynamics (output) levels do L = 1,Lmout c do loop for all grid points do j = jdim1,jdim2 do i = idim1,idim2 qdyn(i,j,L,bi,bj) = 0. c Check to make sure we are above ground - otherwise do nothing if(L.ge.Lbot(i,j,bi,bj))then if(L.eq.Lbot(i,j,bi,bj)) then Lout1 = 0 else Lout1 = nlperdyn(i,j,L-1,bi,bj) endif Lout2 = nlperdyn(i,j,L,bi,bj) c do loop for all physics levels contained in this dynamics level cinterp1 dpkedyn = (pedyn(i,j,L,bi,bj)**kappa)- cinterp1 (pedyn(i,j,L+1,bi,bj)**kappa) dpkedyn = pedyn(i,j,L,bi,bj)-pedyn(i,j,L+1,bi,bj) sum = 0. Lout1p1 = Lout1+1 do Lphy = Lout1p1,Lout2 cinterp1 dpkephy = (pephy(i,j,Lphy,bi,bj)**kappa)- cinterp1 (pephy(i,j,Lphy+1,bi,bj)**kappa) dpkephy = pephy(i,j,Lphy,bi,bj)-pephy(i,j,Lphy+1,bi,bj) sum=sum+qplume(i,j,Lphy,bi,bj)*(dpkephy/dpkedyn) enddo qdyn(i,j,L,bi,bj) = sum endif enddo enddo enddo return end