Back to home page

MITgcm

 
 

    


File indexing completed on 2022-01-06 06:12:24 UTC

view on githubraw file Latest commit 9f5240b5 on 2022-01-05 15:24:45 UTC
5ed655852f Jean*0001 #include "COST_OPTIONS.h"
449f3c105b Patr*0002 
9f5240b52a Jean*0003       SUBROUTINE cost_accumulate_mean( myThid )
449f3c105b Patr*0004 C     *==========================================================*
9f5240b52a Jean*0005 C     | SUBROUTINE cost_accumulate_mean                          |
449f3c105b Patr*0006 C     | o accumulate mean state for cost evalualtion             |
                0007 C     *==========================================================*
                0008       IMPLICIT NONE
                0009 
                0010 C     == Global variables ===
                0011 #include "SIZE.h"
                0012 #include "EEPARAMS.h"
                0013 #include "PARAMS.h"
                0014 #include "DYNVARS.h"
                0015 #include "GRID.h"
                0016 
                0017 #include "cost.h"
                0018 
                0019 C     == Routine arguments ==
                0020 C     myThid - Thread number for this instance of the routine.
9f5240b52a Jean*0021       INTEGER bi, bj
                0022       INTEGER myThid
449f3c105b Patr*0023 
18c2d26d44 Davi*0024 #ifdef ALLOW_COST
449f3c105b Patr*0025 C     == Local variables
9f5240b52a Jean*0026       INTEGER i, j, k
449f3c105b Patr*0027 
                0028 C--   Calculate cost function on tile of this instance
9f5240b52a Jean*0029       DO bj = myByLo(myThid), myByHi(myThid)
                0030         DO bi = myBxLo(myThid), myBxHi(myThid)
                0031           DO k = 1, Nr
                0032             DO j=1,sNy
                0033               DO i=1,sNx
449f3c105b Patr*0034                 cMeanTheta(i,j,k,bi,bj) = cMeanTheta(i,j,k,bi,bj)
781d8676b2 Patr*0035      &                + theta(i,j,k,bi,bj)
                0036      &                /lastinterval*deltaTClock
449f3c105b Patr*0037                 cMeanUVel(i,j,k,bi,bj) = cMeanUVel(i,j,k,bi,bj)
781d8676b2 Patr*0038      &               + uVel(i,j,k,bi,bj)
                0039      &               /lastinterval*deltaTClock
449f3c105b Patr*0040                 cMeanVVel(i,j,k,bi,bj) = cMeanVVel(i,j,k,bi,bj)
781d8676b2 Patr*0041      &               + vVel(i,j,k,bi,bj)
                0042      &               /lastinterval*deltaTClock
                0043 
de62b6d2c5 Jean*0044                 cMeanThetaUVel(i,j,k,bi,bj) =
781d8676b2 Patr*0045      &               cMeanThetaUVel(i,j,k,bi,bj)
a4efec1784 Patr*0046      &               + (theta(i,j,k,bi,bj)+theta(i-1,j,k,bi,bj))
                0047      &                 /2.*uvel(i,j,k,bi,bj)
                0048      &                 *maskW(i,j,k,bi,bj)*maskC(i,j,k,bi,bj)
                0049      &                 /lastinterval*deltaTClock
de62b6d2c5 Jean*0050                 cMeanThetaVVel(i,j,k,bi,bj) =
781d8676b2 Patr*0051      &               cMeanThetaVVel(i,j,k,bi,bj)
a4efec1784 Patr*0052      &               + (theta(i,j,k,bi,bj)+theta(i,j-1,k,bi,bj))
                0053      &                 /2.*vvel(i,j,k,bi,bj)
                0054      &                 *maskS(i,j,k,bi,bj)*maskC(i,j,k,bi,bj)
                0055      &                 /lastinterval*deltaTClock
9f5240b52a Jean*0056               ENDDO
                0057             ENDDO
                0058           ENDDO
                0059         ENDDO
                0060       ENDDO
449f3c105b Patr*0061 
60daad5b3d Patr*0062 #endif
449f3c105b Patr*0063 
de62b6d2c5 Jean*0064       RETURN
449f3c105b Patr*0065       END