1 | MODULE trcsbc |
---|
2 | !!============================================================================== |
---|
3 | !! *** MODULE trcsbc *** |
---|
4 | !! Ocean passive tracers: surface boundary condition |
---|
5 | !!====================================================================== |
---|
6 | !! History : 8.2 ! 98-10 (G. Madec, G. Roullet, M. Imbard) Original code |
---|
7 | !! 8.2 ! 01-02 (D. Ludicone) sea ice and free surface |
---|
8 | !! 8.5 ! 02-06 (G. Madec) F90: Free form and module |
---|
9 | !! 9.0 ! 04-03 (C. Ethe) adapted for passive tracers |
---|
10 | !! ! 06-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 | !! * Modules used |
---|
19 | USE oce_trc ! ocean dynamics and active tracers variables |
---|
20 | USE trp_trc ! ocean passive tracers variables |
---|
21 | USE prtctl_trc ! Print control for debbuging |
---|
22 | USE trdmld_trc |
---|
23 | USE trdmld_trc_oce |
---|
24 | |
---|
25 | IMPLICIT NONE |
---|
26 | PRIVATE |
---|
27 | |
---|
28 | !! * Routine accessibility |
---|
29 | PUBLIC trc_sbc ! routine called by step.F90 |
---|
30 | |
---|
31 | !! * Substitutions |
---|
32 | # include "top_substitute.h90" |
---|
33 | !!---------------------------------------------------------------------- |
---|
34 | !! TOP 1.0 , LOCEAN-IPSL (2005) |
---|
35 | !! $Id$ |
---|
36 | !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
37 | !!---------------------------------------------------------------------- |
---|
38 | |
---|
39 | CONTAINS |
---|
40 | |
---|
41 | SUBROUTINE trc_sbc ( kt ) |
---|
42 | !!---------------------------------------------------------------------- |
---|
43 | !! *** ROUTINE trc_sbc *** |
---|
44 | !! |
---|
45 | !! ** Purpose : Compute the tracer surface boundary condition trend of |
---|
46 | !! (concentration/dilution effect) and add it to the general |
---|
47 | !! trend of tracer equations. |
---|
48 | !! |
---|
49 | !! ** Method : |
---|
50 | !! * concentration/dilution effect: |
---|
51 | !! The surface freshwater flux modify the ocean volume |
---|
52 | !! and thus the concentration of a tracer as : |
---|
53 | !! tra = tra + emp * trn / e3t for k=1 |
---|
54 | !! where emp, the surface freshwater budget (evaporation minus |
---|
55 | !! precipitation minus runoff) given in kg/m2/s is divided |
---|
56 | !! by 1000 kg/m3 (density of plain water) to obtain m/s. |
---|
57 | !! |
---|
58 | !! ** Action : - Update the 1st level of tra with the trend associated |
---|
59 | !! with the tracer surface boundary condition |
---|
60 | !! |
---|
61 | !!---------------------------------------------------------------------- |
---|
62 | !! * Arguments |
---|
63 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
64 | |
---|
65 | !! * Local declarations |
---|
66 | INTEGER :: ji, jj, jn ! dummy loop indices |
---|
67 | REAL(wp) :: ztra, zsrau, zse3t ! temporary scalars |
---|
68 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrtrd |
---|
69 | CHARACTER (len=22) :: charout |
---|
70 | !!---------------------------------------------------------------------- |
---|
71 | |
---|
72 | IF( kt == nittrc000 ) THEN |
---|
73 | IF(lwp) WRITE(numout,*) |
---|
74 | IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' |
---|
75 | IF(lwp) WRITE(numout,*) '~~~~~~~ ' |
---|
76 | ENDIF |
---|
77 | |
---|
78 | IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) |
---|
79 | |
---|
80 | ! 0. initialization |
---|
81 | zsrau = 1. / rauw |
---|
82 | IF( .NOT. ln_sco ) zse3t = 1. / fse3t(1,1,1) |
---|
83 | |
---|
84 | DO jn = 1, jptra |
---|
85 | ! 1. Concentration dillution effect on tra |
---|
86 | IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) ! save trends |
---|
87 | |
---|
88 | DO jj = 2, jpj |
---|
89 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
90 | IF( ln_sco ) zse3t = 1. / fse3t(ji,jj,1) |
---|
91 | ! concent./dilut. effect |
---|
92 | ztra = emps(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t * tmask(ji,jj,1) |
---|
93 | |
---|
94 | ! add the trend to the general tracer trend |
---|
95 | tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ztra |
---|
96 | END DO |
---|
97 | END DO |
---|
98 | |
---|
99 | IF( l_trdtrc ) THEN |
---|
100 | ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) |
---|
101 | IF (luttrd(jn)) CALL trd_mod_trc(ztrtrd, jn, jptrc_trd_sbc, kt) |
---|
102 | END IF |
---|
103 | |
---|
104 | ! ! =========== |
---|
105 | END DO ! tracer loop |
---|
106 | ! ! =========== |
---|
107 | |
---|
108 | IF( l_trdtrc ) DEALLOCATE( ztrtrd ) |
---|
109 | |
---|
110 | |
---|
111 | IF(ln_ctl) THEN ! print mean trends (used for debugging) |
---|
112 | WRITE(charout, FMT="('sbc')") |
---|
113 | CALL prt_ctl_trc_info(charout) |
---|
114 | CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') |
---|
115 | ENDIF |
---|
116 | |
---|
117 | END SUBROUTINE trc_sbc |
---|
118 | |
---|
119 | #else |
---|
120 | !!---------------------------------------------------------------------- |
---|
121 | !! Dummy module : NO passive tracer |
---|
122 | !!---------------------------------------------------------------------- |
---|
123 | CONTAINS |
---|
124 | SUBROUTINE trc_sbc (kt) ! Empty routine |
---|
125 | INTEGER, INTENT(in) :: kt |
---|
126 | WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt |
---|
127 | END SUBROUTINE trc_sbc |
---|
128 | #endif |
---|
129 | |
---|
130 | !!====================================================================== |
---|
131 | END MODULE trcsbc |
---|