Back to home page

MITgcm

 
 

    


File indexing completed on 2023-09-21 05:10:48 UTC

view on githubraw file Latest commit 96b00645 on 2023-09-20 15:15:14 UTC
96b006450c dngo*0001 #include "STREAMICE_OPTIONS.h"
                0002 #ifdef ALLOW_AUTODIFF
                0003 # include "AUTODIFF_OPTIONS.h"
                0004 #endif
                0005 #ifdef ALLOW_COST
                0006 # include "COST_OPTIONS.h"
                0007 #endif
                0008 
                0009       subroutine streamice_cost_accum ( myIter, myThid )
                0010 C     *==========================================================*
                0011 C     | subroutine cost_test                                     |
                0012 C     | o this routine accumulates the STREAMICE cost func-      |
                0013 C     |   tion at each time step, called from cost_tile          |
                0014 C     *==========================================================*
                0015 C     |                                                          |
                0016 C     | Notes                                                    |
                0017 C     | =====                                                    |
                0018 C     *==========================================================*
                0019       IMPLICIT NONE
                0020 
                0021 C     == Global variables ===
                0022 #include "SIZE.h"
                0023 #include "EEPARAMS.h"
                0024 #include "PARAMS.h"
                0025 #include "DYNVARS.h"
                0026 #include "GRID.h"
                0027 #ifdef ALLOW_STREAMICE
                0028 # include "STREAMICE.h"
                0029 #endif
                0030 
                0031 #ifdef ALLOW_COST
                0032 # include "cost.h"
                0033 #endif
                0034 #ifdef ALLOW_AUTODIFF_TAMC
                0035 # include "tamc.h"
                0036 #endif
                0037 
                0038 C     == Routine arguments ==
                0039 C     myThid - Thread number for this instance of the routine.
                0040       integer myIter, myThid
                0041 
                0042 #ifdef ALLOW_COST
                0043 C     == Local variables
                0044       _RL thetaRef, HAF
                0045 
                0046       integer i, j, k, bi, bj
                0047       integer ig, jg
                0048       integer itlo,ithi
                0049       integer jtlo,jthi
                0050       integer il
                0051       integer itime
                0052       INTEGER  ILNBLNK
                0053       EXTERNAL ILNBLNK
                0054 
                0055       jtlo = myByLo(myThid)
                0056       jthi = myByHi(myThid)
                0057       itlo = myBxLo(myThid)
                0058       ithi = myBxHi(myThid)
                0059 
                0060 C--   Calculate mask for tracer cells  (0 => land, 1 => water)
                0061 c       k=1
                0062 
                0063 c#ifdef ALLOW_AUTODIFF_TAMC
                0064 cCADJ STORE surf_el_streamice = comlev1, key = ikey_dynamics,
                0065 cCADJ &     kind = isbyte
                0066 cCADJ STORE H_streamice_prev  = comlev1, key = ikey_dynamics,
                0067 cCADJ &     kind = isbyte
                0068 cCADJ STORE H_streamice       = comlev1, key = ikey_dynamics,
                0069 cCADJ &     kind = isbyte
                0070 c#endif
                0071 
                0072 C--   Calculate cost function on tile of this instance
                0073       do bj = jtlo,jthi
                0074         do bi = itlo,ithi
                0075           do j=1,sNy
                0076             do i=1,sNx
                0077 
                0078              if (streamice_cost_mask(i,j,bi,bj).eq.1.0) THEN
                0079               cost_func1_streamice (bi,bj) =
                0080      &        cost_func1_streamice (bi,bj) + 0.0
                0081              endif
                0082 
                0083             end do
                0084           end do
                0085         end do
                0086       end do
                0087 
                0088 #ifdef ALLOW_STREAMICE_TC_COST
                0089       IF ( STREAMICE_do_timedep_cost ) THEN
                0090        CALL STREAMICE_COST_REG_ACCUM (myIter, myThid)
                0091        DO itime = 1,streamiceMaxCostLevel
                0092         IF (myIter==streamice_surf_cost_timesteps(itime)) THEN
                0093          CALL STREAMICE_COST_SURF_ACCUM (myIter, myThid)
                0094         ENDIF
                0095         IF (myIter==streamice_vel_cost_timesteps(itime)) THEN
                0096          CALL STREAMICE_COST_VEL_ACCUM (myIter, myThid)
                0097         ENDIF
                0098        ENDDO
                0099       ENDIF
                0100 #endif
                0101 
                0102 #endif
                0103 
                0104       RETURN
                0105       END