Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
b79a2b44f2 Jean*0001 #include "GAD_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: GAD_SOM_FILL_CS_CORNER
                0005 C     !INTERFACE:
                0006       SUBROUTINE GAD_SOM_FILL_CS_CORNER(
                0007      I           fill4dirX,
                0008      U           sm_v,  sm_o,  sm_x,  sm_y,  sm_z,
                0009      U           sm_xx, sm_yy, sm_zz, sm_xy, sm_xz, sm_yz,
                0010      I           bi, bj, myThid )
                0011 
                0012 C     !DESCRIPTION: \bv
                0013 C     *==========================================================*
                0014 C     | SUBROUTINE GAD_SOM_FILL_CS_CORNER
                0015 C     | o Wraper S/R to fill the corner-halo region of CS-grid,
                0016 C     |   for all moments of a 1 tracer field
                0017 C     *==========================================================*
                0018 C     | o the corner halo region is filled with valid values
                0019 C     |   in order to compute (later on) gradient in X or Y
                0020 C     |   direction, on a wide stencil.
                0021 C     *==========================================================*
                0022 C     \ev
                0023 C     !USES:
                0024       IMPLICIT NONE
                0025 
                0026 C     === Global variables ===
                0027 #include "SIZE.h"
                0028 #include "EEPARAMS.h"
                0029 #include "PARAMS.h"
                0030 #include "GAD.h"
                0031 
                0032 C     !INPUT/OUTPUT PARAMETERS:
                0033 C     === Routine arguments ===
                0034 C     fill4dirX :: True = prepare for X direction calculations
                0035 C                  otherwise, prepare for Y direction
                0036 C     sm_v      :: volume of grid cell
                0037 C     sm_o      :: tracer content of grid cell (zero order moment)
                0038 C     sm_x,y,z  :: 1rst order moment of tracer distribution, in x,y,z direction
                0039 C   sm_xx,yy,zz ::  2nd order moment of tracer distribution, in x,y,z direction
                0040 C   sm_xy,xz,yz ::  2nd order moment of tracer distr., in cross direction xy,xz,yz
                0041 C     bi,bj     :: tile indices
                0042 C     myThid    :: my Thread Id. number
                0043       LOGICAL fill4dirX
                0044       _RL sm_v  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0045       _RL sm_o  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0046       _RL sm_x  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0047       _RL sm_y  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0048       _RL sm_z  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0049       _RL sm_xx (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0050       _RL sm_yy (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0051       _RL sm_zz (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0052       _RL sm_xy (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0053       _RL sm_xz (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0054       _RL sm_yz (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0055       INTEGER bi,bj
                0056       INTEGER myThid
                0057 
                0058 C     !LOCAL VARIABLES:
                0059 C     == Local variables ==
93e3461d85 Jean*0060       INTEGER selectDir
b79a2b44f2 Jean*0061 CEOP
                0062 
                0063       IF (useCubedSphereExchange) THEN
93e3461d85 Jean*0064           IF ( fill4dirX ) THEN
                0065             selectDir = 1
                0066           ELSE
                0067             selectDir = 2
                0068           ENDIF
                0069           CALL FILL_CS_CORNER_TR_RL( selectDir, .FALSE.,
b79a2b44f2 Jean*0070      &                               sm_v , bi,bj, myThid )
93e3461d85 Jean*0071           CALL FILL_CS_CORNER_TR_RL( selectDir, .FALSE.,
b79a2b44f2 Jean*0072      &                               sm_o , bi,bj, myThid )
                0073           CALL FILL_CS_CORNER_AG_RL( fill4dirX, .TRUE.,
                0074      &                               sm_x , sm_y , bi,bj, myThid )
93e3461d85 Jean*0075           CALL FILL_CS_CORNER_TR_RL( selectDir, .FALSE.,
b79a2b44f2 Jean*0076      &                               sm_z , bi,bj, myThid )
                0077           CALL FILL_CS_CORNER_AG_RL( fill4dirX, .FALSE.,
                0078      &                               sm_xx, sm_yy, bi,bj, myThid )
93e3461d85 Jean*0079           CALL FILL_CS_CORNER_TR_RL( selectDir, .FALSE.,
b79a2b44f2 Jean*0080      &                               sm_zz, bi,bj, myThid )
93e3461d85 Jean*0081           CALL FILL_CS_CORNER_TR_RL( selectDir, .TRUE.,
b79a2b44f2 Jean*0082      &                               sm_xy, bi,bj, myThid )
                0083           CALL FILL_CS_CORNER_AG_RL( fill4dirX, .TRUE.,
                0084      &                               sm_xz, sm_yz, bi,bj, myThid )
                0085       ENDIF
                0086 
                0087       RETURN
                0088       END