﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
940	Important: Corrected the state indices counters	arango		"* Corrected conflict with the state variables counters for **isMtke** and **isWvel**. In **mod_ncparam.F**, we now have:
 {{{
!
!  Set IDs for state some state variables.
!
      ic=5
#ifdef SOLVE3D
      DO i=1,MT
        ic=ic+1
        isTvar(i)=ic
      END DO
# if defined GLS_MIXING || defined MY25_MIXING
      ic=ic+1
      isMtke=ic
# endif
      ic=ic+1
      isWvel=ic
#endif
#if defined ADJUST_WSTRESS || defined FORCING_SV     || \
    defined HESSIAN_FSV    || defined SO_SEMI        || \
    defined STOCHASTIC_OPT
      isUstr=ic+1
      isVstr=ic+2
      ic=ic+2
#endif
#ifdef SOLVE3D
# if defined ADJUST_STFLUX  || defined FORCING_SV     || \
     defined HESSIAN_FSV    || defined SO_SEMI        || \
     defined STOCHASTIC_OPT
      DO i=1,MT
        ic=ic+1
        isTsur(i)=ic
      END DO
# endif
#endif
}}}
 The state variables indices (order is necessary). Currently, the maximum number of state variables in 3D applications is **9+2*MT**. If **MT=2** (temperature and salinity), the state variables have the following order:
 {{{
      1,   2,    3,4,5,      6,      7,  8,9,  10,  11,     12,     13
   zeta,ubar, vbar,u,v,Tvar(1),Tvar(2),TKE,W,Ustr,Vstr,Tsur(1),Tsur(2)
}}}
 Many thanks to John Warner for bringing this issue to my attention.

* Provided more information in **mod_param.F** for state variables lateral boundary conditions indices to the LBC structure:

{{{
#ifdef SOLVE3D
      nLBCvar=5+MT                 ! zeta, ubar, vbar, u, v, Tvar(1:MT)
# if defined GLS_MIXING || defined MY25_MIXING
      nLBCvar=nLBCvar+1            ! TKE
# endif
#else
      nLBCvar=3                    ! zeta, ubar, vbar
#endif
}}}

* The state variables in **mod_scalars.F** are allocated as vectors of size **9+2*MT**.
"	bug	closed	major	Release ROMS/TOMS 4.2	Nonlinear	4.2	Fixed		
