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/UKMO/AMM15_v3_6_STABLE_package_FABM/NEMOGCM/NEMO/TOP_SRC/MY_TRC – NEMO

source: branches/UKMO/AMM15_v3_6_STABLE_package_FABM/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90 @ 10156

Last change on this file since 10156 was 10156, checked in by dford, 6 years ago

Apply patch fabm_patch_e3284ca_889163b.diff from Jim Clark.

File size: 4.1 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 trd_oce
19   USE trdtrc
20   USE trcbc, only : trc_bc_read
21
22   IMPLICIT NONE
23   PRIVATE
24
25   PUBLIC   trc_sms_my_trc       ! called by trcsms.F90 module
26   PUBLIC   trc_sms_my_trc_alloc ! called by trcini_my_trc.F90 module
27
28   ! Defined HERE the arrays specific to MY_TRC sms and ALLOCATE them in trc_sms_my_trc_alloc
29
30   !!----------------------------------------------------------------------
31   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
32   !! $Id$
33   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37   SUBROUTINE trc_sms_my_trc( kt )
38      !!----------------------------------------------------------------------
39      !!                     ***  trc_sms_my_trc  ***
40      !!
41      !! ** Purpose :   main routine of MY_TRC model
42      !!
43      !! ** Method  : -
44      !!----------------------------------------------------------------------
45      !
46      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
47      INTEGER ::   jn   ! dummy loop index
48      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrmyt
49      !!----------------------------------------------------------------------
50      !
51      IF( nn_timing == 1 )  CALL timing_start('trc_sms_my_trc')
52      !
53      IF(lwp) WRITE(numout,*)
54      IF(lwp) WRITE(numout,*) ' trc_sms_my_trc:  MY_TRC model'
55      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
56
57      IF( l_trdtrc )  CALL wrk_alloc( jpi, jpj, jpk, ztrmyt )
58
59      CALL trc_bc_read  ( kt )       ! tracers: surface and lateral Boundary Conditions
60
61      IF( l_trdtrc ) THEN      ! Save the trends in the ixed layer
62          DO jn = jp_myt0, jp_myt1
63            ztrmyt(:,:,:) = tra(:,:,:,jn)
64            CALL trd_trc( ztrmyt, jn, jptra_sms, kt )   ! save trends
65          END DO
66          CALL wrk_dealloc( jpi, jpj, jpk, ztrmyt )
67      END IF
68      !
69      IF( nn_timing == 1 )  CALL timing_stop('trc_sms_my_trc')
70      !
71   END SUBROUTINE trc_sms_my_trc
72
73
74   INTEGER FUNCTION trc_sms_my_trc_alloc()
75      !!----------------------------------------------------------------------
76      !!              ***  ROUTINE trc_sms_my_trc_alloc  ***
77      !!----------------------------------------------------------------------
78      !
79      ! ALLOCATE here the arrays specific to MY_TRC
80      ! ALLOCATE( tab(...) , STAT=trc_sms_my_trc_alloc )
81      trc_sms_my_trc_alloc = 0      ! set to zero if no array to be allocated
82      !
83      IF( trc_sms_my_trc_alloc /= 0 ) CALL ctl_warn('trc_sms_my_trc_alloc : failed to allocate arrays')
84      !
85   END FUNCTION trc_sms_my_trc_alloc
86
87
88#else
89   !!----------------------------------------------------------------------
90   !!   Dummy module                                        No MY_TRC model
91   !!----------------------------------------------------------------------
92CONTAINS
93   SUBROUTINE trc_sms_my_trc( kt )             ! Empty routine
94      INTEGER, INTENT( in ) ::   kt
95      WRITE(*,*) 'trc_sms_my_trc: You should not have seen this print! error?', kt
96   END SUBROUTINE trc_sms_my_trc
97#endif
98
99   !!======================================================================
100END MODULE trcsms_my_trc
Note: See TracBrowser for help on using the repository browser.