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.
Changeset 1859 for branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/TRA/trasbc.F90 – NEMO

Ignore:
Timestamp:
2010-05-06T10:40:07+02:00 (14 years ago)
Author:
gm
Message:

ticket:#665 step 2 & 3: heat content in qns & new forcing terms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/TRA/trasbc.F90

    r1858 r1859  
    11MODULE trasbc 
    2    !!============================================================================== 
     2   !!====================================================================== 
    33   !!                       ***  MODULE  trasbc  *** 
    44   !! Ocean active 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 
     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-05  (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    910   !!---------------------------------------------------------------------- 
    1011 
     
    3132#  include "vectopt_loop_substitute.h90" 
    3233   !!---------------------------------------------------------------------- 
    33    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     34   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    3435   !! $Id$ 
    3536   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    5253      !!         at the surface by evaporation, precipitations and runoff (E-P-R);  
    5354      !!      (3) Fwe, tracer carried with the water that is exchanged.  
     55      !!            - salinity    : salt flux only due to freezing/melting 
     56      !!            sa = sa +  fsalt / rau0 / e3t  for k=1 
    5457      !! 
    5558      !!      Fext, flux through the air-sea interface for temperature and salt:  
     
    7679      !!            (Tp P - Te E) + SST (P-E) = 0 when Tp=Te=SST 
    7780      !!            - salinity    : evaporation, precipitation and runoff 
    78       !!         water has a zero salinity (Fwe=0), thus only Fwi remains: 
    79       !!            sa = sa + emp * sn / e3t   for k=1 
     81      !!         water has a zero salinity  but there is a salt flux due to  
     82      !!         freezing/melting, thus: 
     83      !!            sa = sa + emp * sn / rau0 / e3t   for k=1 
     84      !!                    + fsalt    / rau0 / e3t 
    8085      !!         where emp, the surface freshwater budget (evaporation minus 
    8186      !!         precipitation minus runoff) given in kg/m2/s is divided 
    82       !!         by 1035 kg/m3 (density of ocena water) to obtain m/s.     
     87      !!         by rau0 = 1020 kg/m3 (density of sea water) to obtain m/s.     
    8388      !!         Note: even though Fwe does not appear explicitly for  
    8489      !!         temperature in this routine, the heat carried by the water 
     
    9297      !!         deal with it in this routine. 
    9398      !!           - temperature: Fwe=SST (P-E+R) is added to Fext. 
    94       !!           - salinity:  Fwe = 0, there is no surface flux of salt. 
     99      !!           - salinity:  Fwe sa = sa +  fsalt / rau0 / e3t. 
    95100      !! 
    96101      !! ** Action  : - Update the 1st level of (ta,sa) with the trend associated 
     
    103108      INTEGER, INTENT(in) ::   kt     ! ocean time-step index 
    104109      !! 
    105       INTEGER  ::   ji, jj                   ! dummy loop indices 
    106       REAL(wp) ::   zta, zsa, zsrau, zse3t   ! temporary scalars 
     110      INTEGER  ::   ji, jj        ! dummy loop indices 
     111      REAL(wp) ::   z1_e3t_rau0   ! local scalars 
    107112      !!---------------------------------------------------------------------- 
    108113 
     
    113118      ENDIF 
    114119 
    115       zsrau = 1. / rau0             ! initialization 
    116 #if defined key_zco 
    117       zse3t = 1. / e3t_0(1) 
    118 #endif 
    119  
    120120      IF( l_trdtra ) THEN           ! Save ta and sa trends 
    121121         ztrdt(:,:,:) = ta(:,:,:)  
     
    123123      ENDIF 
    124124 
     125!!gm useless staff ??? 
    125126      IF( .NOT.ln_traqsr )   qsr(:,:) = 0.e0   ! no solar radiation penetration 
     127!!gm 
    126128 
    127       ! Concentration dillution effect on (t,s) 
    128       DO jj = 2, jpj 
    129          DO ji = fs_2, fs_jpim1   ! vector opt. 
    130 #if ! defined key_zco 
    131             zse3t = 1. / fse3t(ji,jj,1) 
    132 #endif 
    133             IF( lk_vvl) THEN 
    134                zta = r1_rau0_rcp * qns(ji,jj) * zse3t &              ! temperature : heat flux 
    135                 &    - emp(ji,jj) * zsrau * tn(ji,jj,1)  * zse3t     ! & cooling/heating effet of EMP flux 
    136                zsa = 0.e0                                            ! No salinity concent./dilut. effect 
    137             ELSE 
    138                zta = r1_rau0_rcp * qns(ji,jj) * zse3t                ! temperature : heat flux 
    139                zsa = emps(ji,jj) * zsrau * sn(ji,jj,1)   * zse3t     ! salinity :  concent./dilut. effect 
    140             ENDIF 
    141             ta(ji,jj,1) = ta(ji,jj,1) + zta                          ! add the trend to the general tracer trend 
    142             sa(ji,jj,1) = sa(ji,jj,1) + zsa 
     129       
     130      IF( lk_vvl ) THEN          ! Variable Volume Layers case   ===>> heat content of mass flux in qns 
     131         DO jj = 2, jpj 
     132            DO ji = fs_2, fs_jpim1   ! vector opt. 
     133               z1_e3t_rau0 = 1./ ( fse3t(ji,jj,1) * rau0 ) 
     134               ta(ji,jj,1) = ta(ji,jj,1) + z1_e3t_rau0 * qns (ji,jj)  * r1_rcp             ! non solar heat flux 
     135               sa(ji,jj,1) = sa(ji,jj,1) + z1_e3t_rau0 * emps(ji,jj)                       ! salt flux (freezing/melting) 
     136            END DO 
    143137         END DO 
    144       END DO 
     138         ! 
     139      ELSE                       ! Constant Volume layers case   ===>> Concentration dillution effect 
     140         DO jj = 2, jpj 
     141            DO ji = fs_2, fs_jpim1   ! vector opt. 
     142               z1_e3t_rau0 = 1./ ( fse3t(ji,jj,1) * rau0 ) 
     143               ta(ji,jj,1) = ta(ji,jj,1) + z1_e3t_rau0 * (  qns (ji,jj) * r1_rcp       &   ! non solar heat flux 
     144                  &                                       + emp (ji,jj) * tn(ji,jj,1)  )   ! concent./dilut. effect 
     145               sa(ji,jj,1) = sa(ji,jj,1) + z1_e3t_rau0 * (  emps(ji,jj)                &   ! salt flux (freezing/melting) 
     146                  &                                       + emp (ji,jj) * sn(ji,jj,1)  )   ! concent./dilut. effect 
     147            END DO 
     148         END DO 
     149      ENDIF 
    145150 
    146151      IF( l_trdtra ) THEN      ! save the sbc trends for diagnostic 
Note: See TracChangeset for help on using the changeset viewer.