1 | MODULE sbcssm |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE sbcssm *** |
---|
4 | !! Surface module : provide time-mean ocean surface variables |
---|
5 | !!====================================================================== |
---|
6 | !! History : 9.0 ! 06-07 (G. Madec) Original code |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | |
---|
9 | !!---------------------------------------------------------------------- |
---|
10 | !! sbc_ssm : calculate sea surface mean currents, temperature, |
---|
11 | !! and salinity over nn_fsbc time-step |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | USE oce ! ocean dynamics and tracers |
---|
14 | USE dom_oce ! ocean space and time domain |
---|
15 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
16 | USE prtctl ! Print control (prt_ctl routine) |
---|
17 | USE restart ! ocean restart |
---|
18 | USE iom |
---|
19 | USE in_out_manager ! I/O manager |
---|
20 | |
---|
21 | IMPLICIT NONE |
---|
22 | PRIVATE |
---|
23 | |
---|
24 | PUBLIC sbc_ssm ! routine called by step.F90 |
---|
25 | |
---|
26 | !! * Substitutions |
---|
27 | # include "domzgr_substitute.h90" |
---|
28 | !!---------------------------------------------------------------------- |
---|
29 | !! OPA 9.0 , LOCEAN-IPSL (2006) |
---|
30 | !! $Id$ |
---|
31 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
32 | !!---------------------------------------------------------------------- |
---|
33 | |
---|
34 | CONTAINS |
---|
35 | |
---|
36 | SUBROUTINE sbc_ssm( kt ) |
---|
37 | !!--------------------------------------------------------------------- |
---|
38 | !! *** ROUTINE sbc_oce *** |
---|
39 | !! |
---|
40 | !! ** Purpose : provide ocean surface variable to sea-surface boundary |
---|
41 | !! condition computation |
---|
42 | !! |
---|
43 | !! ** Method : compute mean surface velocity (2 components at U and |
---|
44 | !! V-points) [m/s], temperature [Celcius] and salinity [psu] over |
---|
45 | !! the periode (kt - nn_fsbc) to kt |
---|
46 | !!--------------------------------------------------------------------- |
---|
47 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
48 | ! |
---|
49 | REAL(wp) :: zcoef ! temporary scalar |
---|
50 | REAL(wp) :: zf_sbc ! read sbc frequency |
---|
51 | !!--------------------------------------------------------------------- |
---|
52 | ! ! ---------------------------------------- ! |
---|
53 | IF( nn_fsbc == 1 ) THEN ! Instantaneous surface fields ! |
---|
54 | ! ! ---------------------------------------- ! |
---|
55 | IF( kt == nit000 ) THEN |
---|
56 | IF(lwp) WRITE(numout,*) |
---|
57 | IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields, nn_fsbc=1 : instantaneous values' |
---|
58 | IF(lwp) WRITE(numout,*) '~~~~~~~ ' |
---|
59 | ENDIF |
---|
60 | ! |
---|
61 | ssu_m(:,:) = ub(:,:,1) |
---|
62 | ssv_m(:,:) = vb(:,:,1) |
---|
63 | sst_m(:,:) = tn(:,:,1) |
---|
64 | sss_m(:,:) = sn(:,:,1) |
---|
65 | ssh_m(:,:) = sshn(:,:) |
---|
66 | ! |
---|
67 | ELSE |
---|
68 | ! ! ---------------------------------------- ! |
---|
69 | IF( kt == nit000) THEN ! Initialisation: 1st time-step ! |
---|
70 | ! ! ---------------------------------------- ! |
---|
71 | IF(lwp) WRITE(numout,*) |
---|
72 | IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields' |
---|
73 | ! |
---|
74 | IF( ln_rstart .AND. iom_varid( numror, 'nn_fsbc', ldstop = .FALSE. ) > 0 ) THEN |
---|
75 | CALL iom_get( numror , 'nn_fsbc', zf_sbc ) ! sbc frequency of previous run |
---|
76 | CALL iom_get( numror, jpdom_autoglo, 'ssu_m' , ssu_m ) ! sea surface mean velocity (T-point) |
---|
77 | CALL iom_get( numror, jpdom_autoglo, 'ssv_m' , ssv_m ) ! " " velocity (V-point) |
---|
78 | CALL iom_get( numror, jpdom_autoglo, 'sst_m' , sst_m ) ! " " temperature (T-point) |
---|
79 | CALL iom_get( numror, jpdom_autoglo, 'sss_m' , sss_m ) ! " " salinity (T-point) |
---|
80 | CALL iom_get( numror, jpdom_autoglo, 'ssh_m' , ssh_m ) ! " " height (T-point) |
---|
81 | ! |
---|
82 | IF( zf_sbc /= REAL( nn_fsbc, wp ) ) THEN ! nn_fsbc has changed between 2 runs |
---|
83 | IF(lwp) WRITE(numout,*) '~~~~~~~ restart with a change in the frequency of mean ', & |
---|
84 | & 'from ', zf_sbc, ' to ', nn_fsbc |
---|
85 | zcoef = REAL( nn_fsbc - 1, wp ) / zf_sbc |
---|
86 | ssu_m(:,:) = zcoef * ssu_m(:,:) |
---|
87 | ssv_m(:,:) = zcoef * ssv_m(:,:) |
---|
88 | sst_m(:,:) = zcoef * sst_m(:,:) |
---|
89 | sss_m(:,:) = zcoef * sss_m(:,:) |
---|
90 | ssh_m(:,:) = zcoef * ssh_m(:,:) |
---|
91 | ELSE |
---|
92 | IF(lwp) WRITE(numout,*) '~~~~~~~ mean fields read in the ocean restart file' |
---|
93 | ENDIF |
---|
94 | ELSE |
---|
95 | IF(lwp) WRITE(numout,*) '~~~~~~~ mean fields initialised to instantaneous values' |
---|
96 | zcoef = REAL( nn_fsbc - 1, wp ) |
---|
97 | ssu_m(:,:) = zcoef * ub(:,:,1) |
---|
98 | ssv_m(:,:) = zcoef * vb(:,:,1) |
---|
99 | sst_m(:,:) = zcoef * tn(:,:,1) |
---|
100 | sss_m(:,:) = zcoef * sn(:,:,1) |
---|
101 | ssh_m(:,:) = zcoef * sshn(:,:) |
---|
102 | ENDIF |
---|
103 | ! ! ---------------------------------------- ! |
---|
104 | ELSEIF( MOD( kt - 2 , nn_fsbc ) == 0 ) THEN ! Initialisation: New mean computation ! |
---|
105 | ! ! ---------------------------------------- ! |
---|
106 | ssu_m(:,:) = 0.e0 ! reset to zero ocean mean sbc fields |
---|
107 | ssv_m(:,:) = 0.e0 |
---|
108 | sst_m(:,:) = 0.e0 |
---|
109 | sss_m(:,:) = 0.e0 |
---|
110 | ssh_m(:,:) = 0.e0 |
---|
111 | ENDIF |
---|
112 | ! ! ---------------------------------------- ! |
---|
113 | ! ! Cumulate at each time step ! |
---|
114 | ! ! ---------------------------------------- ! |
---|
115 | ssu_m(:,:) = ssu_m(:,:) + ub(:,:,1) |
---|
116 | ssv_m(:,:) = ssv_m(:,:) + vb(:,:,1) |
---|
117 | sst_m(:,:) = sst_m(:,:) + tn(:,:,1) |
---|
118 | sss_m(:,:) = sss_m(:,:) + sn(:,:,1) |
---|
119 | ssh_m(:,:) = ssh_m(:,:) + sshn(:,:) |
---|
120 | |
---|
121 | ! ! ---------------------------------------- ! |
---|
122 | IF( MOD( kt - 1 , nn_fsbc ) == 0 ) THEN ! Mean value at each nn_fsbc time-step ! |
---|
123 | ! ! ---------------------------------------- ! |
---|
124 | zcoef = 1. / REAL( nn_fsbc, wp ) |
---|
125 | sst_m(:,:) = sst_m(:,:) * zcoef ! mean SST [Celcius] |
---|
126 | sss_m(:,:) = sss_m(:,:) * zcoef ! mean SSS [psu] |
---|
127 | ssu_m(:,:) = ssu_m(:,:) * zcoef ! mean suface current [m/s] |
---|
128 | ssv_m(:,:) = ssv_m(:,:) * zcoef ! |
---|
129 | ssh_m(:,:) = ssh_m(:,:) * zcoef ! mean SSH [m] |
---|
130 | ! |
---|
131 | ENDIF |
---|
132 | ! ! ---------------------------------------- ! |
---|
133 | IF( lrst_oce ) THEN ! Write in the ocean restart file ! |
---|
134 | ! ! ---------------------------------------- ! |
---|
135 | IF(lwp) WRITE(numout,*) |
---|
136 | IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields written in ocean restart file ', & |
---|
137 | & 'at it= ', kt,' date= ', ndastp |
---|
138 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
139 | zf_sbc = REAL( nn_fsbc, wp ) |
---|
140 | CALL iom_rstput( kt, nitrst, numrow, 'nn_fsbc', zf_sbc ) ! sbc frequency |
---|
141 | CALL iom_rstput( kt, nitrst, numrow, 'ssu_m' , ssu_m ) ! sea surface mean fields |
---|
142 | CALL iom_rstput( kt, nitrst, numrow, 'ssv_m' , ssv_m ) |
---|
143 | CALL iom_rstput( kt, nitrst, numrow, 'sst_m' , sst_m ) |
---|
144 | CALL iom_rstput( kt, nitrst, numrow, 'sss_m' , sss_m ) |
---|
145 | CALL iom_rstput( kt, nitrst, numrow, 'ssh_m' , ssh_m ) |
---|
146 | ! |
---|
147 | ENDIF |
---|
148 | ! |
---|
149 | ENDIF |
---|
150 | ! |
---|
151 | END SUBROUTINE sbc_ssm |
---|
152 | |
---|
153 | !!====================================================================== |
---|
154 | END MODULE sbcssm |
---|