New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
trasbc.F90 in branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/TRA – NEMO

source: branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/TRA/trasbc.F90 @ 2236

Last change on this file since 2236 was 2236, checked in by cetlod, 14 years ago

First guess of NEMO_v3.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.2 KB
Line 
1MODULE trasbc
2   !!==============================================================================
3   !!                       ***  MODULE  trasbc  ***
4   !! Ocean active tracers:  surface boundary condition
5   !!==============================================================================
6   !! History :  OPA  !  1998-10  (G. Madec, G. Roullet, M. Imbard)  Original code
7   !!            8.2  !  2001-02  (D. Ludicone)  sea ice and free surface
8   !!  NEMO      1.0  !  2002-06  (G. Madec)  F90: Free form and module
9   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps
10   !!             -   !  2010-09  (C. Ethe, G. Madec) Merge TRA-TRC
11   !!----------------------------------------------------------------------
12
13   !!----------------------------------------------------------------------
14   !!   tra_sbc      : update the tracer trend at ocean surface
15   !!----------------------------------------------------------------------
16   USE oce             ! ocean dynamics and active tracers
17   USE sbc_oce         ! surface boundary condition: ocean
18   USE dom_oce         ! ocean space domain variables
19   USE phycst          ! physical constant
20   USE traqsr          ! solar radiation penetration
21   USE trdmod_oce      ! ocean trends
22   USE trdtra          ! ocean trends
23   USE in_out_manager  ! I/O manager
24   USE prtctl          ! Print control
25   USE restart         ! ocean restart
26   USE sbcrnf          ! River runoff 
27   USE sbcmod          ! ln_rnf 
28   USE iom
29   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
30
31   IMPLICIT NONE
32   PRIVATE
33
34   PUBLIC   tra_sbc    ! routine called by step.F90
35
36   !! * Substitutions
37#  include "domzgr_substitute.h90"
38#  include "vectopt_loop_substitute.h90"
39   !!----------------------------------------------------------------------
40   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)
41   !! $Id$
42   !! Software governed by the CeCILL licence  (NEMOGCM/License_CeCILL.txt)
43   !!----------------------------------------------------------------------
44
45CONTAINS
46
47   SUBROUTINE tra_sbc ( kt )
48      !!----------------------------------------------------------------------
49      !!                  ***  ROUTINE tra_sbc  ***
50      !!                   
51      !! ** Purpose :   Compute the tracer surface boundary condition trend of
52      !!      (flux through the interface, concentration/dilution effect)
53      !!      and add it to the general trend of tracer equations.
54      !!
55      !! ** Method :
56      !!      Following Roullet and Madec (2000), the air-sea flux can be divided
57      !!      into three effects: (1) Fext, external forcing;
58      !!      (2) Fwi, concentration/dilution effect due to water exchanged
59      !!         at the surface by evaporation, precipitations and runoff (E-P-R);
60      !!      (3) Fwe, tracer carried with the water that is exchanged.
61      !!
62      !!      Fext, flux through the air-sea interface for temperature and salt:
63      !!            - temperature : heat flux q (w/m2). If penetrative solar
64      !!         radiation q is only the non solar part of the heat flux, the
65      !!         solar part is added in traqsr.F routine.
66      !!            ta = ta + q /(rau0 rcp e3t)  for k=1
67      !!            - salinity    : no salt flux
68      !!
69      !!      The formulation for Fwb and Fwi vary according to the free
70      !!      surface formulation (linear or variable volume).
71      !!      * Linear free surface
72      !!            The surface freshwater flux modifies the ocean volume
73      !!         and thus the concentration of a tracer and the temperature.
74      !!         First order of the effect of surface freshwater exchange
75      !!         for salinity, it can be neglected on temperature (especially
76      !!         as the temperature of precipitations and runoffs is usually
77      !!         unknown).
78      !!            - temperature : we assume that the temperature of both
79      !!         precipitations and runoffs is equal to the SST, thus there
80      !!         is no additional flux since in this case, the concentration
81      !!         dilution effect is balanced by the net heat flux associated
82      !!         to the freshwater exchange (Fwe+Fwi=0):
83      !!            (Tp P - Te E) + SST (P-E) = 0 when Tp=Te=SST
84      !!            - salinity    : evaporation, precipitation and runoff
85      !!         water has a zero salinity (Fwe=0), thus only Fwi remains:
86      !!            sa = sa + emp * sn / e3t   for k=1
87      !!         where emp, the surface freshwater budget (evaporation minus
88      !!         precipitation minus runoff) given in kg/m2/s is divided
89      !!         by 1035 kg/m3 (density of ocena water) to obtain m/s.   
90      !!         Note: even though Fwe does not appear explicitly for
91      !!         temperature in this routine, the heat carried by the water
92      !!         exchanged through the surface is part of the total heat flux
93      !!         forcing and must be taken into account in the global heat
94      !!         balance).
95      !!      * nonlinear free surface (variable volume, lk_vvl)
96      !!         contrary to the linear free surface case, Fwi is properly
97      !!         taken into account by using the true layer thicknesses to       
98      !!         calculate tracer content and advection. There is no need to
99      !!         deal with it in this routine.
100      !!           - temperature: Fwe=SST (P-E+R) is added to Fext.
101      !!           - salinity:  Fwe = 0, there is no surface flux of salt.
102      !!
103      !! ** Action  : - Update the 1st level of (ta,sa) with the trend associated
104      !!                with the tracer surface boundary condition
105      !!              - save the trend it in ttrd ('key_trdtra')
106      !!----------------------------------------------------------------------
107      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
108      !!
109      INTEGER  ::   ji, jj, jk           ! dummy loop indices 
110      REAL(wp) ::   zfact, z1_e3t        !
111      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt, ztrds
112      !!----------------------------------------------------------------------
113
114      IF( kt == nit000 ) THEN
115         IF(lwp) WRITE(numout,*)
116         IF(lwp) WRITE(numout,*) 'tra_sbc : TRAcer Surface Boundary Condition'
117         IF(lwp) WRITE(numout,*) '~~~~~~~ '
118      ENDIF
119
120      zsrau = 1. / rau0             ! initialization
121
122      IF( l_trdtra )   THEN                    !* Save ta and sa trends
123         ALLOCATE( ztrdt(jpi,jpj,jpk) )   ;    ztrdt(:,:,:) = tsa(:,:,:,jp_tem)
124         ALLOCATE( ztrds(jpi,jpj,jpk) )   ;    ztrds(:,:,:) = tsa(:,:,:,jp_sal)
125      ENDIF
126
127!!gm      IF( .NOT.ln_traqsr )   qsr(:,:) = 0.e0   ! no solar radiation penetration
128      IF( .NOT.ln_traqsr ) THEN     ! no solar radiation penetration
129         qns(:,:) = qns(:,:) + qsr(:,:)      ! total heat flux in qns
130         qsr(:,:) = 0.e0                     ! qsr set to zero
131      ENDIF
132
133      !                                          Set before sbc tracer content fields
134      !                                          ************************************
135      IF( kt == nit000 ) THEN                      ! Set the forcing field at nit000 - 1
136         !                                         ! -----------------------------------
137         IF( ln_rstart .AND.    &                     ! Restart: read in restart file
138              & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN
139            IF(lwp) WRITE(numout,*) '          nit000-1 surface tracer content forcing fields red in the restart file'
140            zfact = 0.5e0
141            CALL iom_get( numror, jpdom_autoglo, 'sbc_hc_b', sbc_hc_b )   ! before heat content sbc trend
142            CALL iom_get( numror, jpdom_autoglo, 'sbc_sc_b', sbc_sc_b )   ! before salt content sbc trend
143         ELSE                                         ! No restart or restart not found: Euler forward time stepping
144            zfact = 1.e0
145            sbc_hc_b(:,:) = 0.e0
146            sbc_sc_b(:,:) = 0.e0
147         ENDIF
148      ELSE                                         ! Swap of forcing fields
149         !                                         ! ----------------------
150         zfact = 0.5e0
151         sbc_hc_b(:,:) = sbc_hc_n(:,:)
152         sbc_sc_b(:,:) = sbc_sc_n(:,:)
153      ENDIF
154      !                                          Compute now sbc tracer content fields
155      !                                          *************************************
156
157                                                   ! Concentration dilution effect on (t,s) due to 
158                                                   ! evaporation, precipitation and qns, but not river runoff
159                                               
160      IF( lk_vvl ) THEN                            ! Variable Volume case
161         DO jj = 2, jpj
162            DO ji = fs_2, fs_jpim1   ! vector opt.
163               ! temperature : heat flux + cooling/heating effet of EMP flux
164               sbc_hc_n(ji,jj) = ro0cpr * qns(ji,jj) - zsrau * emp(ji,jj) * tsn(ji,jj,1,jp_tem)
165               ! concent./dilut. effect due to sea-ice melt/formation and (possibly) SSS restoration
166               sbc_sc_n(ji,jj) = ( emps(ji,jj) - emp(ji,jj) ) * zsrau * tsn(ji,jj,1,jp_sal)
167            END DO
168         END DO
169      ELSE                                         ! Constant Volume case
170         DO jj = 2, jpj
171            DO ji = fs_2, fs_jpim1   ! vector opt.
172               ! temperature : heat flux
173               sbc_hc_n(ji,jj) = ro0cpr * qns(ji,jj)
174               ! salinity    : salt flux + concent./dilut. effect (both in emps)
175               sbc_sc_n(ji,jj) = zsrau * emps(ji,jj) * tsn(ji,jj,1,jp_sal)
176            END DO
177         END DO
178      ENDIF
179      ! Concentration dilution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff 
180      DO jj = 2, jpj
181         DO ji = fs_2, fs_jpim1   ! vector opt.
182            z1_e3t = zfact / fse3t(ji,jj,1)
183            tsa(ji,jj,1,jp_tem) = tsa(ji,jj,1,jp_tem) + ( sbc_hc_b(ji,jj) + sbc_hc_n(ji,jj) ) * z1_e3t
184            tsa(ji,jj,1,jp_sal) = tsa(ji,jj,1,jp_sal) + ( sbc_sc_b(ji,jj) + sbc_sc_n(ji,jj) ) * z1_e3t
185         END DO
186      END DO
187      !                                          Write in the ocean restart file
188      !                                          *******************************
189      IF( lrst_oce ) THEN
190         IF(lwp) WRITE(numout,*)
191         IF(lwp) WRITE(numout,*) 'sbc : ocean surface tracer content forcing fields written in ocean restart file ',   &
192            &                    'at it= ', kt,' date= ', ndastp
193         IF(lwp) WRITE(numout,*) '~~~~'
194         CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_hc_n )
195         CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_sc_n )
196      ENDIF
197      !                             !==  Runoffs  ==!
198      ! Effect on (t,s) due to river runoff (dilution effect automatically applied via vertical tracer advection)
199      IF( ln_rnf ) THEN 
200         DO jj = 2, jpj 
201            DO ji = fs_2, fs_jpim1
202               zdep = 1. / h_rnf(ji,jj) 
203               IF ( rnf(ji,jj) .ne. 0.0 ) THEN
204                  DO jk = 1, nk_rnf(ji,jj)
205                                        tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) + tsc_rnf(ji,jj,jp_tem) * zdep
206                     IF( ln_rnf_sal )   tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal) + tsc_rnf(ji,jj,jp_sal) * zdep
207                  ENDDO
208               ENDIF
209            ENDDO 
210         ENDDO 
211      ENDIF 
212!!gm  It should be useless
213      CALL lbc_lnk( tsa(:,:,:,jp_tem), 'T', 1. )    ;    CALL lbc_lnk( tsa(:,:,:,jp_sal), 'T', 1. )
214
215      IF( l_trdtra )   THEN                      ! save the horizontal diffusive trends for further diagnostics
216         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:)
217         ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:)
218         CALL trd_tra( kt, 'TRA', jp_tem, jptra_trd_nsr, ztrdt )
219         CALL trd_tra( kt, 'TRA', jp_sal, jptra_trd_nsr, ztrds )
220         DEALLOCATE( ztrdt )      ;     DEALLOCATE( ztrds )
221      ENDIF
222      !
223      IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' sbc  - Ta: ', mask1=tmask,   &
224         &                       tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
225      !
226   END SUBROUTINE tra_sbc
227
228   !!======================================================================
229END MODULE trasbc
Note: See TracBrowser for help on using the repository browser.