Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
4e66ab0b67 Oliv*0001 #include "LONGSTEP_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: LONGSTEP_AVERAGE_3D
                0005 C     !INTERFACE:
                0006       SUBROUTINE LONGSTEP_AVERAGE_3D(
                0007      I      lsCnt,
                0008      U      lsFld,
                0009      I      myNr, myThid)
                0010 
                0011 C     !DESCRIPTION: \bv
                0012 C     *==========================================================*
                0013 C     | SUBROUTINE LONGSTEP_AVERAGE_3D
                0014 C     | o compute longstep average for one field (incl. overlap)
                0015 C     *==========================================================*
                0016 C     \ev
                0017 
                0018 C     !USES:
                0019       IMPLICIT NONE
                0020 C     == Global variables ===
                0021 #include "SIZE.h"
                0022 #include "EEPARAMS.h"
                0023 #include "PARAMS.h"
                0024 #include "GRID.h"
                0025 
                0026 C     !INPUT/OUTPUT PARAMETERS:
                0027 C     == Routine arguments ==
                0028 C      lsCnt :: Counter to update
                0029 C      lsFld :: average to update
                0030 C       myNr :: number of levels to update
                0031 C     myThid :: my Thread Id number
af5eb09265 Jean*0032       INTEGER myNr
4e66ab0b67 Oliv*0033       _RL lsFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy)
7b3defa94d Jean*0034       INTEGER lsCnt(nSx,nSy)
4e66ab0b67 Oliv*0035       INTEGER myThid
                0036 
                0037 #ifdef ALLOW_LONGSTEP
                0038 C     !LOCAL VARIABLES:
                0039 C     == Local variables ==
                0040       INTEGER i,j,k,bi,bj
                0041       _RL factor
                0042 CEOP
                0043 
                0044       DO bj=myByLo(myThid), myByHi(myThid)
                0045        DO bi=myBxLo(myThid), myBxHi(myThid)
b4566ab81c Jean*0046         factor = lsCnt(bi,bj)
7b3defa94d Jean*0047         IF (lsCnt(bi,bj).NE.0) factor = 1. _d 0 / factor
4e66ab0b67 Oliv*0048         DO k = 1,myNr
                0049          DO j = 1-OLy,sNy+OLy
                0050           DO i = 1-OLx,sNx+OLx
                0051            lsFld(i,j,k,bi,bj) = lsFld(i,j,k,bi,bj)*factor
                0052           ENDDO
                0053          ENDDO
                0054         ENDDO
                0055        ENDDO
                0056       ENDDO
                0057 #endif /* ALLOW_LONGSTEP */
                0058 
                0059       RETURN
                0060       END
                0061