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.
trc_oce_tam.F90 in branches/TAM_V3_0/NEMOTAM/OPATAM_SRC – NEMO

source: branches/TAM_V3_0/NEMOTAM/OPATAM_SRC/trc_oce_tam.F90 @ 1885

Last change on this file since 1885 was 1885, checked in by rblod, 14 years ago

add TAM sources

File size: 3.6 KB
Line 
1MODULE trc_oce_tam
2#if defined key_tam
3   !!======================================================================
4   !!                      ***  MODULE  trc_oce_tam  ***
5   !! Ocean passive tracer  :  share SMS/Ocean variables
6   !!                          Tangent and Adjoint Module
7   !!======================================================================
8   !! History of the direct module:
9   !!   9.0  !  04-03  (C. Ethe)  F90: Free form and module
10   !! History of the T&A module:
11   !!   9.0  !  08-11  (A. Vidard)  original version
12   !!----------------------------------------------------------------------
13# if defined key_top && defined key_pisces
14   !!----------------------------------------------------------------------
15   !!  OPA 9.0 , LOCEAN-IPSL (2005)
16   !! $Id: trc_oce.F90 1152 2008-06-26 14:11:13Z rblod $
17   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
18   !!----------------------------------------------------------------------
19   USE sms_pisces_tam , ONLY :  &
20      etot3_tl    =>   etot3_tl & !!:  Biological fluxes for light
21      etot3_ad    =>   etot3_ad   !!:  Biological fluxes for light
22# else
23   !!----------------------------------------------------------------------
24   !! Default option                         No Biological fluxes for light         
25   !!----------------------------------------------------------------------
26   USE par_kind, ONLY : &       ! Precision variables
27      & wp
28   USE par_oce, ONLY: &
29      & jpi,          &
30      & jpj,          &
31      & jpk
32   !! * Module variables
33   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: &
34      & etot3_tl, &
35      & etot3_ad
36# endif
37   PUBLIC &
38      & trc_oce_tam_init, & !: Initialize the trend TAM fields
39      & etot3_tl, &
40      & etot3_ad
41
42CONTAINS
43
44   SUBROUTINE trc_oce_tam_init( kindic )
45      !!-----------------------------------------------------------------------
46      !!
47      !!                  ***  ROUTINE trc_oce_tam_init  ***
48      !!
49      !! ** Purpose : Allocate and initialize the tangent linear and
50      !!              adjoint arrays
51      !!
52      !! ** Method  : kindic = 0  allocate/initialize both tl and ad variables
53      !!              kindic = 1  allocate/initialize only tl variables
54      !!              kindic = 2  allocate/initialize only ad variables
55      !!
56      !! ** Action  :
57      !!
58      !! References :
59      !!
60      !! History :
61      !!        ! 09-05 (F. Vigilant) Initial version
62      !!-----------------------------------------------------------------------
63      !! * Arguments
64      INTEGER, INTENT(IN) :: &
65         & kindic        ! indicate which variables to allocate/initialize
66
67      !! * Local declarations
68      ! Allocate tangent linear variable arrays
69      ! ---------------------------------------
70
71      IF ( kindic == 0 .OR. kindic == 1 ) THEN
72
73         IF ( .NOT. ALLOCATED(etot3_tl) ) THEN
74
75            ALLOCATE( etot3_tl(jpi,jpj,jpk) )
76
77         ENDIF
78
79         ! Initialize tangent linear variable arrays to zero
80         ! -------------------------------------------------
81
82         etot3_tl   (:,:,:) = 0.0_wp
83
84      END IF
85
86      IF ( kindic == 0 .OR. kindic == 2 ) THEN
87           
88         ! Allocate adjoint variable arrays
89         ! --------------------------------
90
91         IF ( .NOT. ALLOCATED(etot3_ad) ) THEN
92
93            ALLOCATE( etot3_ad(jpi,jpj,jpk) )
94
95         ENDIF
96
97         ! Initialize adjoint variable arrays to zero
98         ! ------------------------------------------
99
100         etot3_ad   (:,:,:) = 0.0_wp
101
102      END IF
103
104   END SUBROUTINE trc_oce_tam_init
105
106#endif
107END MODULE trc_oce_tam
108
Note: See TracBrowser for help on using the repository browser.