subroutine dyn2plume(qdyn1,qdyn2,idim1,idim2,jdim1,jdim2,i1,i2, . j1,j2,Lmdyn,Nsx,Nsy,bi,bj,flag,imout,Lmout,qplume) C*********************************************************************** C Purpose: C To interpolate an arbitrary quantity from the 'dynamics' C grid to the higher resolution plumes grid C Algorithm: C Routine performs a direct copy of the field into all the C values on the higher resolution grid. C Dynamics -> Plumes retains the dynamics layer mean value. C C Input: C qdyn1.... [im,jm,lmdyn,bi,bj] Arbitrary Quantity on Input Grid C qdyn2.... [im,jm,lmdyn,bi,bj] Arbitrary Quantity on Input Grid C idim1,2.. Limits for Longitude Dimension of Input C jdim1,2.. Limits for Latitude Dimension of Input C Lmdyn.... Vertical Dimension of Input C Nsx...... Number of processes in x-direction C Nsy...... Number of processes in y-direction C bi....... Index of process number in x-direction C bj....... Index of process number in x-direction C flag .... Flag to indicate winds (1) or temperature (0) interpolation C imout.... Number of points in x-direction to calculate C Lmout.... Vertical Dimension of Output C C Output: C qplume... [idim2,jdim2,im,Lmout] Quantity at output grid (plumes grid) C C Notes: C 1) This algorithm assumes that the output (plumes) grid boxes C fit exactly into the input (dynamics) grid boxes C 2) CAUTION! This routine, as currently written, assumes Lmdyn=Lmout C*********************************************************************** implicit none integer imout, Lmdyn, Lmout, Nsx, Nsy integer idim1, idim2, jdim1, jdim2, bi, bj, flag integer i1, i2, j1, j2 real*4 qdyn1(idim1:idim2,jdim1:jdim2,Lmdyn,Nsx,Nsy) real*4 qdyn2(idim1:idim2,jdim1:jdim2,Lmdyn,Nsx,Nsy) real*4 qplume(i2,j2,imout,Lmout,Nsx) real*4 qd integer i,ii,j,L,iiplume if(flag.eq.1) then c do loop for all plumes (output) levels do L = 1,Lmout c do loop for all grid points do j = j1,j2 do i = i1,i2 qd = sqrt(qdyn1(i,j,L,bi,bj)*qdyn1(i,j,L,bi,bj) + . qdyn2(i,j,L,bi,bj)*qdyn2(i,j,L,bi,bj) ) c for U and V fields, assign the magnitude of the wind to all points do iiplume = 1,imout qplume(i,j,iiplume,L,bi) = qd enddo enddo enddo enddo elseif(flag.eq.0) then c do loop for all plumes (output) levels do L = 1,Lmout c do loop for all grid points do j = j1,j2 do i = i1,i2 qd = qdyn1(i,j,L,bi,bj) c for Temperature, just assign the Temp to all horiz points do iiplume = 1,imout qplume(i,j,iiplume,L,bi) = qd enddo enddo enddo enddo endif return end