Back to home page

MITgcm

 
 

    


File indexing completed on 2026-03-19 05:08:29 UTC

view on githubraw file Latest commit 69361556 on 2026-03-18 21:20:20 UTC
5ed655852f Jean*0001 #include "COST_OPTIONS.h"
2dcaa8b9a5 Patr*0002 
29f6025d09 Jean*0003       SUBROUTINE COST_INIT_VARIA( mythid )
2dcaa8b9a5 Patr*0004 
                0005 c     ==================================================================
869864d4b6 Patr*0006 c     SUBROUTINE cost_init_varia
2dcaa8b9a5 Patr*0007 c     ==================================================================
                0008 c
                0009 c     o Initialise the variable cost function part.
                0010 c
                0011 c     started: Christian Eckert eckert@mit.edu 30-Jun-1999
                0012 c
                0013 c     changed: Christian Eckert eckert@mit.edu 18-Apr-2000
                0014 c
                0015 c              - Restructured the code in order to create a package
                0016 c                for the MITgcmUV.
                0017 c
                0018 c     ==================================================================
869864d4b6 Patr*0019 c     SUBROUTINE cost_init_varia
2dcaa8b9a5 Patr*0020 c     ==================================================================
                0021 
                0022       implicit none
                0023 
                0024 c     == global variables ==
                0025 
                0026 #include "EEPARAMS.h"
                0027 #include "SIZE.h"
                0028 #include "cost.h"
                0029 
                0030 c     == routine arguments ==
                0031       integer mythid
                0032 
                0033 c     == local variables ==
720be40b89 Patr*0034       integer i,j,k
2dcaa8b9a5 Patr*0035       integer bi,bj
                0036 c     == end of interface ==
                0037 
                0038 c--   Initialize the tiled cost function contributions.
cda1c18f72 Jean*0039       DO bj=myByLo(myThid),myByHi(myThid)
                0040         DO bi=myBxLo(myThid),myBxHi(myThid)
29f6025d09 Jean*0041           tile_fc(bi,bj)   = 0. _d 0
2dcaa8b9a5 Patr*0042           objf_atl(bi,bj)  = 0. _d 0
                0043           objf_test(bi,bj) = 0. _d 0
bbf42b7711 Patr*0044           objf_tracer(bi,bj) = 0. _d 0
720be40b89 Patr*0045 #ifdef ALLOW_COST_VECTOR
                0046           do i=1,sNx
                0047             objf_vector(i,bi,bj) = 0. _d 0
                0048           end do
                0049 #endif
449f3c105b Patr*0050 c
4a2a8da507 Davi*0051 #ifdef ALLOW_COST
29f6025d09 Jean*0052           do k=1,Nr
449f3c105b Patr*0053             do j=1,sNy
                0054               do i=1,sNx
                0055                 cMeanTheta(i,j,k,bi,bj) = 0. _d 0
                0056                 cMeanUVel(i,j,k,bi,bj)  = 0. _d 0
                0057                 cMeanVVel(i,j,k,bi,bj)  = 0. _d 0
781d8676b2 Patr*0058                 cMeanThetaUVel(i,j,k,bi,bj) = 0. _d 0
                0059                 cMeanThetaVVel(i,j,k,bi,bj) = 0. _d 0
449f3c105b Patr*0060               end do
                0061             end do
                0062           end do
                0063 #endif
                0064 c
9eb96e5404 Patr*0065 #ifdef ALLOW_COST_STATE_FINAL
                0066             do j=1,sNy
f8659cb5d2 Patr*0067              do i=1,sNx
                0068               do k=1,4*Nr
                0069                 objf_state_final(i,j,bi,bj,k) = 0. _d 0
                0070               enddo
                0071               objf_state_final(i,j,bi,bj,4*Nr+1) = 0. _d 0
9eb96e5404 Patr*0072 cph No init. of cost_state_final here,
                0073 cph because we need it in ADM*TLM
                0074               end do
                0075             end do
                0076 #endif
cda1c18f72 Jean*0077        ENDDO
                0078       ENDDO
2dcaa8b9a5 Patr*0079 
869864d4b6 Patr*0080 #ifdef ALLOW_SEAICE
                0081       call seaice_cost_init_varia( mythid )
                0082 #endif
                0083 
6c747cb1b2 Patr*0084 #ifdef ALLOW_THSICE
                0085       call thsice_cost_init_varia( mythid )
                0086 #endif
                0087 
2dcaa8b9a5 Patr*0088 c--   Initialise the "global" parts of the cost function.
                0089       _BEGIN_MASTER( mythid )
                0090         fc         = 0. _d 0
8a270036d8 Gael*0091         glofc      = 0. _d 0
2dcaa8b9a5 Patr*0092       _END_MASTER( mythid )
                0093 
                0094       _BARRIER
                0095 
29f6025d09 Jean*0096       RETURN
                0097       END