Back to home page

darwin3

 
 

    


File indexing completed on 2024-12-17 18:36:01 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d7ce0d34f8 Jean*0001 #include "GAD_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C !ROUTINE: GAD_SOM_LIM_R
                0005 
                0006 C !INTERFACE: ==========================================================
                0007       SUBROUTINE GAD_SOM_LIM_R(
                0008      I           bi,bj, limiter,
                0009      U           sm_v,  sm_o,  sm_x,  sm_y,  sm_z,
                0010      U           sm_xx, sm_yy, sm_zz, sm_xy, sm_xz, sm_yz,
                0011      I           myThid )
                0012 
                0013 C !DESCRIPTION:
                0014 C  Apply limiter before calculating vertical advection
                0015 C        Second-Order Moments Advection of tracer in Z-direction
                0016 C        ref: M.J.Prather, 1986, JGR, 91, D6, pp 6671-6681.
                0017 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0018 
                0019 C !USES: ===============================================================
                0020       IMPLICIT NONE
                0021 #include "SIZE.h"
                0022 c #include "GRID.h"
                0023 #include "GAD.h"
                0024 
                0025 C !INPUT PARAMETERS: ===================================================
                0026 C  bi,bj        :: tile indices
                0027 C  limiter      :: 0: no limiter ; 1: Prather, 1986 limiter
                0028 C  myThid       :: my Thread Id. number
                0029       INTEGER bi,bj
                0030       INTEGER limiter
                0031 c     _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0032       INTEGER myThid
                0033 
                0034 C !OUTPUT PARAMETERS: ==================================================
                0035 C  sm_v         :: volume of grid cell
                0036 C  sm_o         :: tracer content of grid cell (zero order moment)
                0037 C  sm_x,y,z     :: 1rst order moment of tracer distribution, in x,y,z direction
                0038 C  sm_xx,yy,zz  ::  2nd order moment of tracer distribution, in x,y,z direction
                0039 C  sm_xy,xz,yz  ::  2nd order moment of tracer distr., in cross direction xy,xz,yz
                0040       _RL sm_v  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0041       _RL sm_o  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0042       _RL sm_x  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0043       _RL sm_y  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0044       _RL sm_z  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0045       _RL sm_xx (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0046       _RL sm_yy (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0047       _RL sm_zz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0048       _RL sm_xy (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0049       _RL sm_xz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0050       _RL sm_yz (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0051 
                0052 C !LOCAL VARIABLES: ====================================================
                0053 C  i,j,k        :: loop indices
                0054       _RL  three
                0055       PARAMETER( three = 3. _d 0 )
                0056       INTEGER i,j,k
                0057       _RL  slpmax, s1max, s1new, s2new
                0058 CEOP
                0059 
                0060       IF ( limiter.EQ.1 ) THEN
                0061        DO k=1,Nr
8aa8d99107 Jean*0062         DO j=jMinAdvR,jMaxAdvR
                0063          DO i=iMinAdvR,iMaxAdvR
d7ce0d34f8 Jean*0064 C     If flux-limiting transport is to be applied, place limits on
                0065 C     appropriate moments before transport.
                0066           slpmax = 0.
                0067           IF ( sm_o(i,j,k).GT.0. ) slpmax = sm_o(i,j,k)
                0068           s1max = slpmax*1.5 _d 0
                0069           s1new = MIN(  s1max, MAX(-s1max,sm_z(i,j,k)) )
                0070           s2new = MIN( (slpmax+slpmax-ABS(s1new)/three),
                0071      &                 MAX(ABS(s1new)-slpmax,sm_zz(i,j,k))  )
                0072           sm_xz(i,j,k) = MIN( slpmax, MAX(-slpmax,sm_xz(i,j,k)) )
                0073           sm_yz(i,j,k) = MIN( slpmax, MAX(-slpmax,sm_yz(i,j,k)) )
a5a86b736b Jean*0074           sm_z (i,j,k) = s1new
                0075           sm_zz(i,j,k) = s2new
d7ce0d34f8 Jean*0076          ENDDO
                0077         ENDDO
                0078        ENDDO
                0079       ENDIF
                0080 
                0081       RETURN
                0082       END