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