Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:45:51 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
5ed655852f Jean*0001 #include "COST_OPTIONS.h"
a180d1c5b4 Patr*0002 
                0003       subroutine cost_tracer( bi, bj, myThid )
                0004 C     /==========================================================\
                0005 C     | subroutine cost_tracer                                   |
                0006 C     | o this routine computes the cost function for the tiles  |
                0007 C     |   of this processor                                      |
                0008 C     |==========================================================|
                0009 C     |                                                          |
                0010 C     | Notes                                                    |
                0011 C     | =====                                                    |
                0012 C     \==========================================================/
                0013       IMPLICIT NONE
                0014 
                0015 C     == Global variables ===
                0016 #include "SIZE.h"
                0017 #include "EEPARAMS.h"
                0018 #include "PARAMS.h"
                0019 #include "DYNVARS.h"
                0020 #include "GRID.h"
                0021 #ifdef ALLOW_COST_TRACER
                0022 # ifdef ALLOW_PTRACERS
                0023 #  include "PTRACERS_SIZE.h"
                0024 #  include "PTRACERS_PARAMS.h"
                0025 #  include "PTRACERS_FIELDS.h"
                0026 # endif
                0027 #endif
                0028 
                0029 #include "cost.h"
                0030 
                0031 C     == Routine arguments ==
                0032 C     myThid - Thread number for this instance of the routine.
                0033       integer bi, bj
                0034       integer myThid
                0035 
                0036 #ifdef ALLOW_COST_TRACER
                0037 C     == Local variables
                0038       _RL thetaRef
                0039       _RL locfc
                0040 
                0041       integer i, j, k
                0042       integer ig, jg
                0043 ce    some reference temperature
                0044       thetaRef = 24.0D0
                0045 
                0046       locfc = 0. _d 0
                0047 
                0048       k=1
                0049       DO j=1,sNy
                0050          DO i=1,sNx
                0051 #ifdef ALLOW_PTRACERS
                0052             locfc = locfc + maskC(i,j,k,bi,bj)*
                0053      &           ptracer(i,j,k,bi,bj,6)*
                0054      &           rA(i,j,bi,bj)*drF(k)
                0055 #endif
                0056          ENDDO
                0057       ENDDO
                0058 
                0059       objf_tracer(bi,bj) = objf_tracer(bi,bj) + locfc
                0060 
                0061 #ifdef ALLOW_PTRACERS
                0062       print *, 'COST TRACER nach', objf_tracer(bi,bj),
                0063      &     ptracer(83,33,1,1,1,1), ptracer(83,33,2,1,1,1)
                0064 #endif
                0065 
                0066 #endif /* ALLOW_COST_TRACER */
                0067 
                0068       RETURN
                0069       END