Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:44:36 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
30e883b651 Jean*0001 #include "CPP_EEOPTIONS.h"
c75a19df23 Jean*0002 
                0003 CStartofinterface
                0004       SUBROUTINE TIMEAVE_NORMA_2V( 
                0005      U                               fldtave,
                0006      I                               cumulWeight, Ksize,
                0007      I                               bi, bj, myThid )
                0008 C     /==========================================================\
                0009 C     | SUBROUTINE TIMEAVE_NORMA_2V                              |
                0010 C     | o Get average of field : Normalize by cumulated weight   |
                0011 C     \==========================================================/
                0012       IMPLICIT NONE
                0013 
                0014 C     == Global variables ===
                0015 #include "SIZE.h"
                0016 #include "EEPARAMS.h"
                0017 
                0018 C     == Routine arguments ==
                0019 C     myThid        - Thread number for this instance of the routine.
                0020 C     timeave_cumul - cumulated time for average
                0021 C     fldtave       - time averaged Field
                0022 C     Ksize         - 3rd dimension of local array (fldtave)
                0023       INTEGER bi, bj, Ksize, myThid
                0024       _RL fldtave(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
                0025       _RL cumulWeight(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
                0026 
                0027 CEndofinterface
                0028 
                0029 C     == Local variables ==
                0030 C     i,j,k,bi,bj  - Loop counters
                0031       INTEGER i, j, k
                0032  
                0033 C     DO bj = myByLo(myThid), myByHi(myThid)
                0034 C      DO bi = myBxLo(myThid), myBxHi(myThid)
                0035         DO k=1,Ksize
                0036          DO j=1,sNy
                0037           DO i=1,sNx
                0038            IF ( cumulWeight(i,j,k,bi,bj) .GT. 0. _d 0 ) THEN
                0039              fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
                0040      &                            / cumulWeight(i,j,k,bi,bj)
                0041            ENDIF
                0042           ENDDO
                0043          ENDDO
                0044         ENDDO
                0045 C      ENDDO
                0046 C     ENDDO
                0047  
                0048       RETURN
                0049       END