1 | MODULE trcsbc |
---|
2 | !!============================================================================== |
---|
3 | !! *** MODULE trcsbc *** |
---|
4 | !! Ocean passive tracers: surface boundary condition |
---|
5 | !!====================================================================== |
---|
6 | !! History : 8.2 ! 1998-10 (G. Madec, G. Roullet, M. Imbard) Original code |
---|
7 | !! 8.2 ! 2001-02 (D. Ludicone) sea ice and free surface |
---|
8 | !! 8.5 ! 2002-06 (G. Madec) F90: Free form and module |
---|
9 | !! 9.0 ! 2004-03 (C. Ethe) adapted for passive tracers |
---|
10 | !! ! 2006-08 (C. Deltel) Diagnose ML trends for passive tracers |
---|
11 | !!============================================================================== |
---|
12 | #if defined key_top |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | !! 'key_top' TOP models |
---|
15 | !!---------------------------------------------------------------------- |
---|
16 | !! trc_sbc : update the tracer trend at ocean surface |
---|
17 | !!---------------------------------------------------------------------- |
---|
18 | USE oce_trc ! ocean dynamics and active tracers variables |
---|
19 | USE trc ! ocean passive tracers variables |
---|
20 | USE prtctl_trc ! Print control for debbuging |
---|
21 | USE trdmod_oce |
---|
22 | USE trdtra |
---|
23 | |
---|
24 | IMPLICIT NONE |
---|
25 | PRIVATE |
---|
26 | |
---|
27 | PUBLIC trc_sbc ! routine called by step.F90 |
---|
28 | |
---|
29 | !! * Substitutions |
---|
30 | # include "top_substitute.h90" |
---|
31 | !!---------------------------------------------------------------------- |
---|
32 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
33 | !! $Id$ |
---|
34 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
35 | !!---------------------------------------------------------------------- |
---|
36 | CONTAINS |
---|
37 | |
---|
38 | SUBROUTINE trc_sbc ( kt ) |
---|
39 | !!---------------------------------------------------------------------- |
---|
40 | !! *** ROUTINE trc_sbc *** |
---|
41 | !! |
---|
42 | !! ** Purpose : Compute the tracer surface boundary condition trend of |
---|
43 | !! (concentration/dilution effect) and add it to the general |
---|
44 | !! trend of tracer equations. |
---|
45 | !! |
---|
46 | !! ** Method : |
---|
47 | !! * concentration/dilution effect: |
---|
48 | !! The surface freshwater flux modify the ocean volume |
---|
49 | !! and thus the concentration of a tracer as : |
---|
50 | !! tra = tra + emp * trn / e3t for k=1 |
---|
51 | !! where emp, the surface freshwater budget (evaporation minus |
---|
52 | !! precipitation minus runoff) given in kg/m2/s is divided |
---|
53 | !! by 1035 kg/m3 (density of ocean water) to obtain m/s. |
---|
54 | !! |
---|
55 | !! ** Action : - Update the 1st level of tra with the trend associated |
---|
56 | !! with the tracer surface boundary condition |
---|
57 | !! |
---|
58 | !!---------------------------------------------------------------------- |
---|
59 | USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released |
---|
60 | USE wrk_nemo, ONLY: zemps => wrk_2d_1 |
---|
61 | USE wrk_nemo, ONLY: ztrtrd => wrk_3d_1 |
---|
62 | ! |
---|
63 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
64 | ! |
---|
65 | INTEGER :: ji, jj, jn ! dummy loop indices |
---|
66 | REAL(wp) :: zsrau, zse3t ! temporary scalars |
---|
67 | CHARACTER (len=22) :: charout |
---|
68 | !!---------------------------------------------------------------------- |
---|
69 | |
---|
70 | IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1) ) THEN |
---|
71 | CALL ctl_stop('trc_sbc: requested workspace array unavailable.') ; RETURN |
---|
72 | END IF |
---|
73 | |
---|
74 | IF( kt == nit000 ) THEN |
---|
75 | IF(lwp) WRITE(numout,*) |
---|
76 | IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' |
---|
77 | IF(lwp) WRITE(numout,*) '~~~~~~~ ' |
---|
78 | ENDIF |
---|
79 | |
---|
80 | |
---|
81 | IF( lk_offline ) THEN ! emps in dynamical files contains emps - rnf |
---|
82 | zemps(:,:) = emps(:,:) |
---|
83 | ELSE ! Concentration dilution effect on tracer due to evaporation, precipitation, and river runoff |
---|
84 | IF( lk_vvl ) THEN ! volume variable |
---|
85 | zemps(:,:) = emps(:,:) - emp(:,:) |
---|
86 | !!ch zemps(:,:) = 0. |
---|
87 | ELSE ! linear free surface |
---|
88 | IF( ln_rnf ) THEN ; zemps(:,:) = emps(:,:) - rnf(:,:) ! E-P-R |
---|
89 | ELSE ; zemps(:,:) = emps(:,:) |
---|
90 | ENDIF |
---|
91 | ENDIF |
---|
92 | ENDIF |
---|
93 | |
---|
94 | ! 0. initialization |
---|
95 | zsrau = 1. / rau0 |
---|
96 | DO jn = 1, jptra |
---|
97 | ! |
---|
98 | IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) ! save trends |
---|
99 | ! ! add the trend to the general tracer trend |
---|
100 | DO jj = 2, jpj |
---|
101 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
102 | zse3t = 1. / fse3t(ji,jj,1) |
---|
103 | tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zemps(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t |
---|
104 | END DO |
---|
105 | END DO |
---|
106 | |
---|
107 | IF( l_trdtrc ) THEN |
---|
108 | ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) |
---|
109 | CALL trd_tra( kt, 'TRC', jn, jptra_trd_nsr, ztrtrd ) |
---|
110 | END IF |
---|
111 | ! ! =========== |
---|
112 | END DO ! tracer loop |
---|
113 | ! ! =========== |
---|
114 | IF( ln_ctl ) THEN |
---|
115 | WRITE(charout, FMT="('sbc ')") ; CALL prt_ctl_trc_info(charout) |
---|
116 | CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) |
---|
117 | ENDIF |
---|
118 | |
---|
119 | IF( wrk_not_released(2, 1) .OR. wrk_not_released(3, 1) ) & |
---|
120 | & CALL ctl_stop('trc_sbc: failed to release workspace array.') |
---|
121 | |
---|
122 | END SUBROUTINE trc_sbc |
---|
123 | |
---|
124 | #else |
---|
125 | !!---------------------------------------------------------------------- |
---|
126 | !! Dummy module : NO passive tracer |
---|
127 | !!---------------------------------------------------------------------- |
---|
128 | CONTAINS |
---|
129 | SUBROUTINE trc_sbc (kt) ! Empty routine |
---|
130 | INTEGER, INTENT(in) :: kt |
---|
131 | WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt |
---|
132 | END SUBROUTINE trc_sbc |
---|
133 | #endif |
---|
134 | |
---|
135 | !!====================================================================== |
---|
136 | END MODULE trcsbc |
---|