C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/dgoldberg/streamice/Attic/cost_test.F,v 1.2 2012/07/20 13:40:36 heimbach dead $ C $Name: $ #include "COST_CPPOPTIONS.h" subroutine cost_test( myThid ) C /==========================================================\ C | subroutine cost_test | 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_STREAMICE # include "STREAMICE.h" #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_TEST C == Local variables _RL thetaRef integer i, j, k integer ig, jg integer itlo,ithi integer jtlo,jthi jtlo = mybylo(mythid) jthi = mybyhi(mythid) itlo = mybxlo(mythid) ithi = mybxhi(mythid) C-- Calculate mask for tracer cells (0 => land, 1 => water) k=1 C-- Calculate cost function on tile of this instance do bj = jtlo,jthi do bi = itlo,ithi do j=1,sNy jg = myYGlobalLo-1+(bj-1)*sNy+j do i=1,sNx ig = myXGlobalLo-1+(bi-1)*sNx+i print *, 'ph-str-test i,j ', & h_streamice(i,j,bi,bj) if (j.eq.1 .or. j.eq.sNy) then objf_test(bi,bj) = objf_test(bi,bj) & + u_streamice(i,j,bi,bj)**2 else objf_test(bi,bj) = objf_test(bi,bj) & + u_streamice(i,j,bi,bj)**2 endif end do end do end do end do #endif RETURN END