New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
opatlh.F90 in branches/TAM_V3_2_2/NEMOTAM/OPATAM_SRC – NEMO

source: branches/TAM_V3_2_2/NEMOTAM/OPATAM_SRC/opatlh.F90 @ 3317

Last change on this file since 3317 was 2579, checked in by rblod, 13 years ago

Correct TAM_V3_2_2

File size: 4.4 KB
Line 
1MODULE opatlh
2#if defined key_tam
3   !!==============================================================================
4   !!                       ***  MODULE opatlh   ***
5   !! Ocean system   : Testing of the tangent linear hypothesis
6   !!==============================================================================
7   !! History:
8   !!   NEMO     3.0  ! 2011-01 (F. Vigilant) first version (2 different executables)
9   !!            3.2  ! 2011-01 (A. Vidard) reaorganization and update to 3.2.2
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   opa_tlh       : run the perturbed direct model and the tangent
14   !!----------------------------------------------------------------------
15   
16   USE oce           , ONLY : & ! Direct Ocean fields
17      & un,            vn,           tn,          sn,          sshn
18     
19   USE oce_tam       , ONLY : & ! Tangent Ocean fields
20      & un_tl,         vn_tl,        tn_tl,       sn_tl,       sshn_tl
21
22   USE tamctl        , ONLY : & ! TAM related namelist
23      & ln_incdx,      cn_tlhrst_in
24
25   USE step_tam      , ONLY : & ! Tangent and adjoint model integrations
26      & stp_tan
27
28   USE step          , ONLY : & ! direct model integration
29      & stp
30
31   USE istate        , ONLY : & ! initialization of the direct model
32      & istate_init
33
34   USE in_out_manager, ONLY : & ! I/O manager
35      & ctl_stop,      nit000,       nitend,     nstop,     cn_ocerst_in
36
37   USE c1d           , ONLY : & ! 1D initialization
38      & lk_c1d
39
40   USE lib_mpp       , ONLY : & ! mpp library
41      & mpp_max, lk_mpp
42
43   PRIVATE
44
45   PUBLIC opa_tlh
46   PUBLIC opa_tlh_store
47CONTAINS
48   SUBROUTINE opa_tlh
49      !!----------------------------------------------------------------------
50      !!                     ***  ROUTINE opa_tlh  ***
51      !!
52      !! ** Purpose :   performe the second integration of the direct model
53      !!                and the integration of the tangent model in order to
54      !!                validate (or not) the tangent linear hypothesis
55      !!
56      !!----------------------------------------------------------------------
57
58      INTEGER :: istp
59
60      IF ( ln_incdx ) THEN
61         ! read in the increment
62         CALL ctl_stop( '   tlh from increment not available')         
63         
64         ! create the new direct model initial state
65      ELSE
66         ! Read another restart
67         cn_ocerst_in = cn_tlhrst_in
68         CALL istate_init
69         ! compute the increment
70         un_tl   = un_tl   - un
71         vn_tl   = vn_tl   - vn
72         tn_tl   = tn_tl   - tn
73         sn_tl   = sn_tl   - sn
74         sshn_tl = sshn_tl - sshn
75         
76      END IF
77
78      ! Integration of the direct model from the perturbed state
79      istp = nit000
80      IF( lk_c1d ) THEN                 !==  1D configuration  ==!
81         CALL ctl_stop( '       lk_c1d not available')         
82      ELSE                              !==  3D ocean with  ==!
83         DO WHILE ( istp <= nitend .AND. nstop == 0 )
84# if defined key_agrif
85            CALL ctl_stop( '       Agrif not available')
86# else
87            CALL stp( istp )                 ! standard time stepping
88# endif
89            istp = istp + 1
90            IF( lk_mpp )   CALL mpp_max( nstop )
91         END DO
92      ENDIF
93      ! Integration of the tangent model
94      istp = nit000
95      IF( lk_c1d ) THEN                 !==  1D configuration  ==!
96         CALL ctl_stop( '       lk_c1d not available')         
97      ELSE                              !==  3D ocean with  ==!
98         DO WHILE ( istp <= nitend .AND. nstop == 0 )
99# if defined key_agrif
100            CALL ctl_stop( '       Agrif not available')
101# else
102            CALL stp_tan( istp )                 ! standard time stepping
103# endif
104            istp = istp + 1
105            IF( lk_mpp )   CALL mpp_max( nstop )
106         END DO
107      ENDIF
108   END SUBROUTINE opa_tlh
109   SUBROUTINE opa_tlh_store
110      !!----------------------------------------------------------------------
111      !!                     ***  ROUTINE opa_tlh_store  ***
112      !!
113      !! ** Purpose :   store the direct model initial state in the tangent
114      !!                for the computation of the increment
115      !!
116      !!----------------------------------------------------------------------
117     
118      un_tl   = un
119      vn_tl   = vn
120      tn_tl   = tn
121      sn_tl   = sn
122      sshn_tl = sshn
123   END SUBROUTINE opa_tlh_store
124#endif
125END MODULE opatlh
Note: See TracBrowser for help on using the repository browser.