!-------------------------------------- LICENCE BEGIN ------------------------------------
!Environment Canada - Atmospheric Science and Technology License/Disclaimer, 
!                     version 3; Last Modified: May 7, 2008.
!This is free but copyrighted software; you can use/redistribute/modify it under the terms 
!of the Environment Canada - Atmospheric Science and Technology License/Disclaimer 
!version 3 or (at your option) any later version that should be found at: 
!http://collaboration.cmc.ec.gc.ca/science/rpn.comm/license.html 
!
!This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
!without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
!See the above mentioned License/Disclaimer for more details.
!You should have received a copy of the License/Disclaimer along with this software; 
!if not, you can write to: EC-RPN COMM Group, 2121 TransCanada, suite 500, Dorval (Quebec), 
!CANADA, H9P 1J3; or send e-mail to service.rpn@ec.gc.ca
!-------------------------------------- LICENCE END --------------------------------------
***s/r v4d_options - Activate one 4D-Var job according to V4dg_conf 
*
#include "model_macros_f.h"
*

      subroutine v4d_options  1,5
*
      implicit none
*
*author
*     M. Tanguay
*
*revision
* v3_20 - Tanguay M.        - initial MPI version
*
*object
*	
*arguments
*	none
*
#include "v4dg.cdk"
#include "lun.cdk"
*
*     ---------------------------------------------------------------
*
      if (V4dg_conf/100.eq.1) then
*
           if(V4dg_sensib_L.or.V4dg_twin_L) then
*
              call v4d_gem   ! Sensitivity analysis or Twin experiment 
*
           elseif(V4dg_4dvar_L.or.V4dg_sgvc_L) then
*
              call v4d_4dvar ! 4D-Var + exchange with 3D-Var OR Singular vectors 
*
           else 
*
              if(Lun_out.gt.0)  write(Lun_out,*)'One of SENSIB_L,TWIN_L,4DVAR_L or SGVC_L should be TRUE'
              call gem_stop('V4D_OPTIONS',-1)
*
           endif
*
      elseif (V4dg_conf/100.eq.4) then
*
         call v4d_testadj()  ! Verification of adjoint transposition
*
      elseif (V4dg_conf/100.eq.5) then
*
         call v4d_testtlm()  ! Verification of tangent linear model
*
      endif
*
*     ---------------------------------------------------------------
*
      return
      end