Back to home page

darwin3

 
 

    


File indexing completed on 2024-12-17 18:37:19 UTC

view on githubraw file Latest commit 64811cb0 on 2022-03-25 02:40:24 UTC
0dc94a8572 Patr*0001 #include "MYPACKAGE_OPTIONS.h"
5b141690f8 Jean*0002 C--  File mypackage_tendency_apply.F: Routines to apply MYPACKAGE tendencies
                0003 C--   Contents
                0004 C--   o MYPACKAGE_TENDENCY_APPLY_U
                0005 C--   o MYPACKAGE_TENDENCY_APPLY_V
                0006 C--   o MYPACKAGE_TENDENCY_APPLY_T
                0007 C--   o MYPACKAGE_TENDENCY_APPLY_S
0dc94a8572 Patr*0008 
3d0c17158b Ed H*0009 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
64811cb024 Jean*0010 CBOP
3d0c17158b Ed H*0011 C !ROUTINE: MYPACKAGE_TENDENCY_APPLY_U
0dc94a8572 Patr*0012 
3d0c17158b Ed H*0013 C !INTERFACE:
5b141690f8 Jean*0014       SUBROUTINE MYPACKAGE_TENDENCY_APPLY_U(
73b1dccda0 Jean*0015      U                     gU_arr,
                0016      I                     iMin,iMax,jMin,jMax, k, bi, bj,
                0017      I                     myTime, myIter, myThid )
3d0c17158b Ed H*0018 
                0019 C     !DESCRIPTION:
                0020 C     Add mypackage tendency terms to U tendency.  Routine works for one
5b141690f8 Jean*0021 C     level at a time. Assumes that U and V tendencies are on C-Grid or
                0022 C     on A-grid.
3d0c17158b Ed H*0023 
                0024 C     !USES:
                0025       IMPLICIT NONE
64811cb024 Jean*0026 C     == Global variables ===
0dc94a8572 Patr*0027 #include "SIZE.h"
                0028 #include "EEPARAMS.h"
73b1dccda0 Jean*0029 #include "GRID.h"
                0030 c#include "DYNVARS.h"
0dc94a8572 Patr*0031 #include "MYPACKAGE.h"
                0032 
73b1dccda0 Jean*0033 C     !INPUT/OUTPUT PARAMETERS:
                0034 C     gU_arr    :: the tendency array
                0035 C     iMin,iMax :: Working range of x-index for applying forcing.
                0036 C     jMin,jMax :: Working range of y-index for applying forcing.
                0037 C     k         :: Current vertical level index
                0038 C     bi,bj     :: Current tile indices
                0039 C     myTime    :: Current time in simulation
                0040 C     myIter    :: Current iteration number
                0041 C     myThid    :: my Thread Id number
                0042       _RL     gU_arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0043       INTEGER iMin, iMax, jMin, jMax
                0044       INTEGER k, bi, bj
                0045       _RL     myTime
                0046       INTEGER myIter
                0047       INTEGER myThid
3d0c17158b Ed H*0048 CEOP
0dc94a8572 Patr*0049 
5b141690f8 Jean*0050 #ifdef MYPACKAGE_TENDENCY
3d0c17158b Ed H*0051 C     !LOCAL VARIABLES:
5b141690f8 Jean*0052       INTEGER i, j
                0053 
                0054       IF ( myPa_applyTendU .AND. myPa_Tend_Cgrid ) THEN
                0055         DO j=jMin,jMax
                0056          DO i=iMin,iMax
73b1dccda0 Jean*0057           gU_arr(i,j) = gU_arr(i,j)
5b141690f8 Jean*0058      &     + maskW(i,j,k,bi,bj) * myPa_TendVelU(i,j,k,bi,bj)
                0059          ENDDO
                0060         ENDDO
                0061       ELSEIF ( myPa_applyTendU ) THEN
                0062 C--   Assume Agrid position:
                0063         DO j=jMin,jMax
                0064          DO i=iMin,iMax
73b1dccda0 Jean*0065           gU_arr(i,j) = gU_arr(i,j)
5b141690f8 Jean*0066      &     + maskW(i,j,k,bi,bj)*( myPa_TendVelU(i-1,j,k,bi,bj)
                0067      &                           +myPa_TendVelU( i ,j,k,bi,bj)
                0068      &                          )*0.5 _d 0
                0069          ENDDO
                0070         ENDDO
                0071       ENDIF
                0072 
                0073 #endif /* MYPACKAGE_TENDENCY */
                0074 
                0075       RETURN
                0076       END
0dc94a8572 Patr*0077 
3d0c17158b Ed H*0078 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
64811cb024 Jean*0079 CBOP
3d0c17158b Ed H*0080 C !ROUTINE: MYPACKAGE_TENDENCY_APPLY_V
                0081 
                0082 C !INTERFACE:
                0083       SUBROUTINE MYPACKAGE_TENDENCY_APPLY_V(
73b1dccda0 Jean*0084      U                     gV_arr,
                0085      I                     iMin,iMax,jMin,jMax, k, bi, bj,
                0086      I                     myTime, myIter, myThid )
3d0c17158b Ed H*0087 
                0088 C     !DESCRIPTION:
                0089 C     Add mypackage tendency terms to V tendency.  Routine works for one
5b141690f8 Jean*0090 C     level at a time. Assumes that U and V tendencies are on C-Grid or
                0091 C     on A-grid.
3d0c17158b Ed H*0092 
                0093 C     !USES:
                0094       IMPLICIT NONE
64811cb024 Jean*0095 C     == Global variables ===
0dc94a8572 Patr*0096 #include "SIZE.h"
                0097 #include "EEPARAMS.h"
73b1dccda0 Jean*0098 #include "GRID.h"
                0099 c#include "DYNVARS.h"
0dc94a8572 Patr*0100 #include "MYPACKAGE.h"
                0101 
73b1dccda0 Jean*0102 C     !INPUT/OUTPUT PARAMETERS:
                0103 C     gV_arr    :: the tendency array
                0104 C     iMin,iMax :: Working range of x-index for applying forcing.
                0105 C     jMin,jMax :: Working range of y-index for applying forcing.
                0106 C     k         :: Current vertical level index
                0107 C     bi,bj     :: Current tile indices
                0108 C     myTime    :: Current time in simulation
                0109 C     myIter    :: Current iteration number
                0110 C     myThid    :: my Thread Id number
                0111       _RL     gV_arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0112       INTEGER iMin, iMax, jMin, jMax
                0113       INTEGER k, bi, bj
                0114       _RL     myTime
                0115       INTEGER myIter
                0116       INTEGER myThid
3d0c17158b Ed H*0117 CEOP
0dc94a8572 Patr*0118 
5b141690f8 Jean*0119 #ifdef MYPACKAGE_TENDENCY
3d0c17158b Ed H*0120 C     !LOCAL VARIABLES:
5b141690f8 Jean*0121       INTEGER i, j
                0122 
                0123       IF ( myPa_applyTendV .AND. myPa_Tend_Cgrid ) THEN
                0124         DO j=jMin,jMax
                0125          DO i=iMin,iMax
73b1dccda0 Jean*0126           gV_arr(i,j) = gV_arr(i,j)
5b141690f8 Jean*0127      &     + maskS(i,j,k,bi,bj) * myPa_TendVelV(i,j,k,bi,bj)
                0128          ENDDO
                0129         ENDDO
                0130       ELSEIF ( myPa_applyTendV ) THEN
                0131 C--   Assume Agrid position:
                0132         DO j=jMin,jMax
                0133          DO i=iMin,iMax
73b1dccda0 Jean*0134           gV_arr(i,j) = gV_arr(i,j)
5b141690f8 Jean*0135      &     + maskS(i,j,k,bi,bj)*( myPa_TendVelV(i,j-1,k,bi,bj)
                0136      &                           +myPa_TendVelV(i, j ,k,bi,bj)
                0137      &                          )*0.5 _d 0
                0138          ENDDO
                0139         ENDDO
                0140       ENDIF
                0141 
                0142 #endif /* MYPACKAGE_TENDENCY */
                0143 
                0144       RETURN
                0145       END
0dc94a8572 Patr*0146 
3d0c17158b Ed H*0147 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
64811cb024 Jean*0148 CBOP
3d0c17158b Ed H*0149 C !ROUTINE: MYPACKAGE_TENDENCY_APPLY_T
                0150 
                0151 C !INTERFACE:
                0152       SUBROUTINE MYPACKAGE_TENDENCY_APPLY_T(
73b1dccda0 Jean*0153      U                     gT_arr,
                0154      I                     iMin,iMax,jMin,jMax, k, bi, bj,
                0155      I                     myTime, myIter, myThid )
3d0c17158b Ed H*0156 
                0157 C     !DESCRIPTION:
                0158 C     Add mypackage tendency terms to T (theta) tendency.  Routine works
                0159 C     for one level at a time
                0160 
5b141690f8 Jean*0161 C     !USES:
3d0c17158b Ed H*0162       IMPLICIT NONE
64811cb024 Jean*0163 C     == Global variables ===
0dc94a8572 Patr*0164 #include "SIZE.h"
                0165 #include "EEPARAMS.h"
73b1dccda0 Jean*0166 #include "GRID.h"
                0167 c#include "DYNVARS.h"
0dc94a8572 Patr*0168 #include "MYPACKAGE.h"
                0169 
73b1dccda0 Jean*0170 C     !INPUT/OUTPUT PARAMETERS:
                0171 C     gT_arr    :: the tendency array
                0172 C     iMin,iMax :: Working range of x-index for applying forcing.
                0173 C     jMin,jMax :: Working range of y-index for applying forcing.
                0174 C     k         :: Current vertical level index
                0175 C     bi,bj     :: Current tile indices
                0176 C     myTime    :: Current time in simulation
                0177 C     myIter    :: Current iteration number
                0178 C     myThid    :: my Thread Id number
                0179       _RL     gT_arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0180       INTEGER iMin, iMax, jMin, jMax
                0181       INTEGER k, bi, bj
                0182       _RL     myTime
                0183       INTEGER myIter
                0184       INTEGER myThid
3d0c17158b Ed H*0185 CEOP
0dc94a8572 Patr*0186 
5b141690f8 Jean*0187 #ifdef MYPACKAGE_TENDENCY
3d0c17158b Ed H*0188 C     !LOCAL VARIABLES:
5b141690f8 Jean*0189       INTEGER i, j
0dc94a8572 Patr*0190 
5b141690f8 Jean*0191       IF ( myPa_applyTendT ) THEN
                0192         DO j=jMin,jMax
                0193          DO i=iMin,iMax
73b1dccda0 Jean*0194           gT_arr(i,j) = gT_arr(i,j)
5b141690f8 Jean*0195      &     + maskC(i,j,k,bi,bj) * myPa_TendScal1(i,j,k,bi,bj)
                0196          ENDDO
                0197         ENDDO
                0198       ENDIF
0dc94a8572 Patr*0199 
5b141690f8 Jean*0200 #endif /* MYPACKAGE_TENDENCY */
0dc94a8572 Patr*0201 
5b141690f8 Jean*0202       RETURN
                0203       END
0dc94a8572 Patr*0204 
3d0c17158b Ed H*0205 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
64811cb024 Jean*0206 CBOP
3d0c17158b Ed H*0207 C !ROUTINE: MYPACKAGE_TENDENCY_APPLY_S
                0208 
                0209 C !INTERFACE:
                0210       SUBROUTINE MYPACKAGE_TENDENCY_APPLY_S(
73b1dccda0 Jean*0211      U                     gS_arr,
                0212      I                     iMin,iMax,jMin,jMax, k, bi, bj,
                0213      I                     myTime, myIter, myThid )
3d0c17158b Ed H*0214 
                0215 C     !DESCRIPTION:
                0216 C     Add mypackage tendency terms to S tendency.  Routine works for one
                0217 C     level at a time
                0218 
73b1dccda0 Jean*0219 C     !USES:
3d0c17158b Ed H*0220       IMPLICIT NONE
64811cb024 Jean*0221 C     == Global variables ===
0dc94a8572 Patr*0222 #include "SIZE.h"
                0223 #include "EEPARAMS.h"
73b1dccda0 Jean*0224 #include "GRID.h"
                0225 c#include "DYNVARS.h"
0dc94a8572 Patr*0226 #include "MYPACKAGE.h"
                0227 
73b1dccda0 Jean*0228 C     !INPUT/OUTPUT PARAMETERS:
                0229 C     gS_arr    :: the tendency array
                0230 C     iMin,iMax :: Working range of x-index for applying forcing.
                0231 C     jMin,jMax :: Working range of y-index for applying forcing.
                0232 C     k         :: Current vertical level index
                0233 C     bi,bj     :: Current tile indices
                0234 C     myTime    :: Current time in simulation
                0235 C     myIter    :: Current iteration number
                0236 C     myThid    :: my Thread Id number
                0237       _RL     gS_arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0238       INTEGER iMin, iMax, jMin, jMax
                0239       INTEGER k, bi, bj
                0240       _RL     myTime
                0241       INTEGER myIter
                0242       INTEGER myThid
3d0c17158b Ed H*0243 CEOP
0dc94a8572 Patr*0244 
5b141690f8 Jean*0245 #ifdef MYPACKAGE_TENDENCY
3d0c17158b Ed H*0246 C     !LOCAL VARIABLES:
5b141690f8 Jean*0247       INTEGER i, j
                0248 
                0249       IF ( myPa_applyTendS ) THEN
                0250         DO j=jMin,jMax
                0251          DO i=iMin,iMax
73b1dccda0 Jean*0252           gS_arr(i,j) = gS_arr(i,j)
5b141690f8 Jean*0253      &     + maskC(i,j,k,bi,bj) * myPa_TendScal2(i,j,k,bi,bj)
                0254          ENDDO
                0255         ENDDO
                0256       ENDIF
0dc94a8572 Patr*0257 
5b141690f8 Jean*0258 #endif /* MYPACKAGE_TENDENCY */
0dc94a8572 Patr*0259 
5b141690f8 Jean*0260       RETURN
                0261       END