Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:41:04 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
8e4c181d69 Jean*0001 #     include "GAD_OPTIONS.h"
                0002 
                0003       SUBROUTINE GAD_PPM_P3E_Y(bi,bj,kk,ix,
                0004      &           mask,fbar,edge,myThid)
                0005 C     |================================================================|
                0006 C     | PPM_P3E_Y: approximate edge values with degree-3 polynomials.  |
                0007 C     | Fixed grid-spacing variant in Y.                               |
                0008 C     |================================================================|
                0009 
                0010           implicit none
                0011 
                0012 C     =============================================== global variables
                0013 #         include "SIZE.h"
                0014 #         include "GRID.h"
                0015 #         include "GAD.h"
                0016 
                0017 C     ====================================================== arguments
                0018           integer bi,bj,kk,ix
                0019           _RL mask(1-OLy:sNy+OLy)
                0020           _RL fbar(1-OLy:sNy+OLy)
                0021           _RL edge(1-OLy:sNy+OLy)
                0022           integer myThid
                0023 
                0024 C     ====================================================== variables
                0025           integer iy
                0026           _RL mloc(-2:+1)
                0027           _RL floc(-2:+1)
                0028           _RL ftmp
                0029 
                0030 C     ==================== reconstruct 3rd--order accurate edge values
                0031           do  iy = 1-OLy+2, sNy+OLy-1
                0032 
                0033 C     ================ mask local stencil: expand from centre outwards
                0034               mloc(-1) = mask(iy-1)
                0035               mloc(+0) = mask(iy+0)
                0036 
                0037               floc(-1) = fbar(iy+0)
                0038      &          + mloc(-1)*(fbar(iy-1)-fbar(iy+0))
                0039               floc(+0) = fbar(iy-1)
                0040      &          + mloc(+0)*(fbar(iy+0)-fbar(iy-1))
                0041 
                0042               mloc(-2) = mask(iy-2) * mloc(-1)
                0043 
                0044               ftmp = 2. _d 0 * floc(-1) - floc(+0)
                0045               floc(-2) = ftmp
                0046      &          + mloc(-2)*(fbar(iy-2)-ftmp)
                0047 
                0048               mloc(+1) = mask(iy+1) * mloc(+0)
                0049 
                0050               ftmp = 2. _d 0 * floc(+0) - floc(-1)
                0051               floc(+1) = ftmp
                0052      &          + mloc(+1)*(fbar(iy+1)-ftmp)
                0053 
                0054 C     ================ centred, 5th-order interpolation for edge value
                0055               edge(iy) =
                0056      &      -(1. _d 0 / 12. _d 0)*(floc(-2)+floc(+1))
                0057      &      +(7. _d 0 / 12. _d 0)*(floc(-1)+floc(+0))
                0058 
                0059           end do
                0060 
                0061           return
                0062 
                0063 c     end subroutine GAD_PPM_P3E_Y
                0064       end