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