1 | MODULE trcstp |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE trcstp *** |
---|
4 | !! Time-stepping : time loop of opa for passive tracer |
---|
5 | !!====================================================================== |
---|
6 | #if defined key_passivetrc |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | !! trc_stp : passive tracer system time-stepping |
---|
9 | !!---------------------------------------------------------------------- |
---|
10 | !! * Modules used |
---|
11 | USE oce_trc ! ocean dynamics and active tracers variables |
---|
12 | USE trc ! ocean passive tracers variables |
---|
13 | USE trctrp ! passive tracers transport |
---|
14 | USE trcsms ! passive tracers sources and sinks |
---|
15 | USE trcdia ! passive tracer diagnostics (trc_dia routine) |
---|
16 | USE trcrst ! restart for passive tracers |
---|
17 | |
---|
18 | IMPLICIT NONE |
---|
19 | PRIVATE |
---|
20 | |
---|
21 | !! * Routine accessibility |
---|
22 | PUBLIC trc_stp ! called by step |
---|
23 | !!---------------------------------------------------------------------- |
---|
24 | !! TOP 1.0, LOCEAN-IPSL (2005) |
---|
25 | !! $Header$ |
---|
26 | !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
27 | !!---------------------------------------------------------------------- |
---|
28 | |
---|
29 | CONTAINS |
---|
30 | |
---|
31 | SUBROUTINE trc_stp( kt ) |
---|
32 | !!------------------------------------------------------------------- |
---|
33 | !! *** ROUTINE trc_stp *** |
---|
34 | !! |
---|
35 | !! ** Purpose : Time loop of opa for passive tracer |
---|
36 | !! |
---|
37 | !! ** Method : |
---|
38 | !! Compute the passive tracers trends |
---|
39 | !! Update the passive tracers |
---|
40 | !! |
---|
41 | !! History : |
---|
42 | !! 9.0 ! 04-03 (C. Ethe) Original |
---|
43 | !!------------------------------------------------------------------- |
---|
44 | !! * Arguments |
---|
45 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
46 | INTEGER :: jn |
---|
47 | REAL(wp) :: ztra |
---|
48 | |
---|
49 | !! * local declarations |
---|
50 | INTEGER :: indic ! error indicator if < 0 |
---|
51 | !! --------------------------------------------------------------------- |
---|
52 | |
---|
53 | indic = 1 ! reset to no error condition |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | ! diagnostics init |
---|
58 | |
---|
59 | IF( kt == nit000 ) CALL trc_dia( kt, indic ) |
---|
60 | |
---|
61 | ! these ROUTINES are called only every ndttrc time step |
---|
62 | IF( MOD( kt , ndttrc ) == 0 ) THEN |
---|
63 | |
---|
64 | ! tracers: sink and source |
---|
65 | |
---|
66 | CALL trc_sms( kt ) |
---|
67 | |
---|
68 | DO jn = 1, jptra |
---|
69 | IF(ln_ctl) THEN ! print mean trends (used for debugging) |
---|
70 | ztra = SUM( tra(2:nictle,2:njctle,1:jpkm1,jn) * tmask(2:nictle,2:njctle,1:jpkm1) ) |
---|
71 | WRITE(numout,*) ' trc/sms - ',ctrcnm(jn),' : ', ztra-tra_ctl(jn) |
---|
72 | tra_ctl(jn) = ztra |
---|
73 | ENDIF |
---|
74 | END DO |
---|
75 | |
---|
76 | |
---|
77 | |
---|
78 | ! transport of passive tracers |
---|
79 | |
---|
80 | CALL trc_trp( kt ) |
---|
81 | |
---|
82 | DO jn = 1, jptra |
---|
83 | IF(ln_ctl) THEN ! print mean trends (used for debugging) |
---|
84 | ztra = SUM( tra(2:nictle,2:njctle,1:jpkm1,jn) * tmask(2:nictle,2:njctle,1:jpkm1) ) |
---|
85 | WRITE(numout,*) ' trc/trp - ',ctrcnm(jn),' : ', ztra-tra_ctl(jn) |
---|
86 | tra_ctl(jn) = ztra |
---|
87 | ENDIF |
---|
88 | END DO |
---|
89 | |
---|
90 | ENDIF |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | ! outputs |
---|
95 | |
---|
96 | CALL trc_wri( kt ) |
---|
97 | |
---|
98 | |
---|
99 | |
---|
100 | ! diagnostics |
---|
101 | |
---|
102 | CALL trc_dia( kt, indic ) |
---|
103 | |
---|
104 | |
---|
105 | |
---|
106 | END SUBROUTINE trc_stp |
---|
107 | |
---|
108 | #else |
---|
109 | !!---------------------------------------------------------------------- |
---|
110 | !! Default key NO passive tracers |
---|
111 | !!---------------------------------------------------------------------- |
---|
112 | CONTAINS |
---|
113 | SUBROUTINE trc_stp( kt ) ! Empty routine |
---|
114 | INTEGER, INTENT(in) :: kt |
---|
115 | WRITE(*,*) 'trc_stp: You should not have seen this print! error?', kt |
---|
116 | END SUBROUTINE trc_stp |
---|
117 | #endif |
---|
118 | |
---|
119 | !!====================================================================== |
---|
120 | END MODULE trcstp |
---|