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.
trcsms_my_trc.F90 in branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/MY_TRC – NEMO

source: branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90 @ 2690

Last change on this file since 2690 was 2690, checked in by gm, 13 years ago

dynamic mem: #785 ; homogeneization of the coding style associated with dyn allocation

  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1MODULE trcsms_my_trc
2   !!======================================================================
3   !!                         ***  MODULE trcsms_my_trc  ***
4   !! TOP :   Main module of the MY_TRC tracers
5   !!======================================================================
6   !! History :   2.0  !  2007-12  (C. Ethe, G. Madec) Original code
7   !!----------------------------------------------------------------------
8#if defined key_my_trc
9   !!----------------------------------------------------------------------
10   !!   'key_my_trc'                                               CFC tracers
11   !!----------------------------------------------------------------------
12   !! trc_sms_my_trc       : MY_TRC model main routine
13   !! trc_sms_my_trc_alloc : allocate arrays specific to MY_TRC sms
14   !!----------------------------------------------------------------------
15   USE par_trc         ! TOP parameters
16   USE oce_trc         ! Ocean variables
17   USE trc             ! TOP variables
18   USE trdmod_oce
19   USE trdmod_trc
20
21   IMPLICIT NONE
22   PRIVATE
23
24   PUBLIC   trc_sms_my_trc       ! called by trcsms.F90 module
25   PUBLIC   trc_sms_my_trc_alloc ! called by trcini_my_trc.F90 module
26
27   ! Defined HERE the arrays specific to MY_TRC sms and ALLOCATE them in trc_sms_my_trc_alloc
28   
29   !!----------------------------------------------------------------------
30   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
31   !! $Id$
32   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
33   !!----------------------------------------------------------------------
34CONTAINS
35
36   SUBROUTINE trc_sms_my_trc( kt )
37      !!----------------------------------------------------------------------
38      !!                     ***  trc_sms_my_trc  *** 
39      !!
40      !! ** Purpose :   main routine of MY_TRC model
41      !!
42      !! ** Method  : -
43      !!----------------------------------------------------------------------
44      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
45      USE wrk_nemo, ONLY:   ztrmyt => wrk_3d_1   ! used for lobster sms trends
46      !
47      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
48      INTEGER ::   jn   ! dummy loop index
49      !!----------------------------------------------------------------------
50
51      IF(lwp) WRITE(numout,*)
52      IF(lwp) WRITE(numout,*) ' trc_sms_my_trc:  MY_TRC model'
53      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
54
55      WHERE( (glamt <= 170) .AND. (glamt >= 160) .AND. (gphit <= -74) .AND. (gphit >=-75.6) )
56        trn(:,:,1,jpmyt1) = 1._wp
57        trb(:,:,1,jpmyt1) = 1._wp
58        tra(:,:,1,jpmyt1) = 0._wp
59      END WHERE
60
61      WHERE( ((glamt <= -165) .OR. (glamt >= 160)) .AND. (gphit <= -76) .AND. (gphit >=-80)) 
62        trn(:,:,1,jpmyt2) = 1._wp
63        trb(:,:,1,jpmyt2) = 1._wp
64        tra(:,:,1,jpmyt2) = 0._wp
65      END WHERE
66
67      IF( l_trdtrc ) THEN      ! Save the trends in the ixed layer
68          DO jn = jp_myt0, jp_myt1
69            ztrmyt(:,:,:) = tra(:,:,:,jn)
70            CALL trd_mod_trc( ztrmyt, jn, jptra_trd_sms, kt )   ! save trends
71          END DO
72      END IF
73      !
74   END SUBROUTINE trc_sms_my_trc
75
76
77   INTEGER FUNCTION trc_sms_my_trc_alloc()
78      !!----------------------------------------------------------------------
79      !!              ***  ROUTINE trc_sms_my_trc_alloc  ***
80      !!----------------------------------------------------------------------
81      !
82      ! ALLOCATE here the arrays specific to MY_TRC
83      ! ALLOCATE( tab(...) , STAT=trc_sms_my_trc_alloc )
84      trc_sms_my_trc_alloc = 0      ! set to zero if no array to be allocated
85      !
86      IF( trc_sms_my_trc_alloc /= 0 ) CALL ctl_warn('trc_sms_my_trc_alloc : failed to allocate arrays')
87      !
88   END FUNCTION trc_sms_my_trc_alloc
89
90
91#else
92   !!----------------------------------------------------------------------
93   !!   Dummy module                                        No MY_TRC model
94   !!----------------------------------------------------------------------
95CONTAINS
96   SUBROUTINE trc_sms_my_trc( kt )             ! Empty routine
97      INTEGER, INTENT( in ) ::   kt
98      WRITE(*,*) 'trc_sms_my_trc: You should not have seen this print! error?', kt
99   END SUBROUTINE trc_sms_my_trc
100#endif
101
102   !!======================================================================
103END MODULE trcsms_my_trc
Note: See TracBrowser for help on using the repository browser.