










      subroutine init_scalars (ierr)      


      use Agrif_Util
      interface
        subroutine Sub_Loop_init_scalars(ierr,vname,ismooth,dt,csmooth,d
     &ate_str,bry_id,ncidbtf,ncidqbar,ncidclm,ncidbulk,ncidfrc,ncidavg,n
     &cidhis,ncidrst,rx1,rx0,bc_crss,latmax,latmin,lonmax,lonmin,Cu_max,
     &Cu_min,grdmax,grdmin,hmax,hmin,volume,avgkp,avgpe,avgke,bc_count,t
     &ile_count,nrecavg,nrechis,nrecrst,trd_count,CPU_time,proc,may_day_
     &flag,first_time,synchro_flag,nfast,nnew,nrhs,nstp,ntstart,knew,krh
     &s,kstp,iic,PREDICTOR_2D_STEP,tdays,time,mynode,numthreads,padd_E,M
     &m,padd_X,Lm)
          implicit none
      integer(4), parameter :: LLm0 = 41
      integer(4), parameter :: MMm0 = 42
      integer(4), parameter :: N = 32
      integer(4), parameter :: N_sl = 0
      integer(4), parameter :: NP_XI = 1
      integer(4), parameter :: NP_ETA = 4
      integer(4), parameter :: NNODES = NP_XI*NP_ETA
      integer(4), parameter :: NPP = 1
      integer(4), parameter :: NSUB_X = 1
      integer(4), parameter :: NSUB_E = 1
      integer(4), parameter :: NWEIGHT = 1000
      integer(4), parameter :: Ntides = 8
      integer(4), parameter :: stdout = 6
      integer(4), parameter :: Np = N+1
      integer(4), parameter :: NpHz = (N+1+N_sl)
      integer(4), parameter :: NSA = 28
      real, parameter :: Vtransform = 2
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: ntrc_temp = 1
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_subs = 0
      integer(4), parameter :: ntrc_substot = 0
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: NTA = itemp+ntrc_salt
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      integer(4), parameter :: NTot = NT
      integer(4), parameter :: isalt = itemp+1
      integer(4), parameter :: ntrc_diabio = 0
      integer(4), parameter :: ntrc_diats = 0
      integer(4), parameter :: ntrc_diauv = 0
      integer(4), parameter :: ntrc_diavrt = 0
      integer(4), parameter :: ntrc_diaek = 0
      integer(4), parameter :: ntrc_diapv = 0
      integer(4), parameter :: ntrc_diaeddy = 0
      integer(4), parameter :: ntrc_surf = 0
      real, parameter :: pi = 3.14159265358979323846D0
      real, parameter :: deg2rad = pi/180.D0
      real, parameter :: rad2deg = 180.D0/pi
      real, parameter :: Eradius = 6371315.0D0
      real, parameter :: Erotation = 7.292115090D-5
      real, parameter :: day2sec = 86400.D0
      real, parameter :: sec2day = 1.D0/86400.D0
      real, parameter :: year2day = 365.25D0
      real, parameter :: day2year = 1.D0/365.25D0
      real, parameter :: jul_off = 2440000.D0
      real, parameter :: g = 9.81D0
      real, parameter :: Cp = 3985.0D0
      real, parameter :: vonKar = 0.41D0
      real, parameter :: spval = -999.0D0
      logical, parameter :: mask_val = .true.
      real, parameter :: Gslope_max = 1.D0
      real, parameter :: Rslope_max = 0.05D0
      integer(4), parameter :: filetype_his = 1
      integer(4), parameter :: filetype_avg = 2
      integer(4), parameter :: filetype_dia = 3
      integer(4), parameter :: filetype_dia_avg = 4
      integer(4), parameter :: filetype_diaM = 5
      integer(4), parameter :: filetype_diaM_avg = 6
      integer(4), parameter :: filetype_diags_vrt = 7
      integer(4), parameter :: filetype_diags_vrt_avg = 8
      integer(4), parameter :: filetype_diags_ek = 9
      integer(4), parameter :: filetype_diags_ek_avg = 10
      integer(4), parameter :: filetype_diags_pv = 11
      integer(4), parameter :: filetype_diags_pv_avg = 12
      integer(4), parameter :: filetype_diags_eddy_avg = 17
      integer(4), parameter :: filetype_surf = 13
      integer(4), parameter :: filetype_surf_avg = 14
      integer(4), parameter :: filetype_diabio = 15
      integer(4), parameter :: filetype_diabio_avg = 16
      integer(4), parameter :: filetype_abl = 18
      integer(4), parameter :: filetype_abl_avg = 19
      integer(4), parameter :: indxTime = 1
      integer(4), parameter :: indxZ = 2
      integer(4), parameter :: indxUb = 3
      integer(4), parameter :: indxVb = 4
      integer(4), parameter :: indxU = 6
      integer(4), parameter :: indxV = 7
      integer(4), parameter :: indxT = indxV+1
      integer(4), parameter :: indxS = indxV+ntrc_temp+1
      integer(4), parameter :: indxBSD = indxV+ntrc_temp+ntrc_salt+ntrc_
     &pas+ntrc_bio+1
      integer(4), parameter :: indxBSS = 101
      integer(4), parameter :: indxO = indxV+ntrc_temp+ntrc_salt+ntrc_pa
     &s+ntrc_bio+ntrc_sed+ntrc_substot+ntrc_diats+ntrc_diauv+ntrc_diavrt
     &+ntrc_diaek+ntrc_diapv+ntrc_diaeddy+ntrc_surf+ntrc_diabio+1
      integer(4), parameter :: indxW = indxO+1
      integer(4), parameter :: indxR = indxO+2
      integer(4), parameter :: indxVisc = indxO+3
      integer(4), parameter :: indxDiff = indxO+4
      integer(4), parameter :: indxAkv = indxO+5
      integer(4), parameter :: indxAkt = indxO+6
      integer(4), parameter :: indxAks = indxAkv+ntrc_temp+4
      integer(4), parameter :: indxHbl = indxAkv+ntrc_temp+5
      integer(4), parameter :: indxHbbl = indxAkv+ntrc_temp+6
      integer(4), parameter :: indxSSH = indxAkv+ntrc_temp+12
      integer(4), parameter :: indxbvf = indxSSH+1
      integer(4), parameter :: indxSUSTR = indxSSH+2
      integer(4), parameter :: indxSVSTR = indxSSH+3
      integer(4), parameter :: indxTime2 = indxSSH+4
      integer(4), parameter :: indxShflx = indxSUSTR+5
      integer(4), parameter :: indxSwflx = indxShflx+1
      integer(4), parameter :: indxShflx_rsw = indxShflx+2
      integer(4), parameter :: indxSST = indxShflx_rsw+1
      integer(4), parameter :: indxdQdSST = indxShflx_rsw+2
      integer(4), parameter :: indxSSS = indxSST+2
      integer(4), parameter :: indxWstr = indxSUSTR+23
      integer(4), parameter :: indxUWstr = indxSUSTR+24
      integer(4), parameter :: indxVWstr = indxSUSTR+25
      integer(4), parameter :: indxBostr = indxSUSTR+26
      integer(4), parameter :: indxBustr = indxSUSTR+27
      integer(4), parameter :: indxBvstr = indxBustr+1
      integer(4), parameter :: indxWWA = indxSUSTR+42
      integer(4), parameter :: indxWWD = indxWWA+1
      integer(4), parameter :: indxWWP = indxWWA+2
      integer(4), parameter :: r2dvar = 0
      integer(4), parameter :: u2dvar = 1
      integer(4), parameter :: v2dvar = 2
      integer(4), parameter :: p2dvar = 3
      integer(4), parameter :: r3dvar = 4
      integer(4), parameter :: u3dvar = 5
      integer(4), parameter :: v3dvar = 6
      integer(4), parameter :: p3dvar = 7
      integer(4), parameter :: w3dvar = 8
      integer(4), parameter :: pw3dvar = 11
      integer(4), parameter :: b3dvar = 12
      integer(4) :: ismooth
      real :: dt
      real :: csmooth
      character(80) :: date_str
      integer(4) :: bry_id
      integer(4) :: ncidbtf
      integer(4) :: ncidqbar
      integer(4) :: ncidclm
      integer(4) :: ncidbulk
      integer(4) :: ncidfrc
      integer(4) :: ncidavg
      integer(4) :: ncidhis
      integer(4) :: ncidrst
      real :: rx1
      real :: rx0
      real(8) :: bc_crss
      real :: latmax
      real :: latmin
      real :: lonmax
      real :: lonmin
      real :: Cu_max
      real :: Cu_min
      real :: grdmax
      real :: grdmin
      real :: hmax
      real :: hmin
      real(8) :: volume
      real(8) :: avgkp
      real(8) :: avgpe
      real(8) :: avgke
      integer(4) :: bc_count
      integer(4) :: tile_count
      integer(4) :: nrecavg
      integer(4) :: nrechis
      integer(4) :: nrecrst
      integer(4) :: trd_count
      integer(4) :: may_day_flag
      integer(4) :: first_time
      logical :: synchro_flag
      integer(4) :: nfast
      integer(4) :: nnew
      integer(4) :: nrhs
      integer(4) :: nstp
      integer(4) :: ntstart
      integer(4) :: knew
      integer(4) :: krhs
      integer(4) :: kstp
      integer(4) :: iic
      logical :: PREDICTOR_2D_STEP
      real :: tdays
      real :: time
      integer(4) :: mynode
      integer(4) :: numthreads
      integer(4) :: padd_E
      integer(4) :: Mm
      integer(4) :: padd_X
      integer(4) :: Lm
      character(75), dimension(1:20,1:1000) :: vname
      real(4), dimension(0:31,0:NPP) :: CPU_time
      integer(4), dimension(0:31,0:NPP) :: proc
      integer(4) :: ierr
        end subroutine Sub_Loop_init_scalars

      end interface
      integer(4) :: ierr
      

        call Sub_Loop_init_scalars(ierr, Agrif_tabvars_c(18)%carray2, Ag
     &rif_tabvars_i(250)%iarray0, Agrif_tabvars_r(3)%array0, Agrif_tabva
     &rs_r(73)%array0, Agrif_tabvars_c(1)%carray0, Agrif_tabvars_i(280)%
     &iarray0, Agrif_tabvars_i(34)%iarray0, Agrif_tabvars_i(33)%iarray0,
     & Agrif_tabvars_i(31)%iarray0, Agrif_tabvars_i(30)%iarray0, Agrif_t
     &abvars_i(29)%iarray0, Agrif_tabvars_i(100)%iarray0, Agrif_tabvars_
     &i(61)%iarray0, Agrif_tabvars_i(47)%iarray0, Agrif_tabvars_r(28)%ar
     &ray0, Agrif_tabvars_r(27)%array0, Agrif_tabvars_r(54)%darray0, Agr
     &if_tabvars_r(44)%array0, Agrif_tabvars_r(43)%array0, Agrif_tabvars
     &_r(42)%array0, Agrif_tabvars_r(41)%array0, Agrif_tabvars_r(40)%arr
     &ay0, Agrif_tabvars_r(39)%array0, Agrif_tabvars_r(38)%array0, Agrif
     &_tabvars_r(37)%array0, Agrif_tabvars_r(36)%array0, Agrif_tabvars_r
     &(35)%array0, Agrif_tabvars_r(50)%darray0, Agrif_tabvars_r(53)%darr
     &ay0, Agrif_tabvars_r(52)%darray0, Agrif_tabvars_r(51)%darray0, Agr
     &if_tabvars_i(170)%iarray0, Agrif_tabvars_i(168)%iarray0, Agrif_tab
     &vars_i(101)%iarray0, Agrif_tabvars_i(62)%iarray0, Agrif_tabvars_i(
     &48)%iarray0, Agrif_tabvars_i(175)%iarray0, Agrif_tabvars(8)%sarray
     &2, Agrif_tabvars_i(174)%iarray2, Agrif_tabvars_i(167)%iarray0, Agr
     &if_tabvars_i(169)%iarray0, Agrif_tabvars_l(6)%larray0, Agrif_tabva
     &rs_i(161)%iarray0, Agrif_tabvars_i(155)%iarray0, Agrif_tabvars_i(1
     &54)%iarray0, Agrif_tabvars_i(153)%iarray0, Agrif_tabvars_i(158)%ia
     &rray0, Agrif_tabvars_i(150)%iarray0, Agrif_tabvars_i(149)%iarray0,
     & Agrif_tabvars_i(148)%iarray0, Agrif_tabvars_i(147)%iarray0, Agrif
     &_tabvars_l(3)%larray0, Agrif_tabvars_r(8)%array0, Agrif_tabvars_r(
     &5)%array0, Agrif_tabvars_i(176)%iarray0, Agrif_tabvars_i(157)%iarr
     &ay0, Agrif_tabvars_i(14)%iarray0, Agrif_tabvars_i(4)%iarray0, Agri
     &f_tabvars_i(13)%iarray0, Agrif_tabvars_i(2)%iarray0)

      end


      subroutine Sub_Loop_init_scalars(ierr,vname,ismooth,dt,csmooth,dat
     &e_str,bry_id,ncidbtf,ncidqbar,ncidclm,ncidbulk,ncidfrc,ncidavg,nci
     &dhis,ncidrst,rx1,rx0,bc_crss,latmax,latmin,lonmax,lonmin,Cu_max,Cu
     &_min,grdmax,grdmin,hmax,hmin,volume,avgkp,avgpe,avgke,bc_count,til
     &e_count,nrecavg,nrechis,nrecrst,trd_count,CPU_time,proc,may_day_fl
     &ag,first_time,synchro_flag,nfast,nnew,nrhs,nstp,ntstart,knew,krhs,
     &kstp,iic,PREDICTOR_2D_STEP,tdays,time,mynode,numthreads,padd_E,Mm,
     &padd_X,Lm)

      use Agrif_Types, only : Agrif_tabvars

      implicit none

      integer(4), parameter :: LLm0 = 41
      integer(4), parameter :: MMm0 = 42
      integer(4), parameter :: N = 32
      integer(4), parameter :: N_sl = 0
      integer(4), parameter :: NP_XI = 1
      integer(4), parameter :: NP_ETA = 4
      integer(4), parameter :: NNODES = NP_XI*NP_ETA
      integer(4), parameter :: NPP = 1
      integer(4), parameter :: NSUB_X = 1
      integer(4), parameter :: NSUB_E = 1
      integer(4), parameter :: NWEIGHT = 1000
      integer(4), parameter :: Ntides = 8
      integer(4), parameter :: stdout = 6
      integer(4), parameter :: Np = N+1
      integer(4), parameter :: NpHz = (N+1+N_sl)
      integer(4), parameter :: NSA = 28
      real, parameter :: Vtransform = 2
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: ntrc_temp = 1
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_subs = 0
      integer(4), parameter :: ntrc_substot = 0
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: NTA = itemp+ntrc_salt
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      integer(4), parameter :: NTot = NT
      integer(4), parameter :: isalt = itemp+1
      integer(4), parameter :: ntrc_diabio = 0
      integer(4), parameter :: ntrc_diats = 0
      integer(4), parameter :: ntrc_diauv = 0
      integer(4), parameter :: ntrc_diavrt = 0
      integer(4), parameter :: ntrc_diaek = 0
      integer(4), parameter :: ntrc_diapv = 0
      integer(4), parameter :: ntrc_diaeddy = 0
      integer(4), parameter :: ntrc_surf = 0
      real, parameter :: pi = 3.14159265358979323846D0
      real, parameter :: deg2rad = pi/180.D0
      real, parameter :: rad2deg = 180.D0/pi
      real, parameter :: Eradius = 6371315.0D0
      real, parameter :: Erotation = 7.292115090D-5
      real, parameter :: day2sec = 86400.D0
      real, parameter :: sec2day = 1.D0/86400.D0
      real, parameter :: year2day = 365.25D0
      real, parameter :: day2year = 1.D0/365.25D0
      real, parameter :: jul_off = 2440000.D0
      real, parameter :: g = 9.81D0
      real, parameter :: Cp = 3985.0D0
      real, parameter :: vonKar = 0.41D0
      real, parameter :: spval = -999.0D0
      logical, parameter :: mask_val = .true.
      real, parameter :: Gslope_max = 1.D0
      real, parameter :: Rslope_max = 0.05D0
      integer(4), parameter :: filetype_his = 1
      integer(4), parameter :: filetype_avg = 2
      integer(4), parameter :: filetype_dia = 3
      integer(4), parameter :: filetype_dia_avg = 4
      integer(4), parameter :: filetype_diaM = 5
      integer(4), parameter :: filetype_diaM_avg = 6
      integer(4), parameter :: filetype_diags_vrt = 7
      integer(4), parameter :: filetype_diags_vrt_avg = 8
      integer(4), parameter :: filetype_diags_ek = 9
      integer(4), parameter :: filetype_diags_ek_avg = 10
      integer(4), parameter :: filetype_diags_pv = 11
      integer(4), parameter :: filetype_diags_pv_avg = 12
      integer(4), parameter :: filetype_diags_eddy_avg = 17
      integer(4), parameter :: filetype_surf = 13
      integer(4), parameter :: filetype_surf_avg = 14
      integer(4), parameter :: filetype_diabio = 15
      integer(4), parameter :: filetype_diabio_avg = 16
      integer(4), parameter :: filetype_abl = 18
      integer(4), parameter :: filetype_abl_avg = 19
      integer(4), parameter :: indxTime = 1
      integer(4), parameter :: indxZ = 2
      integer(4), parameter :: indxUb = 3
      integer(4), parameter :: indxVb = 4
      integer(4), parameter :: indxU = 6
      integer(4), parameter :: indxV = 7
      integer(4), parameter :: indxT = indxV+1
      integer(4), parameter :: indxS = indxV+ntrc_temp+1
      integer(4), parameter :: indxBSD = indxV+ntrc_temp+ntrc_salt+ntrc_
     &pas+ntrc_bio+1
      integer(4), parameter :: indxBSS = 101
      integer(4), parameter :: indxO = indxV+ntrc_temp+ntrc_salt+ntrc_pa
     &s+ntrc_bio+ntrc_sed+ntrc_substot+ntrc_diats+ntrc_diauv+ntrc_diavrt
     &+ntrc_diaek+ntrc_diapv+ntrc_diaeddy+ntrc_surf+ntrc_diabio+1
      integer(4), parameter :: indxW = indxO+1
      integer(4), parameter :: indxR = indxO+2
      integer(4), parameter :: indxVisc = indxO+3
      integer(4), parameter :: indxDiff = indxO+4
      integer(4), parameter :: indxAkv = indxO+5
      integer(4), parameter :: indxAkt = indxO+6
      integer(4), parameter :: indxAks = indxAkv+ntrc_temp+4
      integer(4), parameter :: indxHbl = indxAkv+ntrc_temp+5
      integer(4), parameter :: indxHbbl = indxAkv+ntrc_temp+6
      integer(4), parameter :: indxSSH = indxAkv+ntrc_temp+12
      integer(4), parameter :: indxbvf = indxSSH+1
      integer(4), parameter :: indxSUSTR = indxSSH+2
      integer(4), parameter :: indxSVSTR = indxSSH+3
      integer(4), parameter :: indxTime2 = indxSSH+4
      integer(4), parameter :: indxShflx = indxSUSTR+5
      integer(4), parameter :: indxSwflx = indxShflx+1
      integer(4), parameter :: indxShflx_rsw = indxShflx+2
      integer(4), parameter :: indxSST = indxShflx_rsw+1
      integer(4), parameter :: indxdQdSST = indxShflx_rsw+2
      integer(4), parameter :: indxSSS = indxSST+2
      integer(4), parameter :: indxWstr = indxSUSTR+23
      integer(4), parameter :: indxUWstr = indxSUSTR+24
      integer(4), parameter :: indxVWstr = indxSUSTR+25
      integer(4), parameter :: indxBostr = indxSUSTR+26
      integer(4), parameter :: indxBustr = indxSUSTR+27
      integer(4), parameter :: indxBvstr = indxBustr+1
      integer(4), parameter :: indxWWA = indxSUSTR+42
      integer(4), parameter :: indxWWD = indxWWA+1
      integer(4), parameter :: indxWWP = indxWWA+2
      integer(4), parameter :: r2dvar = 0
      integer(4), parameter :: u2dvar = 1
      integer(4), parameter :: v2dvar = 2
      integer(4), parameter :: p2dvar = 3
      integer(4), parameter :: r3dvar = 4
      integer(4), parameter :: u3dvar = 5
      integer(4), parameter :: v3dvar = 6
      integer(4), parameter :: p3dvar = 7
      integer(4), parameter :: w3dvar = 8
      integer(4), parameter :: pw3dvar = 11
      integer(4), parameter :: b3dvar = 12
      integer(4) :: ismooth
      real :: dt
      real :: csmooth
      character(80) :: date_str
      integer(4) :: bry_id
      integer(4) :: ncidbtf
      integer(4) :: ncidqbar
      integer(4) :: ncidclm
      integer(4) :: ncidbulk
      integer(4) :: ncidfrc
      integer(4) :: ncidavg
      integer(4) :: ncidhis
      integer(4) :: ncidrst
      real :: rx1
      real :: rx0
      real(8) :: bc_crss
      real :: latmax
      real :: latmin
      real :: lonmax
      real :: lonmin
      real :: Cu_max
      real :: Cu_min
      real :: grdmax
      real :: grdmin
      real :: hmax
      real :: hmin
      real(8) :: volume
      real(8) :: avgkp
      real(8) :: avgpe
      real(8) :: avgke
      integer(4) :: bc_count
      integer(4) :: tile_count
      integer(4) :: nrecavg
      integer(4) :: nrechis
      integer(4) :: nrecrst
      integer(4) :: trd_count
      integer(4) :: may_day_flag
      integer(4) :: first_time
      logical :: synchro_flag
      integer(4) :: nfast
      integer(4) :: nnew
      integer(4) :: nrhs
      integer(4) :: nstp
      integer(4) :: ntstart
      integer(4) :: knew
      integer(4) :: krhs
      integer(4) :: kstp
      integer(4) :: iic
      logical :: PREDICTOR_2D_STEP
      real :: tdays
      real :: time
      integer(4) :: mynode
      integer(4) :: numthreads
      integer(4) :: padd_E
      integer(4) :: Mm
      integer(4) :: padd_X
      integer(4) :: Lm
      character(75), dimension(1:20,1:1000) :: vname
      real(4), dimension(0:31,0:NPP) :: CPU_time
      integer(4), dimension(0:31,0:NPP) :: proc
      integer(4) :: ierr

                   

                                             
      integer(4) :: i
      integer(4) :: j
      integer(4) :: itrc
      integer(4) :: lvar
      integer(4) :: lenstr
                                  
      character(20) :: nametrc
      character(20) :: unitt
                                  
      character(60) :: vname1
      character(60) :: vname3
                                    
      integer(4) :: omp_get_num_threads
                                            
                             
                                            

                                                             
                     
                        

                                                            
                                           
                                                               
                                    
                                      
                                                          

                       

                                    

                        
                              

                       
                          

                                                
                                             
                          

                        

                                 

                                                
                        

                                                              
                      
                              

                                       
                                                                     
                                          
                         

                             

                             

                            

                            

                                             

                            

                                     

                                                               

                         

                                                      
                                                      
                                                                  
                               

                               

                              

                              

                               

                              

                              

                                

                             

                                                                  
                                                                       
                                                                 
                                 
                                
                                                                       
                                                                 
                                                                 
                                                                 
                                                        
                                                                       
                                                                 
                                                                 
            
                                              
                                                   
                     
                              
                               
                                 
                                                  
                                                                       
                                                                 
                                                                 
                        
                      
                           
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                    
                           
                                      
                             
                                                 
                                                                       
                                                                 
                     
                                                      
                                                                       
                                                                 
              
                                          
                                                                       
                                                                 
       
                                                           
      real(8) :: Cu_Nbq_X
      real(8) :: Cu_Nbq_Y
      real(8) :: Cu_Nbq_Z
                                             
                                                                       
                                                                 
              
                                                  
                                                                       
                                                                 
              
                                  
                                           
                                                  
                                                                   
                                                               
                                                      
                                                                       
                                                                 
                      
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                        
                                
                                                                       
                                                                 
                                                        

                                                                       
                                                                 
                  
                                                                       
                                                                 
                                                                 
                                                                 
                  

                          

              
                             

                  
                               

                 
                                

                       
                                   

                                                  
                                                  
                                                         
                                                         
                                                             
                                                   
                                                   
                                                       
                                                   
                                               
                                 
                                                       
                                                   
                                               
                                 
                                                     
                                                     
                                       
                                       
                                                 
                                                 
                                                   
                               
                               
                               
                                 
                                                    

                        
                   
                                      
                                      
                                                  
                                                    
                                             
                                                  
                              
                                                
                                  
                                                   
                                                    
                                               
                               
                                 
                                 
                                                 
                                
                                                    
                                  
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                      
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                         

                                 
      integer(4) :: iloop
      integer(4) :: indextemp
                                                
                                                         

                             
                                  

                      
                               

                      
                                         

                                 
                                                                       
                                                                 
                              

                                                                       
                                                                 
                                                                 
    
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                 

                        
                                             

                        
                                             

                         
                                              

                        
                                              

                        
                                   

                                     
                                                          

                          
                                     

                                         
                                       

                          
                                                                  

                                    
                                                                     

                        
                                   

                         
                                       

                          
                                        

                          
                                        

                          
                                        

                                     
                                                                

                                                                
      integer(4) :: indxWEB
      integer(4) :: indxWED
      integer(4) :: indxWER
                                                                       
                                                                 
                                                          

                                                                       
                                                                 
                                                                 
            
                                                                       
                                                                 
                                                                 
       

                                           
                                                       
                                                                       
                                                                 
                                                                 
                              
                                                                       
                                                                 
    
                                                                       
                                                                 
                                                                 
                    
                         
                       
                        
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                   
                         
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                      
                         
                                                            
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                       
                                   
                                                                 
                                                                       
                                                                 
                                                                 
                                                                 
                               
                                                                  
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
     
                                    
                                                                       
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
               
                           
                                    
                       
                                             
                                                                       
                                                                 
         
                     
                                          
                                                                       
                                                                       
                                                                 
                                                      
                                
                                            
                                                 
                                                             
                                           
                                                    
                                 
                                      
                                
                                            
                                                 
                                                             
                                           
                                                    
                                 
                                      
                                 
                                              
                                                   
                                                                
                                             
                                                       
                                  
                                        
                                 
                                              
                                                   
                                                                
                                             
                                                       
                                  
                                        
                                                                       
                                                                 
              
                                                           
                                                                       
                                                                 
                                                                 
                                  
                                                                       
                                                                 
                                                
                                                                       
                                                                 
                                                                 
                              
                                                                       
                                                                 
                              
                                                                       
                                                                 
                   
                                                  
                                                                       
                                                                 
              
                                                           
                                                                       
                                                                 
                                                                 
                                  
                                                                       
                                                                 
                                                
                                                                       
                                                                 
                                                                 
                              
                                                                       
                                                                 
                              
                                                                       
                                                                 
                  
                                                  
                                                                       
                                                                 
                
                                                              
                                                                       
                                                                 
                                                                 
                                      
                                                                       
                                                                 
                                                      
                                                                       
                                                                 
                                                                 
                                  
                                                                       
                                                                 
                                    
                                                                       
                                                                 
                    
                                                     
                                                                       
                                                                 
                
                                                              
                                                                       
                                                                 
                                                                 
                                      
                                                                       
                                                                 
                                                      
                                                                       
                                                                 
                                                                 
                                  
                                                                       
                                                                 
                                    
                                                                       
                                                                 
                    
                                                     
C$OMP PARALLEL
C$OMP CRITICAL (isca_cr_rgn)
      numthreads=omp_get_num_threads()
C$OMP END CRITICAL (isca_cr_rgn)
C$OMP END PARALLEL
      if (mynode.eq.0) write(stdout,'(1x,A,3(1x,A,I3),A)') 'NUMBER',
     &    'OF THREADS:',numthreads,'BLOCKING:',NSUB_X,'x',NSUB_E,'.'
      if (numthreads.gt.NPP) then
        if (mynode.eq.0) write(stdout,'(/1x,A,I3/)')
     &    'ERROR: Requested number of threads exceeds NPP =', NPP
        ierr=ierr+1
      elseif (mod(NSUB_X*NSUB_E,numthreads).ne.0) then
        if (mynode.eq.0) write(stdout,
     &                '(/1x,A,1x,A,I3,4x,A,I3,4x,A,I4,A)') 'ERROR:',
     &                'wrong choice of numthreads =', numthreads,
     &                'NSUB_X =', NSUB_X, 'NSUB_E =', NSUB_E, '.'
        ierr=ierr+1
      endif
      time=0.D0
      tdays=0.D0
      PREDICTOR_2D_STEP=.FALSE.
      iic=0
      kstp=1
      krhs=1
      knew=1
      ntstart=1
      nstp=1
      nrhs=1
      nnew=1
      nfast=1
      synchro_flag=.true.
      first_time=0
      may_day_flag=0
      do j=0,NPP
        do i=0,31
          proc(i,j)=0
          CPU_time(i,j)=0.D0
        enddo
      enddo
      trd_count=0
      nrecrst=0
      nrechis=0
      nrecavg=0
      tile_count=0
      bc_count=0
      avgke=0.D0
      avgpe=0.D0
      avgkp=0.D0
      volume=0.D0
      hmin=+1.D+20
      hmax=-1.D+20
      grdmin=+1.D+20
      grdmax=-1.D+20
      Cu_min=+1.D+20
      Cu_max=-1.D+20
      lonmin=+1.D+20
      lonmax=-1.D+20
      latmin=+1.D+20
      latmax=-1.D+20
      bc_crss=0.D0
      rx0=-1.D+20
      rx1=-1.D+20
      ncidrst=-1
      ncidhis=-1
      ncidavg=-1
      ncidfrc=-1
      ncidbulk=-1
      ncidclm=-1
      ncidqbar=-1
      ncidbtf=-1
       bry_id=-1
      call get_date (date_str)
      csmooth=dt/(86400.D0)
      ismooth=int(1.D0/csmooth)
      vname(:,:)='  '
      vname(1,indxTime)='scrum_time'
      vname(2,indxTime)='time since initialization'
      vname(3,indxTime)='second'
      vname(4,indxTime)='time, scalar, series'
      vname(5,indxTime)='time'
      vname(6,indxTime)='    '
      vname(7,indxTime)='T'
      vname(8,indxTime)='.NO.'
      vname(9,indxTime)=' '
      vname(1,indxTime2)='time'
      vname(2,indxTime2)='time since initialization'
      vname(3,indxTime2)='second'
      vname(4,indxTime2)='time, scalar, series'
      vname(5,indxTime2)='time'
      vname(6,indxTime2)='  '
      vname(7,indxTime2)='T '
      vname(8,indxTime2)='.NO.'
      vname(9,indxTime2)=' '
      vname(1,indxZ)='zeta                                        '
      vname(2,indxZ)='free-surface                                '
      vname(3,indxZ)='meter                                       '
      vname(4,indxZ)='free-surface, scalar, series                '
      vname(5,indxZ)='sea_surface_height                          '
      vname(6,indxZ)='lat_rho lon_rho                             '
      vname(7,indxZ)='                                            '
      vname(1,indxUb)='ubar                                       '
      vname(2,indxUb)='vertically integrated u-momentum component '
      vname(3,indxUb)='meter second-1                             '
      vname(4,indxUb)='ubar-velocity, scalar, series              '
      vname(5,indxUb)='barotropic_sea_water_x_'
     &                                  // 'velocity_at_u_location'
      vname(6,indxUb)='lat_u lon_u                                '
      vname(7,indxUb)='                                           '
      vname(1,indxVb)='vbar                                       '
      vname(2,indxVb)='vertically integrated v-momentum component '
      vname(3,indxVb)='meter second-1                             '
      vname(4,indxVb)='vbar-velocity, scalar, series              '
      vname(5,indxVb)='barotropic_sea_water_y_'
     &                                  // 'velocity_at_v_location'
      vname(6,indxVb)='lat_v lon_v                                '
      vname(7,indxVb)='                                           '
      vname(11,indxVb)=' '
      vname(1,indxBostr)='bostr                                   '
      vname(2,indxBostr)='Kinematic bottom stress                 '
      vname(3,indxBostr)='N/m2                                    '
      vname(4,indxBostr)='                                        '
      vname(5,indxBostr)='                                        '
      vname(6,indxBostr)='lat_rho lon_rho                         '
      vname(7,indxBostr)='                                        '
      vname(1,indxBustr)='bustr                                   '
      vname(2,indxBustr)='Kinematic u bottom stress component     '
      vname(3,indxBustr)='N/m2                                    '
      vname(4,indxBustr)='                                        '
      vname(5,indxBustr)='                                        '
      vname(6,indxBustr)='lat_u lon_u                             '
      vname(7,indxBustr)='                                        '
      vname(1,indxBvstr)='bvstr                                   '
      vname(2,indxBvstr)='Kinematic v bottom stress component     '
      vname(3,indxBvstr)='N/m2                                    '
      vname(4,indxBvstr)='                                        '
      vname(5,indxBvstr)='                                        '
      vname(6,indxBvstr)='lat_v lon_v                             '
      vname(7,indxBvstr)='                                        '
      vname(1,indxWstr)='wstr                                     '
      vname(2,indxWstr)='Kinematic wind stress                    '
      vname(3,indxWstr)='N/m2                                     '
      vname(4,indxWstr)='                                         '
      vname(5,indxWstr)='magnitude_of_surface_downward_stress     '
      vname(6,indxWstr)='lat_rho lon_rho                          '
      vname(7,indxWstr)='                                         '
      vname(1,indxUWstr)='sustr                                   '
      vname(2,indxUWstr)='Kinematic u wind stress component       '
      vname(3,indxUWstr)='N/m2                                    '
      vname(4,indxUWstr)='                                        '
      vname(5,indxUWstr)='surface_downward_eastward_stress        '
      vname(6,indxUWstr)='lat_u lon_u                             '
      vname(7,indxUWstr)='                                        '
      vname(8,indxUWstr)='                                        '
      vname(1,indxVWstr)='svstr                                   '
      vname(2,indxVWstr)='Kinematic v wind stress component       '
      vname(3,indxVWstr)='N/m2                                    '
      vname(4,indxVWstr)='                                        '
      vname(5,indxVWstr)='surface_downward_northward_stress       '
      vname(6,indxVWstr)='lat_v lon_v                             '
      vname(7,indxVWstr)='                                        '
      vname(1,indxU)='u                                           '
      vname(2,indxU)='u-momentum component                        '
      vname(3,indxU)='meter second-1                              '
      vname(4,indxU)='u-velocity, scalar, series                  '
      vname(5,indxU)='sea_water_x_velocity_at_u_location          '
      vname(6,indxU)='lat_u lon_u                                 '
      vname(7,indxU)='                                            '
      vname(1,indxV)='v                                           '
      vname(2,indxV)='v-momentum component                        '
      vname(3,indxV)='meter second-1                              '
      vname(4,indxV)='v-velocity, scalar, series                  '
      vname(5,indxV)='sea_water_y_velocity_at_v_location          '
      vname(6,indxV)='lat_v lon_v                                 '
      vname(7,indxV)='                                            '
      vname(1,indxT)='temp                                        '
      vname(2,indxT)='potential temperature                       '
      vname(3,indxT)='Celsius                                     '
      vname(4,indxT)='temperature, scalar, series                 '
      vname(5,indxT)='sea_water_potential_temperature             '
      vname(6,indxT)='lat_rho lon_rho                             '
      vname(7,indxT)='                                            '
      vname(1,indxS)='salt                                        '
      vname(2,indxS)='salinity                                    '
      vname(3,indxS)='PSU                                         '
      vname(4,indxS)='salinity, scalar, series                    '
      vname(5,indxS)='sea_water_salinity                          '
      vname(6,indxS)='lat_rho lon_rho                             '
      vname(7,indxS)='                                            '
      vname(1,indxShflx)='shflux                                  '
      vname(2,indxShflx)='surface net heat flux                   '
      vname(3,indxShflx)='Watts meter-2                           '
      vname(4,indxShflx)='surface heat flux, scalar, series       '
      vname(6,indxShflx)='lat_rho lon_rho                         '
      vname(7,indxShflx)='                                        '
      vname(1,indxSwflx)='swflux                                  '
      vname(2,indxSwflx)='surface freshwater flux (E-P)           '
      vname(3,indxSwflx)='centimeter day-1                        '
      vname(4,indxSwflx)='surface freshwater flux, scalar, series '
      vname(5,indxSwflx)='                                        '
      vname(6,indxSwflx)='lat_rho lon_rho                         '
      vname(7,indxSwflx)='                                        '
      vname(8,indxSwflx)='                                        '
      vname(1,indxShflx_rsw)='swrad                               '
      vname(2,indxShflx_rsw)='Short-wave surface radiation        '
      vname(3,indxShflx_rsw)='Watts meter-2                       '
      vname(4,indxShflx_rsw)='                                    '
      vname(5,indxShflx_rsw)='                                    '
      vname(6,indxShflx_rsw)='lat_rho lon_rho                     '
      vname(7,indxShflx_rsw)='                                    '
      vname(1,indxO)='omega                                       '
      vname(2,indxO)='S-coordinate vertical momentum component    '
      vname(3,indxO)='meter second-1                              '
      vname(4,indxO)='omega, scalar, series                       '
      vname(5,indxO)='                                            '
      vname(6,indxO)='lat_rho lon_rho                             '
      vname(7,indxO)='                                            '
      vname(1,indxW)='w                                           '
      vname(2,indxW)='vertical momentum component                 '
      vname(3,indxW)='meter second-1                              '
      vname(4,indxW)='w-velocity, scalar, series                  '
      vname(5,indxW)='upward_sea_water_velocity                   '
      vname(6,indxW)='lat_rho lon_rho                             '
      vname(1,indxR)='rho                                         '
      vname(2,indxR)='density anomaly                             '
      vname(3,indxR)='kilogram meter-3                            '
      vname(4,indxR)='density, scalar, series                     '
      vname(5,indxR)='sea_water_sigma_t                           '
      vname(7,indxR)='                                            '
      vname(1,indxbvf)='bvf                                       '
      vname(2,indxbvf)='Brunt Vaisala Frequency                   '
      vname(3,indxbvf)='second-1                                  '
      vname(4,indxbvf)='bvf, scalar, series                       '
      vname(5,indxbvf)='brunt_vaisala_frequency                   '
      vname(7,indxbvf)='                                          '
      vname(1,indxDiff)='diff3d                                   '
      vname(2,indxDiff)='horizontal diffusivity coefficient       '
      vname(3,indxDiff)='meter4 second-1                          '
      vname(5,indxDiff)='ocean_tracer_xy_biharmonic_diffusivity   '
      vname(4,indxDiff)='diff3d, scalar, series                   '
      vname(6,indxDiff)='lat_rho lon_rho                          '
      vname(7,indxDiff)='                                         '
      vname(1,indxAkv)='AKv                                       '
      vname(2,indxAkv)='vertical viscosity coefficient            '
      vname(3,indxAkv)='meter2 second-1                           '
      vname(4,indxAkv)='AKv, scalar, series                       '
      vname(5,indxAkv)='ocean_vertical_momentum_diffusivity_'
     &                                          // 'at_w_location '
      vname(6,indxAkv)='lat_rho lon_rho                           '
      vname(7,indxAkv)='                                          '
      vname(1,indxAkt)='AKt                                       '
      vname(2,indxAkt)='temperature vertical diffusion coefficient'
      vname(3,indxAkt)='meter2 second-1                           '
      vname(4,indxAkt)='AKt, scalar, series                       '
      vname(5,indxAkt)='ocean_vertical_heat_diffusivity_'
     &                                         //  'at_w_location '
      vname(6,indxAkt)='lat_rho lon_rho                           '
      vname(7,indxAkt)='                                          '
      vname(1,indxAks)='AKs                                       '
      vname(2,indxAks)='salinity vertical diffusion coefficient   '
      vname(3,indxAks)='meter2 second-1                           '
      vname(4,indxAks)='AKs, scalar, series                       '
      vname(5,indxAks)='ocean_vertical_salt_diffusivity_'
     &               / /  'at_w_location                          '
      vname(6,indxAks)='lat_rho lon_rho                           '
      vname(7,indxAks)='                                          '
      vname(1,indxHbl)='hbl                                       '
      vname(2,indxHbl)='depth of planetary boundary layer         '
      vname(3,indxHbl)='meter                                     '
      vname(4,indxHbl)='hbl, scalar, series                       '
      vname(5,indxHbl)='ocean_mixed_layer_thickness_defined_'
     &                                       // 'by_mixing_scheme '
      vname(6,indxHbl)='lat_rho lon_rho                           '
      vname(7,indxHbl)='                                          '
      vname(1,indxHbbl)='hbbl                                     '
      vname(2,indxHbbl)='depth of bottom boundary layer           '
      vname(3,indxHbbl)='meter                                    '
      vname(4,indxHbbl)='hbbl, scalar, series                     '
      vname(5,indxHbbl)='                                         '
      vname(6,indxHbbl)='lat_rho lon_rho                          '
      vname(7,indxHbbl)='                                         '
      vname(1,indxSSH)='SSH                                       '
      vname(2,indxSSH)='sea surface height                        '
      vname(3,indxSSH)='meter                                     '
      vname(4,indxSSH)='SSH, scalar, series                       '
      vname(5,indxSSH)='sea_surface_height_above_sea_level        '
      vname(6,indxSSH)='lat_rho lon_rho                           '
      vname(7,indxSSH)='                                          '
      vname(1,indxSUSTR)='sustr                                   '
      vname(2,indxSUSTR)='surface u-momentum stress               '
      vname(3,indxSUSTR)='Newton meter-2                          '
      vname(4,indxSUSTR)='surface u-mom. stress, scalar, series   '
      vname(5,indxSUSTR)='surface_downward_x_stress               '
      vname(6,indxSUSTR)='lat_u lon_u                             '
      vname(7,indxSUSTR)='                                        '
      vname(1,indxSVSTR)='svstr                                   '
      vname(2,indxSVSTR)='surface v-momentum stress               '
      vname(3,indxSVSTR)='Newton meter-2                          '
      vname(4,indxSVSTR)='surface v-mom. stress, scalar, series   '
      vname(5,indxSVSTR)='surface_downward_y_stress               '
      vname(6,indxSVSTR)='lat_v lon_v                             '
      vname(7,indxSVSTR)='                                        '
      vname(1,indxSST)='SST                                       '
      vname(2,indxSST)='sea surface temperature                   '
      vname(3,indxSST)='Celsius                                   '
      vname(4,indxSST)='SST, scalar, series                       '
      vname(5,indxSST)='sea_surface_temperature                   '
      vname(6,indxSST)='lat_rho lon_rho                           '
      vname(7,indxSST)='                                          '
      vname(8,indxSST)=' '
      vname(1,indxdQdSST)='dQdSST                                 '
      vname(2,indxdQdSST)='surface heat flux sensitivity to SST   '
      vname(3,indxdQdSST)='Watts meter-2 Celsius-1                '
      vname(4,indxdQdSST)='dQdSST, scalar, series                 '
      vname(5,indxdQdSST)='heat_flux_correction                   '
      vname(6,indxdQdSST)='lat_rho lon_rho                        '
      vname(7,indxdQdSST)='                                       '
      vname(1,indxSSS)='SSS                                       '
      vname(2,indxSSS)='sea surface salinity                      '
      vname(3,indxSSS)='PSU                                       '
      vname(4,indxSSS)='SSS, scalar, series                       '
      vname(5,indxSSS)='sea_surface_salinity                      '
      vname(6,indxSSS)='lat_rho lon_rho                           '
      vname(7,indxSSS)='                                          '
      return
       
      

      end subroutine Sub_Loop_init_scalars

      module bry_t_north


        implicit none
        public :: Alloc_agrif_bry_t_north
      contains
      subroutine Alloc_agrif_bry_t_north(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      integer(4), parameter :: N = 32
      !! ALLOCATION OF VARIABLE : tbry_north_dt
          if (.not. allocated(Agrif_Gr % tabvars(176)% array4)) then
          allocate(Agrif_Gr % tabvars(176)% array4(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N,1 : 2,1 : NT))
          Agrif_Gr % tabvars(176)% array4 = 0
      endif
      !! ALLOCATION OF VARIABLE : tbry_north
          if (.not. allocated(Agrif_Gr % tabvars(177)% array3)) then
          allocate(Agrif_Gr % tabvars(177)% array3(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N,1 : NT))
          Agrif_Gr % tabvars(177)% array3 = 0
      endif
      end subroutine Alloc_agrif_bry_t_north
      end module bry_t_north
      module bry_u_north


        implicit none
        public :: Alloc_agrif_bry_u_north
      contains
      subroutine Alloc_agrif_bry_u_north(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: N = 32
      !! ALLOCATION OF VARIABLE : vbry_north_dt
          if (.not. allocated(Agrif_Gr % tabvars(178)% array3)) then
          allocate(Agrif_Gr % tabvars(178)% array3(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N,1 : 2))
          Agrif_Gr % tabvars(178)% array3 = 0
      endif
      !! ALLOCATION OF VARIABLE : vbry_north
          if (.not. allocated(Agrif_Gr % tabvars(179)% array2)) then
          allocate(Agrif_Gr % tabvars(179)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N))
          Agrif_Gr % tabvars(179)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubry_north_dt
          if (.not. allocated(Agrif_Gr % tabvars(180)% array3)) then
          allocate(Agrif_Gr % tabvars(180)% array3(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N,1 : 2))
          Agrif_Gr % tabvars(180)% array3 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubry_north
          if (.not. allocated(Agrif_Gr % tabvars(181)% array2)) then
          allocate(Agrif_Gr % tabvars(181)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N))
          Agrif_Gr % tabvars(181)% array2 = 0
      endif
      end subroutine Alloc_agrif_bry_u_north
      end module bry_u_north
      module bry_ubar_north


        implicit none
        public :: Alloc_agrif_bry_ubar_north
      contains
      subroutine Alloc_agrif_bry_ubar_north(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : vbarbry_north_dt
          if (.not. allocated(Agrif_Gr % tabvars(182)% array2)) then
          allocate(Agrif_Gr % tabvars(182)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : 2))
          Agrif_Gr % tabvars(182)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : vbarbry_north
          if (.not. allocated(Agrif_Gr % tabvars(183)% array1)) then
          allocate(Agrif_Gr % tabvars(183)% array1(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0))
          Agrif_Gr % tabvars(183)% array1 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubarbry_north_dt
          if (.not. allocated(Agrif_Gr % tabvars(184)% array2)) then
          allocate(Agrif_Gr % tabvars(184)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : 2))
          Agrif_Gr % tabvars(184)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubarbry_north
          if (.not. allocated(Agrif_Gr % tabvars(185)% array1)) then
          allocate(Agrif_Gr % tabvars(185)% array1(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0))
          Agrif_Gr % tabvars(185)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_ubar_north
      end module bry_ubar_north
      module bry_zeta_north


        implicit none
        public :: Alloc_agrif_bry_zeta_north
      contains
      subroutine Alloc_agrif_bry_zeta_north(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : zetabry_north_dt
          if (.not. allocated(Agrif_Gr % tabvars(186)% array2)) then
          allocate(Agrif_Gr % tabvars(186)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : 2))
          Agrif_Gr % tabvars(186)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : zetabry_north
          if (.not. allocated(Agrif_Gr % tabvars(187)% array1)) then
          allocate(Agrif_Gr % tabvars(187)% array1(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0))
          Agrif_Gr % tabvars(187)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_zeta_north
      end module bry_zeta_north
      module bry_t_south


        implicit none
        public :: Alloc_agrif_bry_t_south
      contains
      subroutine Alloc_agrif_bry_t_south(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      integer(4), parameter :: N = 32
      !! ALLOCATION OF VARIABLE : tbry_south_dt
          if (.not. allocated(Agrif_Gr % tabvars(188)% array4)) then
          allocate(Agrif_Gr % tabvars(188)% array4(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N,1 : 2,1 : NT))
          Agrif_Gr % tabvars(188)% array4 = 0
      endif
      !! ALLOCATION OF VARIABLE : tbry_south
          if (.not. allocated(Agrif_Gr % tabvars(189)% array3)) then
          allocate(Agrif_Gr % tabvars(189)% array3(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N,1 : NT))
          Agrif_Gr % tabvars(189)% array3 = 0
      endif
      end subroutine Alloc_agrif_bry_t_south
      end module bry_t_south
      module bry_u_south


        implicit none
        public :: Alloc_agrif_bry_u_south
      contains
      subroutine Alloc_agrif_bry_u_south(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: N = 32
      !! ALLOCATION OF VARIABLE : vbry_south_dt
          if (.not. allocated(Agrif_Gr % tabvars(190)% array3)) then
          allocate(Agrif_Gr % tabvars(190)% array3(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N,1 : 2))
          Agrif_Gr % tabvars(190)% array3 = 0
      endif
      !! ALLOCATION OF VARIABLE : vbry_south
          if (.not. allocated(Agrif_Gr % tabvars(191)% array2)) then
          allocate(Agrif_Gr % tabvars(191)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N))
          Agrif_Gr % tabvars(191)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubry_south_dt
          if (.not. allocated(Agrif_Gr % tabvars(192)% array3)) then
          allocate(Agrif_Gr % tabvars(192)% array3(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N,1 : 2))
          Agrif_Gr % tabvars(192)% array3 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubry_south
          if (.not. allocated(Agrif_Gr % tabvars(193)% array2)) then
          allocate(Agrif_Gr % tabvars(193)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : N))
          Agrif_Gr % tabvars(193)% array2 = 0
      endif
      end subroutine Alloc_agrif_bry_u_south
      end module bry_u_south
      module bry_ubar_south


        implicit none
        public :: Alloc_agrif_bry_ubar_south
      contains
      subroutine Alloc_agrif_bry_ubar_south(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : vbarbry_south_dt
          if (.not. allocated(Agrif_Gr % tabvars(194)% array2)) then
          allocate(Agrif_Gr % tabvars(194)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : 2))
          Agrif_Gr % tabvars(194)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : vbarbry_south
          if (.not. allocated(Agrif_Gr % tabvars(195)% array1)) then
          allocate(Agrif_Gr % tabvars(195)% array1(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0))
          Agrif_Gr % tabvars(195)% array1 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubarbry_south_dt
          if (.not. allocated(Agrif_Gr % tabvars(196)% array2)) then
          allocate(Agrif_Gr % tabvars(196)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : 2))
          Agrif_Gr % tabvars(196)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubarbry_south
          if (.not. allocated(Agrif_Gr % tabvars(197)% array1)) then
          allocate(Agrif_Gr % tabvars(197)% array1(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0))
          Agrif_Gr % tabvars(197)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_ubar_south
      end module bry_ubar_south
      module bry_zeta_south


        implicit none
        public :: Alloc_agrif_bry_zeta_south
      contains
      subroutine Alloc_agrif_bry_zeta_south(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : zetabry_south_dt
          if (.not. allocated(Agrif_Gr % tabvars(198)% array2)) then
          allocate(Agrif_Gr % tabvars(198)% array2(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0,1 : 2))
          Agrif_Gr % tabvars(198)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : zetabry_south
          if (.not. allocated(Agrif_Gr % tabvars(199)% array1)) then
          allocate(Agrif_Gr % tabvars(199)% array1(-1 :  Agrif_tabvars_i
     &(2)%iarray0+2+ Agrif_tabvars_i(13)%iarray0))
          Agrif_Gr % tabvars(199)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_zeta_south
      end module bry_zeta_south
      module bry_t_east


        implicit none
        public :: Alloc_agrif_bry_t_east
      contains
      subroutine Alloc_agrif_bry_t_east(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      integer(4), parameter :: N = 32
      !! ALLOCATION OF VARIABLE : tbry_east_dt
          if (.not. allocated(Agrif_Gr % tabvars(200)% array4)) then
          allocate(Agrif_Gr % tabvars(200)% array4(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N,1 : 2,1 : NT))
          Agrif_Gr % tabvars(200)% array4 = 0
      endif
      !! ALLOCATION OF VARIABLE : tbry_east
          if (.not. allocated(Agrif_Gr % tabvars(201)% array3)) then
          allocate(Agrif_Gr % tabvars(201)% array3(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N,1 : NT))
          Agrif_Gr % tabvars(201)% array3 = 0
      endif
      end subroutine Alloc_agrif_bry_t_east
      end module bry_t_east
      module bry_u_east


        implicit none
        public :: Alloc_agrif_bry_u_east
      contains
      subroutine Alloc_agrif_bry_u_east(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: N = 32
      !! ALLOCATION OF VARIABLE : vbry_east_dt
          if (.not. allocated(Agrif_Gr % tabvars(202)% array3)) then
          allocate(Agrif_Gr % tabvars(202)% array3(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N,1 : 2))
          Agrif_Gr % tabvars(202)% array3 = 0
      endif
      !! ALLOCATION OF VARIABLE : vbry_east
          if (.not. allocated(Agrif_Gr % tabvars(203)% array2)) then
          allocate(Agrif_Gr % tabvars(203)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N))
          Agrif_Gr % tabvars(203)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubry_east_dt
          if (.not. allocated(Agrif_Gr % tabvars(204)% array3)) then
          allocate(Agrif_Gr % tabvars(204)% array3(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N,1 : 2))
          Agrif_Gr % tabvars(204)% array3 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubry_east
          if (.not. allocated(Agrif_Gr % tabvars(205)% array2)) then
          allocate(Agrif_Gr % tabvars(205)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N))
          Agrif_Gr % tabvars(205)% array2 = 0
      endif
      end subroutine Alloc_agrif_bry_u_east
      end module bry_u_east
      module bry_ubar_east


        implicit none
        public :: Alloc_agrif_bry_ubar_east
      contains
      subroutine Alloc_agrif_bry_ubar_east(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : vbarbry_east_dt
          if (.not. allocated(Agrif_Gr % tabvars(206)% array2)) then
          allocate(Agrif_Gr % tabvars(206)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : 2))
          Agrif_Gr % tabvars(206)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : vbarbry_east
          if (.not. allocated(Agrif_Gr % tabvars(207)% array1)) then
          allocate(Agrif_Gr % tabvars(207)% array1(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0))
          Agrif_Gr % tabvars(207)% array1 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubarbry_east_dt
          if (.not. allocated(Agrif_Gr % tabvars(208)% array2)) then
          allocate(Agrif_Gr % tabvars(208)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : 2))
          Agrif_Gr % tabvars(208)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubarbry_east
          if (.not. allocated(Agrif_Gr % tabvars(209)% array1)) then
          allocate(Agrif_Gr % tabvars(209)% array1(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0))
          Agrif_Gr % tabvars(209)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_ubar_east
      end module bry_ubar_east
      module bry_zeta_east


        implicit none
        public :: Alloc_agrif_bry_zeta_east
      contains
      subroutine Alloc_agrif_bry_zeta_east(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : zetabry_east_dt
          if (.not. allocated(Agrif_Gr % tabvars(210)% array2)) then
          allocate(Agrif_Gr % tabvars(210)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : 2))
          Agrif_Gr % tabvars(210)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : zetabry_east
          if (.not. allocated(Agrif_Gr % tabvars(211)% array1)) then
          allocate(Agrif_Gr % tabvars(211)% array1(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0))
          Agrif_Gr % tabvars(211)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_zeta_east
      end module bry_zeta_east
      module bry_t_west


        implicit none
        public :: Alloc_agrif_bry_t_west
      contains
      subroutine Alloc_agrif_bry_t_west(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      integer(4), parameter :: N = 32
      !! ALLOCATION OF VARIABLE : tbry_west_dt
          if (.not. allocated(Agrif_Gr % tabvars(212)% array4)) then
          allocate(Agrif_Gr % tabvars(212)% array4(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N,1 : 2,1 : NT))
          Agrif_Gr % tabvars(212)% array4 = 0
      endif
      !! ALLOCATION OF VARIABLE : tbry_west
          if (.not. allocated(Agrif_Gr % tabvars(213)% array3)) then
          allocate(Agrif_Gr % tabvars(213)% array3(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N,1 : NT))
          Agrif_Gr % tabvars(213)% array3 = 0
      endif
      end subroutine Alloc_agrif_bry_t_west
      end module bry_t_west
      module bry_u_west


        implicit none
        public :: Alloc_agrif_bry_u_west
      contains
      subroutine Alloc_agrif_bry_u_west(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: N = 32
      !! ALLOCATION OF VARIABLE : vbry_west_dt
          if (.not. allocated(Agrif_Gr % tabvars(214)% array3)) then
          allocate(Agrif_Gr % tabvars(214)% array3(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N,1 : 2))
          Agrif_Gr % tabvars(214)% array3 = 0
      endif
      !! ALLOCATION OF VARIABLE : vbry_west
          if (.not. allocated(Agrif_Gr % tabvars(215)% array2)) then
          allocate(Agrif_Gr % tabvars(215)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N))
          Agrif_Gr % tabvars(215)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubry_west_dt
          if (.not. allocated(Agrif_Gr % tabvars(216)% array3)) then
          allocate(Agrif_Gr % tabvars(216)% array3(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N,1 : 2))
          Agrif_Gr % tabvars(216)% array3 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubry_west
          if (.not. allocated(Agrif_Gr % tabvars(217)% array2)) then
          allocate(Agrif_Gr % tabvars(217)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : N))
          Agrif_Gr % tabvars(217)% array2 = 0
      endif
      end subroutine Alloc_agrif_bry_u_west
      end module bry_u_west
      module bry_ubar_west


        implicit none
        public :: Alloc_agrif_bry_ubar_west
      contains
      subroutine Alloc_agrif_bry_ubar_west(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : vbarbry_west_dt
          if (.not. allocated(Agrif_Gr % tabvars(218)% array2)) then
          allocate(Agrif_Gr % tabvars(218)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : 2))
          Agrif_Gr % tabvars(218)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : vbarbry_west
          if (.not. allocated(Agrif_Gr % tabvars(219)% array1)) then
          allocate(Agrif_Gr % tabvars(219)% array1(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0))
          Agrif_Gr % tabvars(219)% array1 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubarbry_west_dt
          if (.not. allocated(Agrif_Gr % tabvars(220)% array2)) then
          allocate(Agrif_Gr % tabvars(220)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : 2))
          Agrif_Gr % tabvars(220)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : ubarbry_west
          if (.not. allocated(Agrif_Gr % tabvars(221)% array1)) then
          allocate(Agrif_Gr % tabvars(221)% array1(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0))
          Agrif_Gr % tabvars(221)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_ubar_west
      end module bry_ubar_west
      module bry_zeta_west


        implicit none
        public :: Alloc_agrif_bry_zeta_west
      contains
      subroutine Alloc_agrif_bry_zeta_west(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : zetabry_west_dt
          if (.not. allocated(Agrif_Gr % tabvars(222)% array2)) then
          allocate(Agrif_Gr % tabvars(222)% array2(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0,1 : 2))
          Agrif_Gr % tabvars(222)% array2 = 0
      endif
      !! ALLOCATION OF VARIABLE : zetabry_west
          if (.not. allocated(Agrif_Gr % tabvars(223)% array1)) then
          allocate(Agrif_Gr % tabvars(223)% array1(-1 :  Agrif_tabvars_i
     &(4)%iarray0+2+ Agrif_tabvars_i(14)%iarray0))
          Agrif_Gr % tabvars(223)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_zeta_west
      end module bry_zeta_west
      module t_north_id


        implicit none
        public :: Alloc_agrif_t_north_id
      contains
      subroutine Alloc_agrif_t_north_id(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      !! ALLOCATION OF VARIABLE : tbry_north_id
          if (.not. allocated(Agrif_Gr % tabvars_i(251)% iarray1)) then
          allocate(Agrif_Gr % tabvars_i(251)% iarray1(1 : NT))
          Agrif_Gr % tabvars_i(251)% iarray1 = 0
      endif
      end subroutine Alloc_agrif_t_north_id
      end module t_north_id
      module t_south_id


        implicit none
        public :: Alloc_agrif_t_south_id
      contains
      subroutine Alloc_agrif_t_south_id(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      !! ALLOCATION OF VARIABLE : tbry_south_id
          if (.not. allocated(Agrif_Gr % tabvars_i(257)% iarray1)) then
          allocate(Agrif_Gr % tabvars_i(257)% iarray1(1 : NT))
          Agrif_Gr % tabvars_i(257)% iarray1 = 0
      endif
      end subroutine Alloc_agrif_t_south_id
      end module t_south_id
      module t_east_id


        implicit none
        public :: Alloc_agrif_t_east_id
      contains
      subroutine Alloc_agrif_t_east_id(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      !! ALLOCATION OF VARIABLE : tbry_east_id
          if (.not. allocated(Agrif_Gr % tabvars_i(263)% iarray1)) then
          allocate(Agrif_Gr % tabvars_i(263)% iarray1(1 : NT))
          Agrif_Gr % tabvars_i(263)% iarray1 = 0
      endif
      end subroutine Alloc_agrif_t_east_id
      end module t_east_id
      module t_west_id


        implicit none
        public :: Alloc_agrif_t_west_id
      contains
      subroutine Alloc_agrif_t_west_id(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      !! ALLOCATION OF VARIABLE : tbry_west_id
          if (.not. allocated(Agrif_Gr % tabvars_i(269)% iarray1)) then
          allocate(Agrif_Gr % tabvars_i(269)% iarray1(1 : NT))
          Agrif_Gr % tabvars_i(269)% iarray1 = 0
      endif
      end subroutine Alloc_agrif_t_west_id
      end module t_west_id
      module bry_indices_array


        implicit none
        public :: Alloc_agrif_bry_indices_array
      contains
      subroutine Alloc_agrif_bry_indices_array(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      !! ALLOCATION OF VARIABLE : bry_time
          if (.not. allocated(Agrif_Gr % tabvars(224)% array1)) then
          allocate(Agrif_Gr % tabvars(224)% array1(1 : 2))
          Agrif_Gr % tabvars(224)% array1 = 0
      endif
      end subroutine Alloc_agrif_bry_indices_array
      end module bry_indices_array
      module bry_logical


        implicit none
        public :: Alloc_agrif_bry_logical
      contains
      subroutine Alloc_agrif_bry_logical(Agrif_Gr)
        use Agrif_Util
        type(Agrif_grid), pointer :: Agrif_Gr
        integer :: i
      integer(4), parameter :: ntrc_sed = 0
      integer(4), parameter :: ntrc_bio = 0
      integer(4), parameter :: ntrc_pas = 0
      integer(4), parameter :: ntrc_salt = 1
      integer(4), parameter :: itemp = 1
      integer(4), parameter :: NT = itemp+ntrc_salt+ntrc_pas+ntrc_bio+nt
     &rc_sed
      !! ALLOCATION OF VARIABLE : got_tbry
          if (.not. allocated(Agrif_Gr % tabvars_l(24)% larray1)) then
          allocate(Agrif_Gr % tabvars_l(24)% larray1(1 : NT))
      endif
      end subroutine Alloc_agrif_bry_logical
      end module bry_logical
