Back to home page

MITgcm

 
 

    


File indexing completed on 2023-03-29 05:10:01 UTC

view on githubraw file Latest commit cda1c18f on 2023-03-28 22:31:47 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
616600b8d2 Patr*0045 #ifdef ALLOW_COST_DEPTH
                0046           objf_depth(bi,bj) = 0. _d 0
                0047 #endif
720be40b89 Patr*0048 #ifdef ALLOW_COST_VECTOR
                0049           do i=1,sNx
                0050             objf_vector(i,bi,bj) = 0. _d 0
                0051           end do
                0052 #endif
449f3c105b Patr*0053 c
4a2a8da507 Davi*0054 #ifdef ALLOW_COST
29f6025d09 Jean*0055           do k=1,Nr
449f3c105b Patr*0056             do j=1,sNy
                0057               do i=1,sNx
                0058                 cMeanTheta(i,j,k,bi,bj) = 0. _d 0
                0059                 cMeanUVel(i,j,k,bi,bj)  = 0. _d 0
                0060                 cMeanVVel(i,j,k,bi,bj)  = 0. _d 0
781d8676b2 Patr*0061                 cMeanThetaUVel(i,j,k,bi,bj) = 0. _d 0
                0062                 cMeanThetaVVel(i,j,k,bi,bj) = 0. _d 0
449f3c105b Patr*0063               end do
                0064             end do
                0065           end do
                0066 #endif
                0067 c
9eb96e5404 Patr*0068 #ifdef ALLOW_COST_STATE_FINAL
                0069             do j=1,sNy
f8659cb5d2 Patr*0070              do i=1,sNx
                0071               do k=1,4*Nr
                0072                 objf_state_final(i,j,bi,bj,k) = 0. _d 0
                0073               enddo
                0074               objf_state_final(i,j,bi,bj,4*Nr+1) = 0. _d 0
9eb96e5404 Patr*0075 cph No init. of cost_state_final here,
                0076 cph because we need it in ADM*TLM
                0077               end do
                0078             end do
                0079 #endif
cda1c18f72 Jean*0080        ENDDO
                0081       ENDDO
2dcaa8b9a5 Patr*0082 
869864d4b6 Patr*0083 #ifdef ALLOW_SEAICE
                0084       call seaice_cost_init_varia( mythid )
                0085 #endif
                0086 
6c747cb1b2 Patr*0087 #ifdef ALLOW_THSICE
                0088       call thsice_cost_init_varia( mythid )
                0089 #endif
                0090 
2dcaa8b9a5 Patr*0091 c--   Initialise the "global" parts of the cost function.
                0092       _BEGIN_MASTER( mythid )
                0093         fc         = 0. _d 0
8a270036d8 Gael*0094         glofc      = 0. _d 0
2dcaa8b9a5 Patr*0095       _END_MASTER( mythid )
                0096 
                0097       _BARRIER
                0098 
29f6025d09 Jean*0099       RETURN
                0100       END