Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:41:02 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 C--  File gad_osc_hat_x.F: Routines ???
                0004 C--   Contents
                0005 C--   o GAD_OSC_LOC_X
                0006 C--   o GAD_OSC_HAT_X
                0007 
                0008 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0009 
                0010       SUBROUTINE GAD_OSC_LOC_X(ix,mask,fbar,ohat)
                0011 
                0012           implicit none
                0013 
                0014 C     =============================================== global variables
                0015 #         include "SIZE.h"
                0016 
                0017 C     ====================================================== arguments
                0018           integer ix
                0019           _RL mask(1-OLx:sNx+OLx)
                0020           _RL fbar(1-OLx:sNx+OLx)
                0021           _RL ohat(1:2,
                0022      &             1-OLx:sNx+OLx)
                0023 
                0024 C     ====================================================== variables
                0025           _RL floc(-2:+2)
                0026 
                0027           if (ix.gt. +1-OLx .and.
                0028      &        ix.lt.sNx+OLx) then
                0029 
                0030 C     ================ mask local stencil: expand from centre outwards
                0031 
                0032           floc(+0) = fbar(+0+ix)
                0033 
                0034           floc(-1) = floc(+0) +
                0035      &      mask(ix-1)*(fbar(ix-1)-floc(+0))
                0036           floc(+1) = floc(+0) +
                0037      &      mask(ix+1)*(fbar(ix+1)-floc(+0))
                0038 
                0039 C     ================ calc. 1st & 2nd derivatives over masked stencil
                0040 
                0041           ohat(+1,ix) = floc(+1)*0.25 _d 0
                0042      &                - floc(-1)*0.25 _d 0
                0043 
                0044           ohat(+2,ix) = floc(+1)*0.25 _d 0
                0045      &                - floc(+0)*0.50 _d 0
                0046      &                + floc(-1)*0.25 _d 0
                0047 
                0048           else
                0049 
                0050           if (ix.eq. +1-OLx) then
                0051 
                0052 C     ================ mask local stencil: expand from centre outwards
                0053 
                0054           floc(+0) = fbar(+0+ix)
                0055 
                0056           floc(+1) = floc(+0) +
                0057      &      mask(ix+1)*(fbar(ix+1)-floc(+0))
                0058           floc(+2) = floc(+1) +
                0059      &      mask(ix+2)*(fbar(ix+2)-floc(+1))
                0060 
                0061 C     ================ calc. 1st & 2nd derivatives over masked stencil
                0062 
                0063           ohat(+1,ix) = floc(+1)*0.50 _d 0
                0064      &                - floc(+0)*0.50 _d 0
                0065 
                0066           ohat(+2,ix) = floc(+2)*0.25 _d 0
                0067      &                - floc(+1)*0.50 _d 0
                0068      &                + floc(+0)*0.25 _d 0
                0069 
                0070           end if
                0071 
                0072           if (ix.eq.sNx+OLx) then
                0073 
                0074 C     ================ mask local stencil: expand from centre outwards
                0075 
                0076           floc(+0) = fbar(+0+ix)
                0077 
                0078           floc(-1) = floc(+0) +
                0079      &      mask(ix-1)*(fbar(ix-1)-floc(+0))
                0080           floc(-2) = floc(-1) +
                0081      &      mask(ix-2)*(fbar(ix-2)-floc(-1))
                0082 
                0083 C     ================ calc. 1st & 2nd derivatives over masked stencil
                0084 
                0085           ohat(+1,ix) = floc(+0)*0.50 _d 0
                0086      &                - floc(-1)*0.50 _d 0
                0087 
                0088           ohat(+2,ix) = floc(+0)*0.25 _d 0
                0089      &                - floc(-1)*0.50 _d 0
                0090      &                + floc(-2)*0.25 _d 0
                0091 
                0092           end if
                0093 
                0094           end if
                0095 
                0096           return
                0097 
                0098 c     end subroutine GAD_OSC_LOC_X
                0099       end
                0100 
                0101 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0102 
                0103       SUBROUTINE GAD_OSC_HAT_X(bi,bj,kk,iy,
                0104      &           mask,fbar,ohat,myThid)
                0105 C     |================================================================|
                0106 C     | OSC_HAT_X: compute WENO oscillation derivatives in X.          |
                0107 C     |================================================================|
                0108 
                0109           implicit none
                0110 
                0111 C     =============================================== global variables
                0112 #         include "SIZE.h"
                0113 
                0114 C     ====================================================== arguments
                0115           integer bi,bj,kk,iy
                0116           _RL mask(1-OLx:sNx+OLx)
                0117           _RL fbar(1-OLx:sNx+OLx)
                0118           _RL ohat(1:2,
                0119      &             1-OLx:sNx+OLx)
                0120           integer myThid
                0121 
                0122 C     ====================================================== variables
                0123           integer ix
                0124 
                0125 C     ================================ derivatives for WENO indicators
                0126           do ix = 1-OLx+0, sNx+OLx-0
                0127 
                0128               CALL GAD_OSC_LOC_X(ix,mask,fbar,ohat)
                0129 
                0130           end do
                0131 
                0132           return
                0133 
                0134 c     end subroutine GAD_OSC_HAT_X
                0135       end