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.
trdtrc.F90 in branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/TOP_SRC/TRP/trdtrc.F90 @ 10162

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

Add NEMO-FABM coupling code, essentially identical to commit 4bc68d33 of the PML NEMO-FABM GitLab?.

File size: 8.0 KB
Line 
1MODULE trdtrc
2   !!======================================================================
3   !!                       ***  MODULE  trdtrc  ***
4   !! Ocean diagnostics:  mixed layer passive tracer trends
5   !!======================================================================
6   !! History :  3.0  !  2010-07  (C. Ethe)  Original code (from trdtrc.F90)
7   !!----------------------------------------------------------------------
8#if   defined key_top && ( defined key_trdmxl_trc   ||   defined key_trdtrc )
9   !!----------------------------------------------------------------------
10   !!   'key_trdmxl_trc'                  mixed layer trend diagnostics
11   !!   'key_trdtrc'                      3D trend diagnostics
12   !!----------------------------------------------------------------------
13   !!   trdtrc      : passive tracer trends
14   !!----------------------------------------------------------------------
15   USE trc               ! tracer definitions (trn, trb, tra, etc.)
16   USE trcnam_trp
17   USE trd_oce
18   USE trdtrc_oce       ! definition of main arrays used for trends computations
19   USE trdmxl_trc        ! Mixed layer trends diag.
20   USE iom               ! I/O library
21
22   IMPLICIT NONE
23   PRIVATE
24
25   INTERFACE trd_trc
26      MODULE PROCEDURE trd_trc_trp, trd_trc_bio
27   END INTERFACE
28
29   PUBLIC trd_trc
30
31   !! * Substitutions
32#  include "top_substitute.h90"
33   !!----------------------------------------------------------------------
34   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
35   !! $Id$
36   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
37   !!----------------------------------------------------------------------
38
39CONTAINS
40
41   SUBROUTINE trd_trc_trp( ptrtrd, kjn, ktrd, kt )
42      !!----------------------------------------------------------------------
43      !!                  ***  ROUTINE trd_trc  ***
44      !!----------------------------------------------------------------------
45      INTEGER, INTENT( in )  ::   kt                                  ! time step
46      INTEGER, INTENT( in )  ::   kjn                                 ! tracer index
47      INTEGER, INTENT( in )  ::   ktrd                                ! tracer trend index
48      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout )  ::   ptrtrd  ! Temperature or U trend
49      CHARACTER (len=20) :: cltra
50      !!----------------------------------------------------------------------
51
52      IF( kt == nittrc000 ) THEN
53!         IF(lwp)WRITE(numout,*)
54!         IF(lwp)WRITE(numout,*) 'trd_trc:'
55!         IF(lwp)WRITE(numout,*) '~~~~~~~~~~~~'
56      ENDIF
57
58      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
59      ! Mixed layer trends for passive tracers
60      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
61#if defined key_trdmxl_trc 
62      IF( lk_trdmxl_trc .AND. ln_trdtrc( kjn ) ) THEN
63         !
64         SELECT CASE ( ktrd )
65         CASE ( jptra_xad     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_xad, '3D', kjn )
66         CASE ( jptra_yad     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_yad, '3D', kjn )
67         CASE ( jptra_zad     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_zad, '3D', kjn )
68         CASE ( jptra_ldf     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_ldf, '3D', kjn )
69         CASE ( jptra_bbl     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_bbl, '3D', kjn )
70         CASE ( jptra_zdf     )
71            IF( ln_trcldf_iso ) THEN
72               CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_ldf, '3D', kjn )
73            ELSE
74               CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_zdf, '3D', kjn )
75            ENDIF
76         CASE ( jptra_dmp     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_dmp , '3D', kjn )
77         CASE ( jptra_nsr     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_sbc , '2D', kjn )
78         CASE ( jptra_sms     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_sms , '3D', kjn )
79         CASE ( jptra_radb    )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_radb, '3D', kjn )
80         CASE ( jptra_radn    )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_radn, '3D', kjn )
81         CASE ( jptra_atf     )   ;   CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_atf , '3D', kjn )
82         END SELECT
83         !
84      END IF
85#endif
86
87      IF( lk_trdtrc .AND. ln_trdtrc( kjn ) ) THEN
88         !
89         SELECT CASE( ktrd )
90         CASE( jptra_xad  )       ;    WRITE (cltra,'("XAD_",4a)')
91         CASE( jptra_yad  )       ;    WRITE (cltra,'("YAD_",4a)')
92         CASE( jptra_zad  )       ;    WRITE (cltra,'("ZAD_",4a)')
93         CASE( jptra_ldf  )       ;    WRITE (cltra,'("LDF_",4a)')
94         CASE( jptra_bbl  )       ;    WRITE (cltra,'("BBL_",4a)')
95         CASE( jptra_nsr  )       ;    WRITE (cltra,'("FOR_",4a)')
96         CASE( jptra_zdf  )       ;    WRITE (cltra,'("ZDF_",4a)')
97         CASE( jptra_dmp  )       ;    WRITE (cltra,'("DMP_",4a)')
98         CASE( jptra_sms  )       ;    WRITE (cltra,'("SMS_",4a)')
99         CASE( jptra_atf  )       ;    WRITE (cltra,'("ATF_",4a)')
100         CASE( jptra_radb )       ;    WRITE (cltra,'("RDB_",4a)')
101         CASE( jptra_radn )       ;    WRITE (cltra,'("RDN_",4a)')
102         END SELECT
103                                          cltra = TRIM(cltra)//TRIM(ctrcnm(kjn))
104         ! +++>>>FABM
105#if defined key_tracer_budget
106! for outputting depth integrated
107         SELECT CASE( ktrd )
108         CASE( jptra_xad, jptra_yad, jptra_zad  ) 
109           cltra = TRIM(cltra)//"_e3t"
110         END SELECT
111#endif
112         ! FABM <<<+++
113                                          CALL iom_put( cltra,  ptrtrd(:,:,:) )
114         !
115      END IF
116
117   END SUBROUTINE trd_trc_trp
118
119   SUBROUTINE trd_trc_bio( ptrbio, ktrd, kt )
120      !!----------------------------------------------------------------------
121      !!                  ***  ROUTINE trd_bio  ***
122      !!----------------------------------------------------------------------
123
124      INTEGER, INTENT( in )  ::   kt                                  ! time step
125      INTEGER, INTENT( in )  ::   ktrd                                ! bio trend index
126      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout )  ::   ptrbio  ! Bio trend
127      !!----------------------------------------------------------------------
128
129#if defined key_trdmxl_trc 
130      CALL trd_mxl_bio_zint( ptrbio, ktrd ) ! Verticaly integrated biological trends
131#endif
132
133   END SUBROUTINE trd_trc_bio
134#else
135   !!----------------------------------------------------------------------
136   !!   Default option :                                       Empty module
137   !!----------------------------------------------------------------------
138
139   INTERFACE trd_trc
140      MODULE PROCEDURE trd_trc_trp, trd_trc_bio
141   END INTERFACE
142
143CONTAINS
144
145   SUBROUTINE trd_trc_trp( ptrtrd, kjn, ktrd, kt )
146      INTEGER               , INTENT( in )     ::   kt      ! time step
147      INTEGER               , INTENT( in )     ::   kjn     ! tracer index
148      INTEGER               , INTENT( in )     ::   ktrd    ! tracer trend index
149      REAL, DIMENSION(:,:,:), INTENT( inout )  ::   ptrtrd  ! Temperature or U trend
150      WRITE(*,*) 'trd_trc_trp : You should not have seen this print! error?', ptrtrd(1,1,1)
151      WRITE(*,*) '  "      "      : You should not have seen this print! error?', kjn
152      WRITE(*,*) '  "      "      : You should not have seen this print! error?', ktrd
153      WRITE(*,*) '  "      "      : You should not have seen this print! error?', kt
154   END SUBROUTINE trd_trc_trp
155
156   SUBROUTINE trd_trc_bio( ptrbio, ktrd, kt )
157      INTEGER               , INTENT( in )     ::   kt      ! time step
158      INTEGER               , INTENT( in )     ::   ktrd    ! tracer trend index
159      REAL, DIMENSION(:,:,:), INTENT( inout )  ::   ptrbio  ! Temperature or U trend
160      WRITE(*,*) 'trd_trc_trp : You should not have seen this print! error?', ptrbio(1,1,1)
161      WRITE(*,*) '  "      "      : You should not have seen this print! error?', ktrd
162      WRITE(*,*) '  "      "      : You should not have seen this print! error?', kt
163   END SUBROUTINE trd_trc_bio
164
165#endif
166   !!======================================================================
167END MODULE trdtrc
Note: See TracBrowser for help on using the repository browser.