!-------------------------------------- LICENCE BEGIN ------------------------------------ !Environment Canada - Atmospheric Science and Technology License/Disclaimer, ! version 3; Last Modified: May 7, 2008. !This is free but copyrighted software; you can use/redistribute/modify it under the terms !of the Environment Canada - Atmospheric Science and Technology License/Disclaimer !version 3 or (at your option) any later version that should be found at: !http://collaboration.cmc.ec.gc.ca/science/rpn.comm/license.html ! !This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; !without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. !See the above mentioned License/Disclaimer for more details. !You should have received a copy of the License/Disclaimer along with this software; !if not, you can write to: EC-RPN COMM Group, 2121 TransCanada, suite 500, Dorval (Quebec), !CANADA, H9P 1J3; or send e-mail to service.rpn@ec.gc.ca !-------------------------------------- LICENCE END -------------------------------------- **s/r vspng_del2 - horizontal diffusion problem * #include "model_macros_f.h"*
subroutine vspng_del2 ( F_sol, F_opsxp0_8, F_opsyp0_8, 43 $ F_aix_8,F_bix_8,F_cix_8,F_dix_8, $ F_aiy_8,F_biy_8,F_ciy_8, $ DIST_DIM, nke, ntrp12, ntrp22, fnjb) * #include "impnone.cdk"
* integer DIST_DIM, nke, ntrp12, ntrp22, fnjb * real F_sol(DIST_SHAPE,*) real*8 F_opsxp0_8(*),F_opsyp0_8(*), $ F_aix_8(nke,ntrp12,*),F_bix_8(nke,ntrp12,*), $ F_cix_8(nke,ntrp12,*),F_dix_8(nke,ntrp12,*), $ F_aiy_8(nke,ntrp22,*),F_biy_8(nke,ntrp22,*), $ F_ciy_8(nke,ntrp22,*) * *author * Michel Desgagne - October 2000 * *revision * v2_11 - Desgagne M. - initial version * v2_21 - Corbeil L. - ldnh_maxx and ldnh_maxy for transposes * *object * *arguments * Name I/O Description *---------------------------------------------------------------- * F_sol I/O * *---------------------------------------------------------------- * *implicit #include "glb_ld.cdk"
#include "vspng.cdk"
#include "trp.cdk"
#include "ldnh.cdk"
#include "ptopo.cdk"
* integer i, j, k, cnt real*8 w1_8(ldnh_maxx,Vspng_nk,ldnh_maxy), $ w2_8(ldnh_maxy,Vspng_nk,ldnh_maxx), $ t1_8(Vspng_nk,Trp_12emax,G_ni+Ptopo_npex), $ t2_8(Vspng_nk,Trp_22emax,G_nj+Ptopo_npey), $ g1(Vspng_nk*Trp_12emax,G_ni),ax(Vspng_nk*Trp_12emax,G_ni), $ cx(Vspng_nk*Trp_12emax,G_ni),g2(Vspng_nk*Trp_22emax,G_nj), $ ay(Vspng_nk*Trp_22emax,G_nj),cy(Vspng_nk*Trp_22emax,G_nj) ** * __________________________________________________________________ * do j = 1, l_nj do k = 1, Vspng_nk do i = 1, l_ni w1_8(i,k,j) = dble(F_sol(i,j,k)) enddo enddo enddo * call rpn_comm_transpose ( w1_8 , 1, ldnh_maxx, G_ni, Vspng_nk, % 1, Trp_12emax, ldnh_maxy, t1_8, 1, 2 ) * cnt = 0 do j = 1, Trp_12en do k = 1, Vspng_nk cnt = cnt + 1 do i = 1, G_ni-1 g1(cnt,i) = F_bix_8(k,j,i)*F_opsxp0_8(i)*t1_8(k,j,i) ax(cnt,i) = F_aix_8(k,j,i) cx(cnt,i) = F_cix_8(k,j,i) enddo g1(cnt,G_ni) = F_opsxp0_8(G_ni)*t1_8(k,j,G_ni) enddo enddo * do i = 2, G_ni-1 do k = 1, cnt g1(k,i) = g1(k,i) - ax(k,i)*g1(k,i-1) end do end do do i = G_ni-2, 1, -1 do k = 1, cnt g1(k,i) = g1(k,i) - cx(k,i)*g1(k,i+1) end do end do * cnt = 0 do j = 1, Trp_12en *VDIR NOVECTOR do k = 1, Vspng_nk cnt = cnt + 1 t1_8(k,j,G_ni) = F_bix_8(k,j,G_ni)*g1(cnt,G_ni ) % + F_cix_8(k,j,G_ni)*g1(cnt,1 ) % + F_aix_8(k,j,1 )*g1(cnt,G_ni-1) do i = 1, G_ni - 1 t1_8(k,j,i) = g1(cnt,i) + F_dix_8(k,j,i)*t1_8(k,j,G_ni) enddo enddo enddo * call rpn_comm_transpose ( w1_8 , 1, ldnh_maxx, G_ni, Vspng_nk, % 1, Trp_12emax, ldnh_maxy, t1_8, -1, 2 ) * do j = 1, l_nj do k = 1, Vspng_nk do i = 1, l_ni w2_8(j,k,i) = w1_8(i,k,j) enddo enddo enddo * call rpn_comm_transpose ( w2_8 , 1, ldnh_maxy, G_nj, Vspng_nk, % 1, Trp_22emax, ldnh_maxx, t2_8, 2, 2 ) * cnt = 0 do i = 1, Trp_22en do k = 1, Vspng_nk cnt = cnt + 1 do j = 1, fnjb g2 (cnt,j) = F_biy_8(k,i,j)*F_opsyp0_8(j)*t2_8(k,i,j) ay (cnt,j) = F_aiy_8(k,i,j) cy (cnt,j) = F_ciy_8(k,i,j) enddo enddo enddo * do j = 2, fnjb do k = 1, cnt g2 (k,j) = g2(k,j) - ay(k,j)*g2(k,j-1) end do end do do j = fnjb-1, 1, -1 do k = 1, cnt g2 (k,j) = g2(k,j) - cy(k,j)*g2(k,j+1) end do end do * cnt = 0 do i = 1, Trp_22en do k = 1, Vspng_nk cnt = cnt + 1 do j = 1, fnjb t2_8(k,i,j)= g2(cnt,j) end do enddo enddo * call rpn_comm_transpose ( w2_8 , 1, ldnh_maxy, G_nj, Vspng_nk, % 1, Trp_22emax, ldnh_maxx, t2_8, -2, 2 ) * do k = 1, Vspng_nk do j = 1, l_nj do i = 1, l_ni F_sol(i,j,k) = w2_8(j,k,i) enddo enddo enddo * * __________________________________________________________________ * return end