C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/cost/cost_tracer.F,v 1.4 2003/06/27 01:54:20 heimbach Exp $ #include "COST_CPPOPTIONS.h" #ifdef ALLOW_PTRACERS # include "PTRACERS_OPTIONS.h" #endif subroutine cost_tracer( bi, bj, myThid ) C /==========================================================\ C | subroutine cost_tracer | C | o this routine computes the cost function for the tiles | C | of this processor | C |==========================================================| C | | C | Notes | C | ===== | C \==========================================================/ IMPLICIT NONE C == Global variables === #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" #include "DYNVARS.h" #include "GRID.h" #ifdef ALLOW_COST_TRACER # if (defined (ALLOW_PASSIVE_TRACER)) # include "TR1.h" # elif (defined (ALLOW_PTRACERS)) # include "PTRACERS.h" # endif #endif #include "cost.h" C == Routine arguments == C myThid - Thread number for this instance of the routine. integer bi, bj integer myThid #ifdef ALLOW_COST_TRACER C == Local variables _RL thetaRef _RL locfc integer i, j, k integer ig, jg ce some reference temperature thetaRef = 24.0D0 locfc = 0. _d 0 k=1 DO j=1,sNy DO i=1,sNx #if (defined (ALLOW_PASSIVE_TRACER)) locfc = locfc + maskC(i,j,k,bi,bj)* & lambdaTr1ClimRelax*Tr1(i,j,k,bi,bj)* & rA(i,j,bi,bj)*drF(k)*deltaTtracer #elif (defined (ALLOW_PTRACERS)) locfc = locfc + maskC(i,j,k,bi,bj)* & lambdaTr1ClimRelax*ptracer(i,j,k,bi,bj,1)* & rA(i,j,bi,bj)*drF(k)*deltaTtracer #endif ENDDO ENDDO objf_tracer(bi,bj) = objf_tracer(bi,bj) + locfc #if (defined (ALLOW_PASSIVE_TRACER)) print *, 'COST TRACER nach', objf_tracer(bi,bj), & Tr1(83,33,1,1,1), Tr1(83,33,2,1,1) #elif (defined (ALLOW_PTRACERS)) print *, 'COST TRACER nach', objf_tracer(bi,bj), & ptracer(83,33,1,1,1,1), ptracer(83,33,2,1,1,1) #endif #endif /* ALLOW_COST_TRACER */ RETURN END