
c     ******************************************************************
c     This file declares all the variables that are common to:
c
c 	- the main program MAIN.F
c     	- all the subroutines associated with MAIN.F
c
c     ******************************************************************


c     ------------------------------------
c     Declarations of type for constants 
c     ------------------------------------

c---- Integers

      integer	itot,jtot,ktot,ntot

      parameter (itot=046,	! 46 (with 2-deg)  
     >           jtot=056,	! 56 (with 2-deg) 
     >           ktot=003,	! 03 (with 3 vertical layers)
     >           ntot=(itot+1)
     >               *(jtot+1)
     >               *(ktot+1))

c--

      integer	idim_n_o  ,
     >		idim_n_li ,
     >		idim_n_nl ,
     >		idim_n_wbc

      parameter (idim_n_o  =22,		
     >		 idim_n_li =10,		
     >		 idim_n_nl = 7,		 
     >		 idim_n_wbc=ntot)	


c---- Reals 

      real*8     pi,rad,deg,r_0,omega,g,sv,yr

      parameter (pi   = 3.141592654d0,
     >           rad  = pi/180.d0    ,
     >           deg  = 180.d0/pi    ,
     >		 r_0  = 6371.d3      ,
     >		 omega= 7.29d-5      ,
     >		 g    = 9.81d0       ,
     >		 sv   =   1.d-6      ,
     >		 yr   =365*86400.d0   ) 

c--

      real*8	rho_0,
     >		rho_m,
     >          c_sou,
     >          compr

      parameter (rho_0=1028.d0,
     >		 rho_m=1041.d0,
     >           c_sou=1500.d0,
     >           compr=rho_0*g/(c_sou**2))

c--

      real*8	prod,p0

      parameter (prod=(0.6d-4)/yr,		! 1/s
     >		 p0  =-20.       )		! per mil


c      parameter (prod=0.0012/yr)		! mmol P/(m3 s)

c---

      real*8	z_b

      parameter (z_b = 4750.d0)

 


c     -------------------------------------------------------
c     Declarations of type and dimension for array variables    
c     -------------------------------------------------------

c---- Reals

      real*8	r(itot+1,jtot+1,ktot+1),
     >		U(itot+1,jtot+1,ktot+1),
     >		V(itot+1,jtot+1,ktot+1),
     >		W(itot+1,jtot+1,ktot+1),
     >		p(itot+1,jtot+1,ktot+1)

      real*8    e_r(itot+1,jtot+1,ktot+1),
     >          e_U(itot+1,jtot+1,ktot+1),
     >          e_V(itot+1,jtot+1,ktot+1),
     >		e_W(itot+1,jtot+1,ktot+1),
     >		e_p(itot+1,jtot+1,ktot+1)

      real*8	F_r(itot+1,jtot+1,ktot+1),
     >		F_p(itot+1,jtot+1,ktot+1)

      real*8	lon  (itot+1            ),
     >		lat  (jtot+1            ),
     >	 	z    (itot  ,jtot       ),
     >		z_std(itot  ,jtot       ),
     >		z_l  (            ktot+1)	

      real*8	dx(itot),
     >		dy(jtot),
     >		dz(ktot)

      real*8	x (idim_n_o),
     >		xo(idim_n_o)

      real*8    Co_1    (idim_n_o  ),
     > 		Ca_mod_1(idim_n_li ),
     >		Ca_wbc_1(idim_n_wbc),
     >		Ca_zon_1(jtot+1    )

      real*8	Coa(idim_n_o,idim_n_o)

      real*8	Cf_1(idim_n_nl)

      real*8	A_mod(idim_n_li,idim_n_o),b_wbc(idim_n_wbc),
     >		A_zon(jtot+1   ,idim_n_o),b_zon(jtot+1    ),
     >					  b_mod(idim_n_li ) 

      real*8	b_wbc0,b_wbc0_up,b_wbc0_do,
     >		b_mow0,
     >	  	b_vem0,
     >	   	b_hun0,
     >		b_rac0,
     >		b_eqc0,
     >		b_vfz0

      real*8	f(idim_n_nl)

      real*8	FF(idim_n_nl,idim_n_o)

      real*8	alpha(idim_n_nl),
     >		beta (idim_n_o )
     
      real*8	res_mas(ntot),
     >		res_twu(ntot),
     >		res_twv(ntot),
     >		res_vor(ntot),
     >		res_den(ntot),
     >		res_pos(ntot)

      real*8	MAT1(idim_n_o,idim_n_o),
     >	        MAT2(idim_n_o,idim_n_o),
     >		vec1(idim_n_o         ),
     >	 	vec2(idim_n_o         ),
     >		d


c---- Integer

      integer	indx (idim_n_o),
     >		i_obs(idim_n_o)


c---- Characters

      character	string (idim_n_o)*12,
     >		str_wbc(ntot    )*12


c---- Logicals

      logical	flag_b(0:itot+1,0:jtot+1,0:ktot+1)

      logical	flag_r  (itot+1,jtot+1,ktot+1),
     >		flag_U  (itot+1,jtot+1,ktot+1),
     >		flag_V  (itot+1,jtot+1,ktot+1),
     >		flag_W  (itot+1,jtot+1,ktot+1),
     >		flag_p  (itot+1,jtot+1,ktot+1)

      logical   flag_mas(itot+1,jtot+1,ktot+1),
     >          flag_twu(itot+1,jtot+1,ktot+1),
     >          flag_twv(itot+1,jtot+1,ktot+1),
     >          flag_vor(itot+1,jtot+1,ktot+1),
     >          flag_den(itot+1,jtot+1,ktot+1),
     >		flag_pos(itot+1,jtot+1,ktot+1)




c     ---------------------------------------------
c     Declarations of type for non-array variables
c     ---------------------------------------------

c---- Reals

      real*8	e_r0,
     >		e_U0,
     >		e_V0,
     >		e_W0,
     >		e_p0

      real*8	e_zon0,
     >		e_wbc0,
     >		e_mow0,
     >		e_vem0,
     >		e_hun0,
     >		e_rac0,
     >		e_eqc0,
     >		e_vfz0

      real*8    e_mas,
     >          e_twu,
     >          e_twv,
     >          e_vor,
     >		e_tra,
     >          e_den,
     >		e_pos

      real*8	J_o  ,
     >		J_li ,
     >		J_zon,
     >		J_nl 

      real*8	lon_w,
     >		lat_s

      real*8	b_nad,
     >		b_aab,
     >		b_mow,
     >		b_int

      real*8	eps_max,
     >		l_r    


c---- Integers

      integer	n_o  ,
     >		n_li ,
     >		n_nl ,
     >		n_wbc,n_obs_tot,
     >		n_zon,
     >		n_mas,n_r,
     >		n_twu,n_U,
     >		n_twv,n_V,
     >		n_vor,n_W,
     >		n_pos,n_p
 
      integer	iflag 


c---- Characters
  
      character*50 tag    ,
     >		   tag_UVW,
     >		   tag_rrr,
     >		   tag_ppp    

      character*6  lnm


c---- Logicals




c     ------------------
c     Common statements
c     ------------------

      common/real_1/r,
     >	     	    U,
     >		    V,
     >		    W,
     >		    p

      common/real_2/e_r,
     >              e_U,
     >              e_V,
     >		    e_W,
     >		    e_p

      common/real_3/lon  ,
     >		    lat  ,
     >		    z    ,
     >		    z_std,
     >		    z_l  ,
     >		    dx   ,
     >		    dy   ,
     >		    dz

      common/real_4/x      ,
     >		    xo     ,
     >		    Co_1   ,
     >		    Ca_mod_1,
     >		    Ca_wbc_1,
     >		    Ca_zon_1,
     > 		    Coa    ,
     >		    Cf_1   ,
     >		    A_mod  ,
     >		    A_zon  ,
     >		    b_wbc  ,
     >		    b_zon  ,
     >		    b_mod  ,
     >		    f      ,
     >		    FF     ,
     >		    alpha  ,
     >		    beta 

      common/real_5/res_mas,
     >		    res_twu,
     >		    res_twv,
     >		    res_vor,
     >		    res_den,
     >		    res_pos

      common/real_6/MAT1,
     >		    MAT2,
     >		    vec1,
     >		    vec2,
     >		    d   

      common/real_7/e_r0,
     >		    e_U0,
     >		    e_V0,
     >		    e_W0,
     >		    e_p0  

      common/real_8/e_mas,
     >		    e_twu,
     >		    e_twv,
     >		    e_vor,
     >		    e_tra,
     >		    e_den,
     >		    e_pos

      common/real_9/lon_w,
     >		    lat_s

      common/real_10/b_nad,
     >	             b_aab,
     >		     b_mow,
     >		     b_int

      common/real_11/J_o  ,
     >		     J_li ,
     >		     J_zon,
     >		     J_nl 

      common/real_12/F_r,
     >		     F_p

      common/real_13/       e_zon0,
     >		     b_wbc0,e_wbc0,b_wbc0_up,b_wbc0_do,
     >               b_mow0,e_mow0,
     >               b_vem0,e_vem0,
     >               b_hun0,e_hun0,
     >               b_rac0,e_rac0,
     >               b_eqc0,e_eqc0,
     >               b_vfz0,e_vfz0

      common/real_14/eps_max ,
     >	   	     l_r     

c--

      common/inte_1/indx ,
     >		    i_obs

      common/inte_2/n_o  ,
     >		    n_li ,
     >		    n_nl ,
     >		    n_wbc,n_obs_tot,
     >		    n_zon,
     >		    n_mas,n_r,
     >		    n_twu,n_U,
     >		    n_twv,n_V,
     >		    n_vor,n_W,
     >		    n_pos,n_p

      common/inte_3/iflag 

c--

      common/char_1/string ,
     >		    str_wbc 

      common/char_2/tag    ,
     >		    tag_UVW,
     >		    tag_rrr,
     >		    tag_ppp     

      common/char_3/lnm

c--
      common/logi_1/flag_b

      common/logi_2/flag_r,
     >		    flag_U,
     >		    flag_V,
     >		    flag_W,
     >		    flag_p

      common/logi_3/flag_mas,
     >              flag_twu,
     >              flag_twv,
     >              flag_vor,
     >		    flag_den,
     >		    flag_pos




c     ----------------
c     End of the file
c     ----------------



