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 | |
---|
16 | IMPLICIT NONE |
---|
17 | PRIVATE |
---|
18 | |
---|
19 | !! * Routine accessibility |
---|
20 | PUBLIC trc_stp ! called by step |
---|
21 | !!---------------------------------------------------------------------- |
---|
22 | !! OPA 9.0 , LODYC-IPSL (2003) |
---|
23 | !!---------------------------------------------------------------------- |
---|
24 | |
---|
25 | CONTAINS |
---|
26 | |
---|
27 | SUBROUTINE trc_stp( kt ) |
---|
28 | !!------------------------------------------------------------------- |
---|
29 | !! *** ROUTINE trc_stp *** |
---|
30 | !! |
---|
31 | !! ** Purpose : Time loop of opa for passive tracer |
---|
32 | !! |
---|
33 | !! ** Method : |
---|
34 | !! Compute the passive tracers trends |
---|
35 | !! Update the passive tracers |
---|
36 | !! |
---|
37 | !! History : |
---|
38 | !! 9.0 ! 04-03 (C. Ethe) Original |
---|
39 | !!------------------------------------------------------------------- |
---|
40 | !! * Arguments |
---|
41 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
42 | INTEGER :: jn |
---|
43 | REAL(wp) :: ztra |
---|
44 | |
---|
45 | |
---|
46 | ! this ROUTINE is called only every ndttrc time step |
---|
47 | IF( MOD( kt , ndttrc ) /= 0 ) RETURN |
---|
48 | |
---|
49 | ! tracers: sink and source |
---|
50 | |
---|
51 | |
---|
52 | CALL trc_sms( kt ) |
---|
53 | |
---|
54 | DO jn = 1, jptra |
---|
55 | IF(ln_ctl) THEN ! print mean trends (used for debugging) |
---|
56 | ztra = SUM( tra(2:nictle,2:njctle,1:jpkm1,jn) * tmask(2:nictle,2:njctle,1:jpkm1) ) |
---|
57 | WRITE(numout,*) ' trc/sms - ',ctrcnm(jn),' : ', ztra-tra_ctl(jn) |
---|
58 | tra_ctl(jn) = ztra |
---|
59 | ENDIF |
---|
60 | END DO |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | ! transport of passive tracers |
---|
65 | |
---|
66 | CALL trc_trp( 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/trp - ',ctrcnm(jn),' : ', ztra-tra_ctl(jn) |
---|
72 | tra_ctl(jn) = ztra |
---|
73 | ENDIF |
---|
74 | END DO |
---|
75 | |
---|
76 | |
---|
77 | |
---|
78 | END SUBROUTINE trc_stp |
---|
79 | |
---|
80 | #else |
---|
81 | !!---------------------------------------------------------------------- |
---|
82 | !! Default key NO passive tracers |
---|
83 | !!---------------------------------------------------------------------- |
---|
84 | CONTAINS |
---|
85 | SUBROUTINE trc_stp( kt ) ! Empty routine |
---|
86 | INTEGER, INTENT(in) :: kt |
---|
87 | WRITE(*,*) 'trc_stp: You should not have seen this print! error?', kt |
---|
88 | END SUBROUTINE trc_stp |
---|
89 | #endif |
---|
90 | |
---|
91 | !!====================================================================== |
---|
92 | END MODULE trcstp |
---|