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/SBC – 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

Location:
branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcana.F90

    r1732 r1859  
    66   !! History :  3.0   ! 2006-06  (G. Madec)  Original code 
    77   !!            3.2   ! 2009-07  (G. Madec)  Style only 
     8   !!            3.3  !  2010-07  (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    89   !!---------------------------------------------------------------------- 
    910 
     
    3940#  include "vectopt_loop_substitute.h90" 
    4041   !!---------------------------------------------------------------------- 
    41    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     42   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    4243   !! $Id$ 
    4344   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    6061      !! 
    6162      !! ** Action  : - set the ocean surface boundary condition, i.e.   
    62       !!                   utau, vtau, taum, wndm, qns, qsr, emp, emps 
     63      !!                   utau, vtau, taum, wndm, qns, qsr, emp 
    6364      !!---------------------------------------------------------------------- 
    6465      INTEGER, INTENT(in) ::   kt       ! ocean time step 
     
    8889         ! 
    8990         nn_tau000 = MAX( nn_tau000, 1 )   ! must be >= 1 
    90          qns   (:,:) = rn_qns0 
    91          qsr   (:,:) = rn_qsr0 
    92          emp   (:,:) = rn_emp0 
    93          emps  (:,:) = rn_emp0 
     91         emp(:,:) = rn_emp0 
     92         qns(:,:) = rn_qns0 - emp(:,:) * sst_m(:,:) * rcp      ! including heat content associated with mass flux at SST 
     93         qsr(:,:) = rn_qsr0 
    9494         ! 
    9595      ENDIF 
     
    123123      !! 
    124124      !! ** Action  : - set the ocean surface boundary condition, i.e.    
    125       !!                   utau, vtau, taum, wndm, qns, qsr, emp, emps 
     125      !!                   utau, vtau, taum, wndm, qns, qsr, emp 
    126126      !! 
    127127      !! Reference : Hazeleger, W., and S. Drijfhout, JPO, 30, 677-695, 2000. 
     
    204204         END DO 
    205205      END DO 
    206       emps(:,:) = emp(:,:) 
    207206 
    208207      ! Compute the emp flux such as its integration on the whole domain at each time is zero 
     
    226225      ENDIF 
    227226 
    228       !salinity terms 
    229       emp (:,:) = emp(:,:) - zsumemp * tmask(:,:,1) 
    230       emps(:,:) = emp(:,:) 
     227       
     228      ! freshwater (mass flux) and update of qns with heat content of emp 
     229      emp (:,:) = emp(:,:) - zsumemp * tmask(:,:,1)        ! freshwater flux (=0 in domain average) 
     230      qns (:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp   ! evap and precip are at SST 
    231231 
    232232 
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcblk_clio.F90

    r1732 r1859  
    99   !!            3.0  !  2008-03 (C. Talandier, G. Madec) surface module + LIM3 
    1010   !!            3.2  !  2009-04 (B. Lemaire) Introduce iom_put 
     11   !!            3.3  !  2010-05 (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    1112   !!---------------------------------------------------------------------- 
    1213 
    1314   !!---------------------------------------------------------------------- 
    14    !!   sbc_blk_clio   : CLIO bulk formulation: read and update required input fields 
    15    !!   blk_clio_oce   : ocean CLIO bulk formulea: compute momentum, heat and freswater fluxes for the ocean 
    16    !!   blk_ice_clio   : ice   CLIO bulk formulea: compute momentum, heat and freswater fluxes for the sea-ice 
     15   !!   sbc_blk_clio     : CLIO bulk formulation: read and update required input fields 
     16   !!   blk_clio_oce     : ocean CLIO bulk formulea: compute momentum, heat and freswater fluxes for the ocean 
     17   !!   blk_ice_clio     : ice   CLIO bulk formulea: compute momentum, heat and freswater fluxes for the sea-ice 
    1718   !!   blk_clio_qsr_oce : shortwave radiation for ocean computed from the cloud cover 
    1819   !!   blk_clio_qsr_ice : shortwave radiation for ice   computed from the cloud cover 
    19    !!   flx_blk_declin : solar declinaison 
     20   !!   flx_blk_declin   : solar declinaison 
    2021   !!---------------------------------------------------------------------- 
    2122   USE oce             ! ocean dynamics and tracers 
     
    4748   INTEGER , PARAMETER ::   jp_vtau = 2           ! index of wind stress (j-component)      (N/m2)    at V-point 
    4849   INTEGER , PARAMETER ::   jp_wndm = 3           ! index of 10m wind module                 (m/s)    at T-point 
    49    INTEGER , PARAMETER ::   jp_humi = 4           ! index of specific humidity               ( - ) 
    50    INTEGER , PARAMETER ::   jp_ccov = 5           ! index of cloud cover                     ( - ) 
     50   INTEGER , PARAMETER ::   jp_humi = 4           ! index of specific humidity               ( % ) 
     51   INTEGER , PARAMETER ::   jp_ccov = 5           ! index of cloud cover                     ( % ) 
    5152   INTEGER , PARAMETER ::   jp_tair = 6           ! index of 10m air temperature             (Kelvin) 
    5253   INTEGER , PARAMETER ::   jp_prec = 7           ! index of total precipitation (rain+snow) (Kg/m2/s) 
     
    8182#  include "vectopt_loop_substitute.h90" 
    8283   !!---------------------------------------------------------------------- 
    83    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     84   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    8485   !! $Id$  
    8586   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    9899      !!      the i-component of the stress                (N/m2) 
    99100      !!      the j-component of the stress                (N/m2) 
    100       !!      the 10m wind pseed module                    (m/s) 
     101      !!      the 10m wind speed module                    (m/s) 
    101102      !!      the 10m air temperature                      (Kelvin) 
    102       !!      the 10m specific humidity                    (-) 
    103       !!      the cloud cover                              (-) 
     103      !!      the 10m specific humidity                    (%) 
     104      !!      the cloud cover                              (%) 
    104105      !!      the total precipitation (rain+snow)          (Kg/m2/s) 
    105106      !!              (2) CALL blk_oce_clio 
    106107      !! 
    107108      !!      C A U T I O N : never mask the surface stress fields 
    108       !!                      the stress is assumed to be in the mesh referential 
    109       !!                      i.e. the (i,j) referential 
     109      !!                      the stress is assumed to be in the (i,j) mesh referential 
    110110      !! 
    111111      !! ** Action  :   defined at each time-step at the air-sea interface 
     
    113113      !!              - taum        wind stress module at T-point 
    114114      !!              - wndm        10m wind module at T-point 
    115       !!              - qns, qsr    non-slor and solar heat flux 
    116       !!              - emp, emps   evaporation minus precipitation 
     115      !!              - qns         non-solar heat flux including latent heat of solid  
     116      !!                            precip. melting and emp heat content 
     117      !!              - qsr         solar heat flux 
     118      !!              - emp         upward mass flux (evap. - precip) 
    117119      !!---------------------------------------------------------------------- 
    118120      INTEGER, INTENT( in  ) ::   kt   ! ocean time step 
     
    175177      !                                         ! ====================== ! 
    176178      ! 
    177       CALL fld_read( kt, nn_fsbc, sf )                ! input fields provided at the current time-step 
     179      CALL fld_read( kt, nn_fsbc, sf )                                        ! input fields at the current time-step 
    178180      ! 
    179181#if defined key_lim3       
    180       tatm_ice(:,:) = sf(jp_tair)%fnow(:,:)     !RB ugly patch 
     182      tatm_ice(:,:) = sf(jp_tair)%fnow(:,:)                                   ! Tair needed in LIM-3 (!RB ugly patch) 
    181183#endif 
    182       ! 
     184      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_clio( sf, sst_m )      ! surface ocean fluxes using CLIO bulk formulea 
     185      ENDIF                                               !  
     186       
    183187      IF(lwp .AND. nitend-nit000 <= 100 ) THEN 
    184188         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 
     
    210214         ENDIF 
    211215      ENDIF 
    212  
    213       IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN 
    214           CALL blk_oce_clio( sf, sst_m )                  ! compute the surface ocean fluxes using CLIO bulk formulea 
    215       ENDIF                                               !  
    216216      ! 
    217217   END SUBROUTINE sbc_blk_clio 
     
    239239      !!               - taum        wind stress module at T-point 
    240240      !!               - wndm        10m wind module at T-point 
    241       !!               - qns, qsr    non-slor and solar heat flux 
    242       !!               - emp, emps   evaporation minus precipitation 
     241      !!               - qns         non-solar heat flux including latent heat of solid  
     242      !!                             precip. melting and emp heat content 
     243      !!               - qsr         solar heat flux 
     244      !!               - emp         suface mass flux (evap.-precip.) 
    243245      !!  ** Nota    :   sf has to be a dummy argument for AGRIF on NEC 
    244246      !!---------------------------------------------------------------------- 
     
    257259      REAL(wp) ::   zsst, ztatm, zcco1, zpatm, zcmax, zrmax     !    -         - 
    258260      REAL(wp) ::   zrhoa, zev, zes, zeso, zqatm, zevsqr        !    -         - 
    259       REAL(wp) ::   ztx2, zty2                                  !    -         - 
     261      REAL(wp) ::   ztx2, zty2, zcevap, zcprec                  !    -         - 
    260262      !! 
    261263      REAL(wp), DIMENSION(jpi,jpj) ::   zqlw        ! long-wave heat flux over ocean 
     
    270272      !------------------------------------! 
    271273!CDIR COLLAPSE 
    272       DO jj = 1 , jpj 
    273          DO ji = 1, jpi 
    274             utau(ji,jj) = sf(jp_utau)%fnow(ji,jj) 
    275             vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj) 
    276          END DO 
    277       END DO 
     274      utau(:,:) = sf(jp_utau)%fnow(:,:) 
     275!CDIR COLLAPSE 
     276      vtau(:,:) = sf(jp_vtau)%fnow(:,:) 
     277 
     278      !------------------------------------! 
     279      !   store the wind speed  (wndm )    ! 
     280      !------------------------------------! 
     281!CDIR COLLAPSE 
     282      wndm(:,:) = sf(jp_wndm)%fnow(:,:) 
    278283 
    279284      !------------------------------------! 
     
    291296      CALL lbc_lnk( taum, 'T', 1. ) 
    292297 
    293       !------------------------------------! 
    294       !   store the wind speed  (wndm )    ! 
    295       !------------------------------------! 
    296 !CDIR COLLAPSE 
    297       DO jj = 1 , jpj 
    298          DO ji = 1, jpi 
    299             wndm(ji,jj) = sf(jp_wndm)%fnow(ji,jj) 
    300          END DO 
    301       END DO 
    302  
    303298      !------------------------------------------------! 
    304299      !   Shortwave radiation for ocean and snow/ice   ! 
    305300      !------------------------------------------------! 
    306        
    307301      CALL blk_clio_qsr_oce( qsr ) 
    308302 
     
    401395      !     III    Total FLUXES                                                       ! 
    402396      ! ----------------------------------------------------------------------------- ! 
    403  
    404 !CDIR COLLAPSE 
    405 !CDIR NOVERRCHK 
    406       DO jj = 1, jpj 
    407 !CDIR NOVERRCHK 
    408          DO ji = 1, jpi 
    409             qns (ji,jj) = zqlw(ji,jj) - zqsb(ji,jj) - zqla(ji,jj)      ! Downward Non Solar flux 
    410             emp (ji,jj) = zqla(ji,jj) / cevap - sf(jp_prec)%fnow(ji,jj) / rday * tmask(ji,jj,1) 
    411          END DO 
    412       END DO 
    413       emps(:,:) = emp(:,:) 
    414       ! 
     397      zcevap = rcp /  cevap    ! convert zqla ==> evap (Kg/m2/s) ==> m/s ==> W/m2 
     398      zcprec = rcp /  rday     ! convert prec ( mm/day ==> m/s)  ==> W/m2 
     399 
     400!CDIR COLLAPSE 
     401      emp(:,:) = zqla(:,:) / cevap                                        &   ! freshwater flux 
     402         &     - sf(jp_prec)%fnow(:,:) / rday * tmask(:,:,1) 
     403      ! 
     404!CDIR COLLAPSE 
     405      qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                        &   ! Downward Non Solar flux 
     406         &     - zqla(:,:)             * pst(:,:)              * zcevap   &   ! remove evap.   heat content at SST in Celcius 
     407         &     + sf(jp_prec)%fnow(:,:) * sf(jp_tair)%fnow(:,:) * zcprec       ! add    precip. heat content at Tair in Celcius 
     408      ! NB: if sea-ice model, the snow precip are computed and the associated heat is added to qns (see blk_ice_clio) 
     409 
    415410      CALL iom_put( "qlw_oce",   zqlw )   ! output downward longwave  heat over the ocean 
    416411      CALL iom_put( "qsb_oce", - zqsb )   ! output downward sensible  heat over the ocean 
     
    425420            &         tab2d_2=vtau , clinfo2=' vtau : ', mask2=vmask ) 
    426421      ENDIF 
    427  
     422      ! 
    428423   END SUBROUTINE blk_oce_clio 
    429424 
     
    447442      !! 
    448443      !!  ** Action  :   call albedo_oce/albedo_ice to compute ocean/ice albedo  
    449       !!          computation of snow precipitation 
    450       !!          computation of solar flux at the ocean and ice surfaces 
    451       !!          computation of the long-wave radiation for the ocean and sea/ice 
    452       !!          computation of turbulent heat fluxes over water and ice 
    453       !!          computation of evaporation over water 
    454       !!          computation of total heat fluxes sensitivity over ice (dQ/dT) 
    455       !!          computation of latent heat flux sensitivity over ice (dQla/dT) 
    456       !! 
     444      !!               - snow precipitation 
     445      !!               - solar flux at the ocean and ice surfaces 
     446      !!               - the long-wave radiation for the ocean and sea/ice 
     447      !!               - turbulent heat fluxes over water and ice 
     448      !!               - evaporation over water 
     449      !!               - total heat fluxes sensitivity over ice (dQ/dT) 
     450      !!               - latent heat flux sensitivity over ice (dQla/dT) 
     451      !!               - qns  :  modified the non solar heat flux over the ocean 
     452      !!                         to take into account solid precip latent heat flux 
    457453      !!---------------------------------------------------------------------- 
    458454      REAL(wp), INTENT(in   ), DIMENSION(:,:,:)   ::   pst      ! ice surface temperature                   [Kelvin] 
     
    633629      ! 
    634630      ! ----------------------------------------------------------------------------- ! 
    635       !    Total FLUXES                                                       ! 
     631      !    Total FLUXES                                                               ! 
    636632      ! ----------------------------------------------------------------------------- ! 
    637633      ! 
    638634!CDIR COLLAPSE 
    639       p_qns(:,:,:) = z_qlw (:,:,:) - z_qsb (:,:,:) - p_qla (:,:,:)      ! Downward Non Solar flux 
     635      p_qns(:,:,:) = z_qlw(:,:,:) - z_qsb(:,:,:) - p_qla(:,:,:)         ! Downward Non Solar flux 
    640636!CDIR COLLAPSE 
    641637      p_tpr(:,:)   = sf(jp_prec)%fnow(:,:) / rday                       ! total precipitation [kg/m2/s] 
     638      ! 
     639      ! ----------------------------------------------------------------------------- ! 
     640      !    Correct the OCEAN non solar flux with the existence of solid precipitation ! 
     641      ! ---------------=====--------------------------------------------------------- ! 
     642!CDIR COLLAPSE 
     643      qns(:,:) = qns(:,:)                                           &   ! update the non-solar heat flux with: 
     644         &     - p_spr(:,:) * lfus                                                  &   ! remove melting solid precip 
     645         &     + p_spr(:,:) * MIN( sf(jp_tair)%fnow(:,:), rt0_snow - rt0 ) * cpic   &   ! add solid P at least below melting 
     646         &     - p_spr(:,:) * sf(jp_tair)%fnow(:,:)                        * rcp        ! remove solid precip. at Tair 
    642647      ! 
    643648!!gm : not necessary as all input data are lbc_lnk... 
     
    667672         CALL prt_ctl(tab2d_1=p_taui , clinfo1=' blk_ice_clio: p_taui : ', tab2d_2=p_tauj , clinfo2=' p_tauj : ') 
    668673      ENDIF 
    669  
    670  
     674      ! 
    671675   END SUBROUTINE blk_ice_clio 
    672676 
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcblk_core.F90

    r1730 r1859  
    1212   !!            3.0  !  2006-06  (G. Madec) sbc rewritting    
    1313   !!            3.2  !  2009-04  (B. Lemaire)  Introduce iom_put 
     14   !!            3.3  !  2010-05  (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    1415   !!---------------------------------------------------------------------- 
    1516 
     
    4546   INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point 
    4647   INTEGER , PARAMETER ::   jp_wndj = 2           ! index of 10m wind velocity (j-component) (m/s)    at T-point 
    47    INTEGER , PARAMETER ::   jp_humi = 3           ! index of specific humidity               ( - ) 
     48   INTEGER , PARAMETER ::   jp_humi = 3           ! index of specific humidity               ( % ) 
    4849   INTEGER , PARAMETER ::   jp_qsr  = 4           ! index of solar heat                      (W/m2) 
    4950   INTEGER , PARAMETER ::   jp_qlw  = 5           ! index of Long wave                       (W/m2) 
     
    6263   REAL(wp), PARAMETER ::   Cice =    1.63e-3     ! transfer coefficient over ice 
    6364 
    64    !                                !!* Namelist namsbc_core : CORE bulk parameters 
    65    LOGICAL  ::   ln_2m     = .FALSE.     ! logical flag for height of air temp. and hum 
    66    LOGICAL  ::   ln_taudif = .FALSE.     ! logical flag to use the "mean of stress module - module of mean stress" data 
    67    REAL(wp) ::   rn_pfac   = 1.          ! multiplication factor for precipitation 
     65   !                                    !!* Namelist namsbc_core : CORE bulk parameters 
     66   LOGICAL  ::   ln_2m     = .FALSE.     ! air temperature and humidity given at 2m (T) or 10m (F) 
     67   LOGICAL  ::   ln_taudif = .FALSE.     ! (T) use the "mean of stress module - module of mean stress" data or (F) not 
     68   REAL(wp) ::   rn_pfac   = 1.          ! multiplicative factor for precipitation 
    6869 
    6970   !! * Substitutions 
     
    7172#  include "vectopt_loop_substitute.h90" 
    7273   !!---------------------------------------------------------------------- 
    73    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     74   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    7475   !! $Id$ 
    7576   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    8889      !!      the 10m wind velocity (i-component) (m/s)    at T-point 
    8990      !!      the 10m wind velocity (j-component) (m/s)    at T-point 
    90       !!      the specific humidity               ( - ) 
     91      !!      the 10m or 2m specific humidity     ( % ) 
    9192      !!      the solar heat                      (W/m2) 
    9293      !!      the Long wave                       (W/m2) 
    93       !!      the 10m air temperature             (Kelvin) 
     94      !!      the 10m or 2m air temperature       (Kelvin) 
    9495      !!      the total precipitation (rain+snow) (Kg/m2/s) 
    9596      !!      the snow (solid prcipitation)       (kg/m2/s) 
    96       !!   OPTIONAL parameter (see ln_taudif namelist flag): 
    97       !!      the tau diff associated to HF tau   (N/m2)   at T-point  
     97      !!      the tau diff associated to HF tau   (N/m2)   at T-point   (ln_taudif=T) 
    9898      !!              (2) CALL blk_oce_core 
    9999      !! 
    100100      !!      C A U T I O N : never mask the surface stress fields 
    101       !!                      the stress is assumed to be in the mesh referential 
    102       !!                      i.e. the (i,j) referential 
     101      !!                      the stress is assumed to be in the (i,j) mesh referential 
    103102      !! 
    104103      !! ** Action  :   defined at each time-step at the air-sea interface 
    105104      !!              - utau, vtau  i- and j-component of the wind stress 
    106       !!              - taum        wind stress module at T-point 
    107       !!              - wndm        10m wind module at T-point 
    108       !!              - qns, qsr    non-slor and solar heat flux 
    109       !!              - emp, emps   evaporation minus precipitation 
     105      !!              - taum, wndm  wind stress and 10m wind modules at T-point 
     106      !!              - qns, qsr    non-solar and solar heat flux 
     107      !!              - emp         upward mass flux (evapo. - precip.) 
    110108      !!---------------------------------------------------------------------- 
    111109      INTEGER, INTENT( in  ) ::   kt   ! ocean time step 
    112110      !! 
     111      INTEGER  ::   jf       ! dummy loop indice 
     112      INTEGER  ::   ifld     ! number of files to be read 
    113113      INTEGER  ::   ierror   ! return error code 
    114       INTEGER  ::   ifpr     ! dummy loop indice 
    115       INTEGER  ::   jfld     ! dummy loop arguments 
    116114      !! 
    117115      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files 
    118116      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i     ! array of namelist informations on the fields to read 
    119       TYPE(FLD_N) ::   sn_wndi, sn_wndj, sn_humi, sn_qsr       ! informations about the fields to be read 
    120       TYPE(FLD_N) ::   sn_qlw , sn_tair, sn_prec, sn_snow      !   "                                 " 
    121       TYPE(FLD_N) ::   sn_tdif                                 !   "                                 " 
     117      TYPE(FLD_N) ::   sn_wndi, sn_wndj, sn_humi, sn_qsr             ! informations about the fields to be read 
     118      TYPE(FLD_N) ::   sn_qlw , sn_tair, sn_prec, sn_snow, sn_tdif   !       -                       - 
    122119      NAMELIST/namsbc_core/ cn_dir , ln_2m  , ln_taudif, rn_pfac,           & 
    123120         &                  sn_wndi, sn_wndj, sn_humi  , sn_qsr ,           & 
     
    156153         ! do we use HF tau information? 
    157154         lhftau = ln_taudif 
    158          jfld = jpfld - COUNT( (/.NOT. lhftau/) ) 
     155         ifld = jpfld - COUNT( (/.NOT. lhftau/) ) 
    159156         ! 
    160157         ! set sf structure 
    161          ALLOCATE( sf(jfld), STAT=ierror ) 
     158         ALLOCATE( sf(ifld), STAT=ierror ) 
    162159         IF( ierror > 0 ) THEN 
    163160            CALL ctl_stop( 'sbc_blk_core: unable to allocate sf structure' )   ;   RETURN 
    164161         ENDIF 
    165          DO ifpr= 1, jfld 
    166             ALLOCATE( sf(ifpr)%fnow(jpi,jpj) ) 
    167             ALLOCATE( sf(ifpr)%fdta(jpi,jpj,2) ) 
     162         DO jf = 1, ifld 
     163            ALLOCATE( sf(jf)%fnow(jpi,jpj) ) 
     164            ALLOCATE( sf(jf)%fdta(jpi,jpj,2) ) 
    168165         END DO 
    169166         ! 
     
    173170      ENDIF 
    174171 
     172!!gm    all the below lines should be executed only at nn_fbc frequency, no???   check fldread capability 
     173 
    175174      CALL fld_read( kt, nn_fsbc, sf )                   ! input fields provided at the current time-step 
    176  
     175      ! 
    177176#if defined key_lim3 
    178       tatm_ice(:,:) = sf(jp_tair)%fnow(:,:) 
     177      tatm_ice(:,:) = sf(jp_tair)%fnow(:,:)              ! air temperature over ice (LIM3 only) 
    179178#endif 
    180  
    181       IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN 
    182           CALL blk_oce_core( sf, sst_m, ssu_m, ssv_m )   ! compute the surface ocean fluxes using CLIO bulk formulea 
    183       ENDIF 
    184       !                                                  ! using CORE bulk formulea 
     179      !                                                  ! surface ocean fluxes using CORE bulk formulea 
     180      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_core( sf, sst_m, ssu_m, ssv_m ) 
     181      ! 
    185182   END SUBROUTINE sbc_blk_core 
    186183    
     
    196193      !!      fields read in sbc_read 
    197194      !!  
    198       !! ** Outputs : - utau    : i-component of the stress at U-point  (N/m2) 
    199       !!              - vtau    : j-component of the stress at V-point  (N/m2) 
    200       !!              - taum    : Wind stress module at T-point         (N/m2) 
    201       !!              - wndm    : Wind speed module at T-point          (m/s) 
    202       !!              - qsr     : Solar heat flux over the ocean        (W/m2) 
    203       !!              - qns     : Non Solar heat flux over the ocean    (W/m2) 
    204       !!              - evap    : Evaporation over the ocean            (kg/m2/s) 
    205       !!              - emp(s)  : evaporation minus precipitation       (kg/m2/s) 
     195      !! ** Action  : - utau  : i-component of the stress at U-point  (N/m2) 
     196      !!              - vtau  : j-component of the stress at V-point  (N/m2) 
     197      !!              - taum  : Wind stress module at T-point         (N/m2) 
     198      !!              - wndm  : 10m Wind speed module at T-point      (m/s) 
     199      !!              - qsr   : Solar heat flux over the ocean        (W/m2) 
     200      !!              - qns   : Non Solar heat flux over the ocean    (W/m2) 
     201      !!                        including the latent heat of solid  
     202      !!                        precip. melting and emp heat content 
     203      !!              - emp   : upward mass flux (evap. - precip.)    (kg/m2/s) 
    206204      !! 
    207205      !!  ** Nota  :   sf has to be a dummy argument for AGRIF on NEC 
    208206      !!--------------------------------------------------------------------- 
    209       TYPE(fld), INTENT(in), DIMENSION(:)       ::   sf    ! input data 
    210       REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pst   ! surface temperature                      [Celcius] 
    211       REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pu    ! surface current at U-point (i-component) [m/s] 
    212       REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pv    ! surface current at V-point (j-component) [m/s] 
    213  
     207      TYPE(fld), INTENT(in), DIMENSION(:)       ::   sf    ! input data (forcing field structure) 
     208      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pst   ! surface temperature                      [Celcius] 
     209      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pu    ! surface current at U-point (i-component) [m/s] 
     210      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pv    ! surface current at V-point (j-component) [m/s] 
     211      !! 
    214212      INTEGER  ::   ji, jj     ! dummy loop indices 
    215       REAL(wp) ::   zcoef_qsatw 
    216       REAL(wp) ::   zztmp                                 ! temporary variable 
     213      REAL(wp) ::   zcoef_qsatw, zztmp                    ! temporary scalar 
    217214      REAL(wp), DIMENSION(jpi,jpj) ::   zwnd_i, zwnd_j    ! wind speed components at T-point 
    218215      REAL(wp), DIMENSION(jpi,jpj) ::   zqsatw            ! specific humidity at pst 
     
    230227      zcoef_qsatw = 0.98 * 640380. / rhoa 
    231228       
    232       zst(:,:) = pst(:,:) + rt0      ! converte Celcius to Kelvin (and set minimum value far above 0 K) 
     229      zst(:,:) = pst(:,:) + rt0      ! converte SST from Celcius to Kelvin (and set minimum value far above 0 K) 
    233230 
    234231      ! ----------------------------------------------------------------------------- ! 
     
    262259      ! ocean albedo assumed to be 0.066 
    263260!CDIR COLLAPSE 
    264       qsr (:,:) = ( 1. - 0.066 ) * sf(jp_qsr)%fnow(:,:) * tmask(:,:,1)                                 ! Short Wave 
     261      qsr (:,:) = ( 1. - 0.066 ) * sf(jp_qsr)%fnow(:,:) * tmask(:,:,1)                                     ! Short Wave 
    265262!CDIR COLLAPSE 
    266263      zqlw(:,:) = (  sf(jp_qlw)%fnow(:,:) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave 
     
    353350      
    354351!CDIR COLLAPSE 
    355       qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)      ! Downward Non Solar flux 
    356 !CDIR COLLAPSE 
    357       emp (:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * rn_pfac * tmask(:,:,1) 
    358 !CDIR COLLAPSE 
    359       emps(:,:) = emp(:,:) 
     352      emp (:,:) = (  zevap(:,:)                                          &   ! mass flux (evap. - precip.) 
     353         &         - sf(jp_prec)%fnow(:,:) * rn_pfac  ) * tmask(:,:,1) 
     354!CDIR COLLAPSE 
     355      qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)                       &   ! Downward Non Solar flux 
     356         &     - sf(jp_snow)%fnow(:,:) * lfus                            &   ! remove latent melting heat for solid precip 
     357         &     - zevap(:,:) * pst(ji,jj) * rcp                           &   ! remove evap heat content at SST 
     358         &     + ( sf(jp_prec)%fnow(:,:) - sf(jp_snow)%fnow(:,:) )       &   ! add liquid precip heat content at Tair 
     359         &     * ( sf(jp_tair)%fnow(:,:) - rt0 ) * rcp                   &    
     360         &     + sf(jp_snow)%fnow(:,:)                                   &   ! add solid  precip heat content at min(Tair,Tsnow) 
     361         &     * ( MIN( sf(jp_tair)%fnow(:,:), rt0_snow ) - rt0 ) * cpic  
    360362      ! 
    361363      CALL iom_put( "qlw_oce",   zqlw )                 ! output downward longwave heat over the ocean 
     
    392394      !! caution : the net upward water flux has with mm/day unit 
    393395      !!--------------------------------------------------------------------- 
    394       REAL(wp), INTENT(in   ), DIMENSION(:,:,:)      ::   pst      ! ice surface temperature (>0, =rt0 over land) [Kelvin] 
    395       REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj)    ::   pui      ! ice surface velocity (i- and i- components      [m/s] 
    396       REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj)    ::   pvi      !    at I-point (B-grid) or U & V-point (C-grid) 
    397       REAL(wp), INTENT(in   ), DIMENSION(:,:,:)      ::   palb     ! ice albedo (clear sky) (alb_ice_cs)               [%] 
    398       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj)    ::   p_taui   ! i- & j-components of surface ice stress        [N/m2] 
    399       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj)    ::   p_tauj   !   at I-point (B-grid) or U & V-point (C-grid) 
    400       REAL(wp), INTENT(  out), DIMENSION(:,:,:)      ::   p_qns    ! non solar heat flux over ice (T-point)         [W/m2] 
    401       REAL(wp), INTENT(  out), DIMENSION(:,:,:)      ::   p_qsr    !     solar heat flux over ice (T-point)         [W/m2] 
    402       REAL(wp), INTENT(  out), DIMENSION(:,:,:)      ::   p_qla    ! latent    heat flux over ice (T-point)         [W/m2] 
    403       REAL(wp), INTENT(  out), DIMENSION(:,:,:)      ::   p_dqns   ! non solar heat sensistivity  (T-point)         [W/m2] 
    404       REAL(wp), INTENT(  out), DIMENSION(:,:,:)      ::   p_dqla   ! latent    heat sensistivity  (T-point)         [W/m2] 
    405       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj)    ::   p_tpr    ! total precipitation          (T-point)      [Kg/m2/s] 
    406       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj)    ::   p_spr    ! solid precipitation          (T-point)      [Kg/m2/s] 
    407       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj)    ::   p_fr1    ! 1sr fraction of qsr penetration in ice (T-point)  [%] 
    408       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj)    ::   p_fr2    ! 2nd fraction of qsr penetration in ice (T-point)  [%] 
    409       CHARACTER(len=1), INTENT(in   )                ::   cd_grid  ! ice grid ( C or B-grid) 
    410       INTEGER, INTENT(in   )                         ::   pdim     ! number of ice categories 
     396      REAL(wp), INTENT(in   ), DIMENSION(:,:,:)   ::   pst      ! ice surface temperature (>0, =rt0 over land) [Kelvin] 
     397      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pui      ! ice surface velocity (i- and i- components      [m/s] 
     398      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pvi      !    at I-point (B-grid) or U & V-point (C-grid) 
     399      REAL(wp), INTENT(in   ), DIMENSION(:,:,:)   ::   palb     ! ice albedo (clear sky) (alb_ice_cs)               [%] 
     400      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_taui   ! i- & j-components of surface ice stress        [N/m2] 
     401      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_tauj   !   at I-point (B-grid) or U & V-point (C-grid) 
     402      REAL(wp), INTENT(  out), DIMENSION(:,:,:)   ::   p_qns    ! non solar heat flux over ice (T-point)         [W/m2] 
     403      REAL(wp), INTENT(  out), DIMENSION(:,:,:)   ::   p_qsr    !     solar heat flux over ice (T-point)         [W/m2] 
     404      REAL(wp), INTENT(  out), DIMENSION(:,:,:)   ::   p_qla    ! latent    heat flux over ice (T-point)         [W/m2] 
     405      REAL(wp), INTENT(  out), DIMENSION(:,:,:)   ::   p_dqns   ! non solar heat sensistivity  (T-point)         [W/m2] 
     406      REAL(wp), INTENT(  out), DIMENSION(:,:,:)   ::   p_dqla   ! latent    heat sensistivity  (T-point)         [W/m2] 
     407      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_tpr    ! total precipitation          (T-point)      [Kg/m2/s] 
     408      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_spr    ! solid precipitation          (T-point)      [Kg/m2/s] 
     409      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_fr1    ! 1sr fraction of qsr penetration in ice (T-point)  [%] 
     410      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_fr2    ! 2nd fraction of qsr penetration in ice (T-point)  [%] 
     411      CHARACTER(len=1), INTENT(in   )             ::   cd_grid  ! ice grid ( C or B-grid) 
     412      INTEGER, INTENT(in   )                      ::   pdim     ! number of ice categories 
    411413      !! 
    412414      INTEGER  ::   ji, jj, jl    ! dummy loop indices 
    413415      INTEGER  ::   ijpl          ! number of ice categories (size of 3rd dim of input arrays) 
    414       REAL(wp) ::   zst2, zst3 
    415       REAL(wp) ::   zcoef_wnorm, zcoef_wnorm2, zcoef_dqlw, zcoef_dqla, zcoef_dqsb 
    416       REAL(wp) ::   zcoef_frca                                   ! fractional cloud amount 
    417       REAL(wp) ::   zwnorm_f, zwndi_f , zwndj_f                  ! relative wind module and components at F-point 
    418       REAL(wp) ::             zwndi_t , zwndj_t                  ! relative wind components at T-point 
    419       REAL(wp), DIMENSION(jpi,jpj) ::   z_wnds_t                 ! wind speed ( = | U10m - U_ice | ) at T-point 
    420       REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_qlw               ! long wave heat flux over ice 
    421       REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_qsb               ! sensible  heat flux over ice 
    422       REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_dqlw              ! long wave heat sensitivity over ice 
    423       REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_dqsb              ! sensible  heat sensitivity over ice 
     416      REAL(wp) ::   zst2, zcoef_wnorm , zcoef_dqlw              ! 
     417      REAL(wp) ::   zst3, zcoef_wnorm2, zcoef_dqla, zcoef_dqsb  ! 
     418      REAL(wp) ::   zcoef_frca                                  ! fractional cloud amount 
     419      REAL(wp) ::   zwnorm_f, zwndi_f , zwndj_f                 ! relative wind module and components at F-point 
     420      REAL(wp) ::             zwndi_t , zwndj_t                 ! relative wind components at T-point 
     421      REAL(wp), DIMENSION(jpi,jpj)      ::   z_wnds_t           ! wind speed ( = | U10m - U_ice | ) at T-point 
     422      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_qlw              ! long wave heat flux over ice 
     423      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_qsb              ! sensible  heat flux over ice 
     424      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_dqlw             ! long wave heat sensitivity over ice 
     425      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_dqsb             ! sensible  heat sensitivity over ice 
    424426      !!--------------------------------------------------------------------- 
    425427 
     
    576578         CALL prt_ctl(tab2d_1=z_wnds_t, clinfo1=' blk_ice_core: z_wnds_t : ') 
    577579      ENDIF 
    578  
     580      ! 
    579581   END SUBROUTINE blk_ice_core 
    580582   
    581583 
    582584   SUBROUTINE TURB_CORE_1Z(zu, sst, T_a, q_sat, q_a,   & 
    583       &                        dU, Cd, Ch, Ce   ) 
     585      &                        dU , Cd , Ch   , Ce   ) 
    584586      !!---------------------------------------------------------------------- 
    585587      !!                      ***  ROUTINE  turb_core  *** 
     
    704706 
    705707 
    706     SUBROUTINE TURB_CORE_2Z(zt, zu, sst, T_zt, q_sat, q_zt, dU, Cd, Ch, Ce, T_zu, q_zu) 
     708    SUBROUTINE TURB_CORE_2Z( zt  , zu, sst, T_zt, q_sat,   & 
     709      &                      q_zt, dU, Cd , Ch  , Ce   , T_zu, q_zu) 
    707710      !!---------------------------------------------------------------------- 
    708711      !!                      ***  ROUTINE  turb_core  *** 
     
    838841         Ce  = Ce_n10*sqrt_Cd/sqrt_Cd_n10/xct 
    839842         !! 
    840          !! 
    841843      END DO 
    842       !! 
     844      ! 
    843845    END SUBROUTINE TURB_CORE_2Z 
    844846 
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbccpl.F90

    r1833 r1859  
    44   !! Surface Boundary Condition :  momentum, heat and freshwater fluxes in coupled mode 
    55   !!====================================================================== 
    6    !! History :  2.0  !  06-2007  (R. Redler, N. Keenlyside, W. Park) Original code split into flxmod & taumod 
    7    !!            3.0  !  02-2008  (G. Madec, C Talandier)  surface module 
    8    !!            3.1  !  02-2009  (G. Madec, S. Masson, E. Maisonave, A. Caubel) generic coupled interface 
     6   !! History :  2.0  !  2007-06  (R. Redler, N. Keenlyside, W. Park) Original code split into flxmod & taumod 
     7   !!            3.0  !  2008-02  (G. Madec, C Talandier)  surface module 
     8   !!            3.1  !  2009-02  (G. Madec, S. Masson, E. Maisonave, A. Caubel) generic coupled interface 
     9   !!            3.3  !  2010-05  (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    910   !!---------------------------------------------------------------------- 
    1011#if defined key_oasis3 || defined key_oasis4 
     
    156157#  include "vectopt_loop_substitute.h90" 
    157158   !!---------------------------------------------------------------------- 
    158    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     159   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    159160   !! $Id$ 
    160161   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    562563      !! ** Action  :   update  utau, vtau   ocean stress at U,V grid  
    563564      !!                        taum, wndm   wind stres and wind speed module at T-point 
    564       !!                        qns , qsr    non solar and solar ocean heat fluxes   ('ocean only case) 
    565       !!                        emp = emps   evap. - precip. (- runoffs) (- calving) ('ocean only case) 
     565      !!                        qns          non solar heat fluxes including emp heat content    (ocean only case) 
     566      !!                                     and the latent heat flux of solid precip. melting 
     567      !!                        qsr          solar ocean heat fluxes   (ocean only case) 
     568      !!                        emp          upward mass flux [evap. - precip. (- runoffs) (- calving)] (ocean only case) 
    566569      !!---------------------------------------------------------------------- 
    567570      INTEGER, INTENT(in) ::   kt       ! ocean model time step index 
     
    697700      ENDIF 
    698701 
    699       ! u(v)tau and taum will be modified by ice model (wndm will be changed by PISCES) 
     702      ! u(v)tau and taum will be modified by ice model (and wndm will be changed by PISCES) 
    700703      ! -> need to be reset before each call of the ice/fsbc       
    701704      IF( MOD( kt-1, k_fsbc ) == 0 ) THEN 
     
    712715         !                                                   ! ========================= ! 
    713716         ! 
    714          !                                                       ! non solar heat flux over the ocean (qns) 
    715          IF( srcv(jpr_qnsoce)%laction )   qns(:,:) = frcv(:,:,jpr_qnsoce) 
    716          IF( srcv(jpr_qnsmix)%laction )   qns(:,:) = frcv(:,:,jpr_qnsmix)         
    717          !   energy for melting solid precipitation over free ocean 
    718          zcoef = xlsn / rhosn 
    719          qns(:,:) = qns(:,:) - frcv(:,:,jpr_snow) * zcoef 
    720          !                                                       ! solar flux over the ocean          (qsr) 
    721          IF( srcv(jpr_qsroce)%laction )   qsr(:,:) = frcv(:,:,jpr_qsroce)  
    722          IF( srcv(jpr_qsrmix)%laction )   qsr(:,:) = frcv(:,:,jpr_qsrmix) 
    723          ! 
    724          !                                                       ! total freshwater fluxes over the ocean (emp, emps) 
     717         !                                                       ! total freshwater fluxes over the ocean (emp) 
    725718         SELECT CASE( TRIM( cn_rcv_emp ) )                                    ! evaporation - precipitation 
    726719         CASE( 'conservative' ) 
     
    752745!!         ENDIF 
    753746!!gm  end of internal cooking 
    754          ! 
    755          emps(:,:) = emp(:,:)                                        ! concentration/dilution = emp 
    756    
    757          !                                                           ! 10 m wind speed 
    758          IF( srcv(jpr_w10m)%laction )   wndm(:,:) = frcv(:,:,jpr_w10m) 
     747         !   
     748         !                                                       ! non solar heat flux over the ocean (qns) 
     749         IF( srcv(jpr_qnsoce)%laction )   qns(:,:) = frcv(:,:,jpr_qnsoce) 
     750         IF( srcv(jpr_qnsmix)%laction )   qns(:,:) = frcv(:,:,jpr_qnsmix) 
     751         ! 
     752         zcoef = xlsn / rhosn                                    ! qns update over free ocean with: 
     753         qns(:,:) = qns(:,:) - frcv(:,:,jpr_snow) * zcoef            ! energy for melting solid precipitation over free ocean 
     754            &                - emp(:,:) * sst_m(:,:) * rcp           ! remove heat content due to mass flux (assumed to be at SST) 
     755         ! 
     756         !                                                       ! solar flux over the ocean          (qsr) 
     757         IF( srcv(jpr_qsroce)%laction )   qsr(:,:) = frcv(:,:,jpr_qsroce)  
     758         IF( srcv(jpr_qsrmix)%laction )   qsr(:,:) = frcv(:,:,jpr_qsrmix) 
    759759         ! 
    760760#if defined  key_cpl_carbon_cycle 
    761          !                                                              ! atmosph. CO2 (ppm) 
     761         !                                                       ! atmosph. CO2 (ppm) 
    762762         IF( srcv(jpr_co2)%laction )   atm_co2(:,:) = frcv(:,:,jpr_co2) 
    763763#endif 
    764  
     764         ! 
    765765      ENDIF 
    766766      ! 
     
    10461046      !!---------------------------------------------------------------------- 
    10471047      zicefr(:,:,1) = 1.- p_frld(:,:,1) 
    1048       IF( lk_diaar5 )   zcptn(:,:) = rcp * tn(:,:,1) 
     1048      zcptn(:,:) = rcp * sst_m(:,:) 
    10491049      ! 
    10501050      !                                                      ! ========================= ! 
     
    11181118            &                                                   +          pist(:,:,1)   * zicefr(:,:,1) ) ) 
    11191119      END SELECT 
    1120       !                                                           ! snow melting heat flux .... 
    1121       !   energy for melting solid precipitation over ice-free ocean 
    1122       zcoef = xlsn / rhosn 
     1120      ! 
     1121      zcoef = xlsn / rhosn                                        ! qns_tot update over free ocean with: 
    11231122      ztmp(:,:) = p_frld(:,:,1) * zsnow(:,:) * zcoef 
    1124       pqns_tot(:,:) = pqns_tot(:,:) - ztmp(:,:) 
    1125       IF( lk_diaar5 )   CALL iom_put( 'hflx_snow_cea', ztmp + zsnow(:,:) * zcptn(:,:) )   ! heat flux from snow (cell average) 
    1126 !!gm 
    1127 !!    currently it is taken into account in leads budget but not in the qns_tot, and thus not in  
    1128 !!    the flux that enter the ocean.... 
    1129 !!    moreover 1 - it is not diagnose anywhere....  
    1130 !!             2 - it is unclear for me whether this heat lost is taken into account in the atmosphere or not... 
    1131 !! 
    1132 !! similar job should be done for snow and precipitation temperature 
    1133       !                                                           ! Iceberg melting heat flux .... 
    1134       !   energy for iceberg melting  
    1135       IF( srcv(jpr_cal)%laction ) THEN  
     1123      pqns_tot(:,:) = pqns_tot(:,:)                       & 
     1124         &          - ztmp(:,:)                           &            ! remove the latent heat flux of solid precip. melting 
     1125         &          + (  pemp_tot(:,:)                    &            ! remove the heat content of mass flux (assumed to be at SST) 
     1126         &             - pemp_ice(:,:) * p_frld(:,:,1)  ) * zcptn(:,:)  
     1127         ! 
     1128      IF( lk_diaar5 )   CALL iom_put( 'hflx_snow_cea', ztmp(:,:) + zsnow(:,:) * zcptn(:,:) )   ! heat flux from snow (cell average) 
     1129 
     1130!!gm BUG ???   just above the right value should be : ztmp + zsnow*p_frld*zcptn 
     1131 
     1132      !                                
     1133      IF( srcv(jpr_cal)%laction ) THEN                                 ! remove the latent heat flux of iceberg melting 
    11361134         zcoef = xlic / rhoic 
    11371135         ztmp(:,:) = frcv(:,:,jpr_cal) * zcoef 
    11381136         pqns_tot(:,:) = pqns_tot(:,:) - ztmp(:,:) 
     1137         ! 
    11391138         IF( lk_diaar5 )   CALL iom_put( 'hflx_cal_cea', ztmp + frcv(:,:,jpr_cal) * zcptn(:,:) )   ! heat flux from calving 
    11401139      ENDIF 
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcflx.F90

    r1730 r1859  
    44   !! Ocean forcing:  momentum, heat and freshwater flux formulation 
    55   !!===================================================================== 
    6    !! History :  9.0   !  06-06  (G. Madec)  Original code 
     6   !! History :  1.0  !  2006-06  (G. Madec)  Original code 
     7   !!            3.3  !  2010-05  (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    78   !!---------------------------------------------------------------------- 
    89 
     
    5253#  include "vectopt_loop_substitute.h90" 
    5354   !!---------------------------------------------------------------------- 
    54    !!   OPA 9.0 , LOCEAN-IPSL (2006)  
     55   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010) 
    5556   !! $Id$ 
    5657   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    7475      !! 
    7576      !!      CAUTION :  - never mask the surface stress fields 
    76       !!                 - the stress is assumed to be in the mesh referential 
    77       !!                   i.e. the (i,j) referential 
     77      !!                 - the stress is assumed to be in the (i,j) mesh referential 
    7878      !! 
    7979      !! ** Action  :   update at each time-step 
     
    8181      !!              - taum        wind stress module at T-point 
    8282      !!              - wndm        10m wind module at T-point 
    83       !!              - qns, qsr    non-slor and solar heat flux 
    84       !!              - emp, emps   evaporation minus precipitation 
     83      !!              - qns         non solar heat flux including heat flux due to emp 
     84      !!              - qsr         solar heat flux 
     85      !!              - emp         upward mass flux (evap. - precip.) 
    8586      !!---------------------------------------------------------------------- 
    8687      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     
    136137      ENDIF 
    137138 
    138       CALL fld_read( kt, nn_fsbc, sf )           ! Read input fields and provides the 
    139       !                                          ! input fields at the current time-step 
     139      CALL fld_read( kt, nn_fsbc, sf )           ! input fields at the current time-step 
    140140 
    141       IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 
    142          ! 
    143          ! set the ocean fluxes from read fields 
     141      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN       ! set the ocean fluxes from read fields 
    144142!CDIR COLLAPSE 
    145143         DO jj = 1, jpj 
     
    151149               emp (ji,jj) = sf(jp_emp )%fnow(ji,jj) 
    152150            END DO 
    153          END DO 
    154           
    155          ! module of wind stress and wind speed at T-point 
    156          zcoef = 1. / ( zrhoa * zcdrag )  
     151         END DO          
     152         !                                       ! add to qns the heat due to e-p 
     153         qns(:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp      ! mass flux are at SST 
     154 
     155         zcoef = 1. / ( zrhoa * zcdrag )         ! module of wind stress and wind speed at T-point 
    157156!CDIR NOVERRCHK 
    158157         DO jj = 2, jpjm1 
     
    167166         END DO 
    168167         CALL lbc_lnk( taum(:,:), 'T', 1. )   ;   CALL lbc_lnk( wndm(:,:), 'T', 1. ) 
    169  
    170          ! Initialization of emps (when no ice model) 
    171          emps(:,:) = emp (:,:)  
    172168                   
    173          ! control print (if less than 100 time-step asked) 
    174          IF( nitend-nit000 <= 100 .AND. lwp ) THEN 
     169         IF( nitend-nit000 <= 100 .AND. lwp ) THEN      ! control print (if less than 100 time-step asked) 
    175170            WRITE(numout,*)  
    176171            WRITE(numout,*) '        read daily momentum, heat and freshwater fluxes OK' 
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcfwb.F90

    r1822 r1859  
    44   !! Ocean fluxes   : domain averaged freshwater budget 
    55   !!====================================================================== 
    6    !! History :  8.2  !  01-02  (E. Durand)  Original code 
    7    !!            8.5  !  02-06  (G. Madec)  F90: Free form and module 
    8    !!            9.0  !  06-08  (G. Madec)  Surface module 
    9    !!            9.2  !  09-07  (C. Talandier) emp mean s spread over erp area  
     6   !! History :  OPA  !  2001-02  (E. Durand)  Original code 
     7   !!   NEMO     1.0  !  2002-06  (G. Madec)  F90: Free form and module 
     8   !!            3.0  !  2006-08  (G. Madec)  Surface module 
     9   !!            3.2  !  2009-07  (C. Talandier) emp mean s spread over erp area  
     10   !!            3.3  !  2010-05  (Y. Aksenov G. Madec) embedded sea-ice case 
    1011   !!---------------------------------------------------------------------- 
    1112 
     
    2728   PRIVATE 
    2829 
    29    PUBLIC   sbc_fwb      ! routine called by step 
    30  
    31    REAL(wp) ::   a_fwb_b            ! annual domain averaged freshwater budget 
    32    REAL(wp) ::   a_fwb              ! for 2 year before (_b) and before year. 
    33    REAL(wp) ::   empold             ! empold to be suppressed 
    34    REAL(wp) ::   area               ! global mean ocean surface (interior domain) 
     30   PUBLIC   sbc_fwb    ! routine called by step 
     31 
     32   REAL(wp) ::   a_fwb_b   ! annual domain averaged freshwater budget 
     33   REAL(wp) ::   a_fwb     ! for 2 year before (_b) and before year. 
     34   REAL(wp) ::   empold    ! empold to be suppressed 
     35   REAL(wp) ::   area      ! global mean ocean surface (interior domain) 
    3536 
    3637   REAL(wp), DIMENSION(jpi,jpj) ::   e1e2_i    ! area of the interior domain (e1t*e2t*tmask_i) 
     
    4041#  include "vectopt_loop_substitute.h90" 
    4142   !!---------------------------------------------------------------------- 
    42    !!  OPA 9.0 , LOCEAN-IPSL (2006)  
     43   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    4344   !! $Id$ 
    4445   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    5758      !!                =2 annual global mean corrected from previous year 
    5859      !!                =3 global mean of emp set to zero at each nn_fsbc time step 
    59       !!                   & spread out over erp area depending its sign 
     60      !!                   and spread out over erp area depending its sign 
    6061      !!---------------------------------------------------------------------- 
    6162      INTEGER, INTENT( in ) ::   kt       ! ocean time-step index 
     
    6364      INTEGER, INTENT( in ) ::   kn_fwb   ! ocean time-step index 
    6465      !! 
    65       INTEGER  ::   inum                  ! temporary logical unit 
    66       INTEGER  ::   ikty, iyear           !  
    67       REAL(wp) ::   z_emp, z_emp_nsrf, zsum_emp, zsum_erp       ! temporary scalars 
    68       REAL(wp) ::   zsurf_neg, zsurf_pos, zsurf_tospread 
    69       REAL(wp), DIMENSION(jpi,jpj) ::   ztmsk_neg, ztmsk_pos, ztmsk_tospread 
    70       REAL(wp), DIMENSION(jpi,jpj) ::   z_wgt, zerp_cor 
     66      INTEGER  ::   inum          ! temporary logical unit 
     67      INTEGER  ::   ikty, iyear   !  
     68      REAL(wp) ::   z_emp, z_emp_nsrf, zsum_emp, zsum_erp, zcoef     ! temporary scalars 
     69      REAL(wp) ::   zsurf_neg, zsurf_pos, zsurf_tospread             !    -         - 
     70      REAL(wp), DIMENSION(jpi,jpj) ::   ztmsk_neg, ztmsk_tospread    ! 2D workspace 
     71      REAL(wp), DIMENSION(jpi,jpj) ::   ztmsk_pos, z_wgt, zerp_cor   !  -      - 
    7172      !!---------------------------------------------------------------------- 
    7273      ! 
     
    8384            IF( kn_fwb == 3 .AND. nn_sssr /= 2 )   & 
    8485               &   CALL ctl_stop( 'The option nn_fwb = 3 must be associated to nn_sssr = 2 ' ) 
    85              
    8686         ENDIF 
    8787         ! 
     
    9999         CALL ctl_stop( ctmp1 ) 
    100100         ! 
    101           
    102       ! 
    103101      CASE ( 1 )                               ! global mean emp set to zero 
    104102         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
    105103            z_emp = SUM( e1e2_i(:,:) * emp(:,:) ) / area 
    106104            IF( lk_mpp )   CALL  mpp_sum( z_emp    )   ! sum over the global domain 
    107             emp (:,:) = emp (:,:) - z_emp 
    108             emps(:,:) = emps(:,:) - z_emp 
     105            zcoef = z_emp * rcp 
     106            emp(:,:) = emp(:,:) - z_emp 
     107            qns(:,:) = qns(:,:) + zcoef * sst_m(:,:) 
    109108         ENDIF 
    110109         ! 
     
    138137         ! correct the freshwater fluxes 
    139138         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
    140             emp (:,:) = emp (:,:) + empold 
    141             emps(:,:) = emps(:,:) + empold 
     139            zcoef = z_emp * rcp 
     140            emp(:,:) = emp (:,:) + empold 
     141            qns(:,:) = qns(:,:) - zcoef * sst_m(:,:) 
    142142         ENDIF 
    143143         ! 
     
    152152         ! 
    153153         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
    154             ! Select <0 and >0 area of erp 
     154            !                                       ! Select <0 and >0 area of erp 
    155155            ztmsk_pos(:,:) = tmask_i(:,:) 
    156             WHERE( erp < 0.e0 ) ztmsk_pos = 0.e0 
     156            WHERE( erp(:,:) < 0.e0 )   ztmsk_pos(:,:) = 0.e0 
    157157            ztmsk_neg(:,:) = tmask_i(:,:) - ztmsk_pos(:,:) 
    158158 
    159             ! Area filled by <0 and >0 erp  
    160             zsurf_neg = SUM( e1e2_i(:,:)*ztmsk_neg(:,:) ) 
    161             zsurf_pos = SUM( e1e2_i(:,:)*ztmsk_pos(:,:) ) 
     159            !                                       ! Area filled by <0 and >0 erp  
     160            zsurf_neg = SUM(  e1e2_i(:,:) * ztmsk_neg(:,:) ) 
     161            zsurf_pos = SUM(  e1e2_i(:,:) * ztmsk_pos(:,:) ) 
    162162         
    163             ! emp global mean  
     163            !                                       ! emp global mean  
    164164            z_emp = SUM( e1e2_i(:,:) * emp(:,:) ) / area 
    165165            ! 
    166             IF( lk_mpp )   CALL  mpp_sum( z_emp ) 
     166            IF( lk_mpp )   CALL  mpp_sum( z_emp     ) 
    167167            IF( lk_mpp )   CALL  mpp_sum( zsurf_neg ) 
    168168            IF( lk_mpp )   CALL  mpp_sum( zsurf_pos ) 
    169169             
    170             IF( z_emp < 0.e0 ) THEN 
    171                 ! to spread out over >0 erp area to increase evaporation damping process 
     170            IF( z_emp < 0.e0 ) THEN                 ! spread out over >0 erp area to increase evaporation damping process 
    172171                zsurf_tospread = zsurf_pos 
    173172                ztmsk_tospread(:,:) = ztmsk_pos(:,:) 
    174             ELSE 
    175                 ! to spread out over <0 erp area to increase precipitation damping process 
     173            ELSE                                    ! spread out over <0 erp area to increase precipitation damping process 
    176174                zsurf_tospread = zsurf_neg 
    177175                ztmsk_tospread(:,:) = ztmsk_neg(:,:) 
     
    192190            CALL lbc_lnk( zerp_cor, 'T', 1. ) 
    193191 
    194             emp (:,:) = emp (:,:) + zerp_cor(:,:) 
    195             emps(:,:) = emps(:,:) + zerp_cor(:,:) 
    196             erp (:,:) = erp (:,:) + zerp_cor(:,:) 
     192            emp(:,:) = emp(:,:) + zerp_cor(:,:) 
     193            qns(:,:) = qns(:,:) - zerp_cor(:,:) * rcp * sst_m(:,:) 
     194            erp(:,:) = erp(:,:) + zerp_cor(:,:) 
    197195             
    198196            IF( nprint == 1 .AND. lwp ) THEN 
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcice_if.F90

    r1730 r1859  
    3030#  include "domzgr_substitute.h90" 
    3131   !!---------------------------------------------------------------------- 
    32    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     32   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    3333   !! $Id$ 
    3434   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    7272         !             !   file    ! frequency !  variable  ! time intep !  clim  ! 'yearly' or ! weights  ! rotation   ! 
    7373         !             !   name    !  (hours)  !   name     !   (T/F)    !  (T/F) !  'monthly'  ! filename ! pairs      !  
    74          sn_ice = FLD_N('ice_cover',    -1    ,  'ice_cov' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) 
    75  
    76          REWIND ( numnam )               ! ... read in namlist namiif 
     74         sn_ice = FLD_N('ice_cover',    -1     ,  'ice_cov' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) 
     75         ! 
     76         REWIND ( numnam )               ! read in namlist namiif 
    7777         READ   ( numnam, namsbc_iif ) 
    78  
     78         ! 
    7979         ALLOCATE( sf_ice(1), STAT=ierror ) 
    8080         IF( ierror > 0 ) THEN 
     
    8383         ALLOCATE( sf_ice(1)%fnow(jpi,jpj) ) 
    8484         ALLOCATE( sf_ice(1)%fdta(jpi,jpj,2) ) 
    85  
    86  
    87          ! fill sf_ice with sn_ice and control print 
     85         ! 
     86         !                               ! fill sf_ice with sn_ice and control print 
    8887         CALL fld_fill( sf_ice, (/ sn_ice /), cn_dir, 'sbc_ice_if', 'ice-if sea-ice model', 'namsbc_iif' ) 
    8988         ! 
    9089      ENDIF 
    9190 
    92       CALL fld_read( kt, nn_fsbc, sf_ice )           ! Read input fields and provides the 
    93       !                                              ! input fields at the current time-step 
     91      CALL fld_read( kt, nn_fsbc, sf_ice )           ! Read input fields at the current time-step 
    9492       
    9593      IF( MOD( kt-1, nn_fsbc) == 0 ) THEN 
     
    10199         fr_i(:,:) = tfreez( sss_m ) * tmask(:,:,1)      ! sea surface freezing temperature [Celcius] 
    102100 
    103          ! Flux and ice fraction computation 
    104101!CDIR COLLAPSE 
    105          DO jj = 1, jpj 
     102         DO jj = 1, jpj          ! Flux and ice fraction computation 
    106103            DO ji = 1, jpi 
    107104               ! 
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcmod.F90

    r1792 r1859  
    44   !! Surface module :  provide to the ocean its surface boundary condition 
    55   !!====================================================================== 
    6    !! History :  3.0   !  07-2006  (G. Madec)  Original code 
    7    !!             -    !  08-2008  (S. Masson, E. .... ) coupled interface 
     6   !! History :  3.0  !  2007-06  (G. Madec)  Original code 
     7   !!            3.1  !  2008-08  (S. Masson, E. .... ) coupled interface 
     8   !!            3.3  !  2010-05  (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    89   !!---------------------------------------------------------------------- 
    910 
     
    4950#  include "domzgr_substitute.h90" 
    5051   !!---------------------------------------------------------------------- 
    51    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     52   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    5253   !! $Id$ 
    5354   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    8687!!gm  IF( lk_sbc_cpl       ) THEN   ;   ln_cpl      = .TRUE.   ;   ELSE   ;   ln_cpl      = .FALSE.   ;   ENDIF 
    8788 
    88       IF ( Agrif_Root() ) THEN 
     89      IF( Agrif_Root() ) THEN 
    8990        IF( lk_lim2 )            nn_ice      = 2 
    9091        IF( lk_lim3 )            nn_ice      = 3 
     
    123124      ENDIF 
    124125      IF( nn_ice == 0  )   fr_i(:,:) = 0.e0        ! no ice in the domain, ice fraction is always zero 
     126 
     127      emps(:,:) = 0.e0                             ! the salt flux will be computed (i.e. will be non-zero) only if  
     128      !                                            ! sea-ice is present, or lk_vvl=F, or surface salt restoring is used. 
    125129 
    126130      !                                            ! restartability    
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r1730 r1859  
    88   !!            3.0  !  2006-07  (G. Madec)  Surface module  
    99   !!            3.2  !  2009-04  (B. Lemaire)  Introduce iom_put 
     10   !!             -   !  2010-05  (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    1011   !!---------------------------------------------------------------------- 
    1112 
     
    4142   REAL(wp), PUBLIC, DIMENSION(jpk)     ::   rnfmsk_z    !: river mouth mask (vert.) 
    4243 
     44   REAL(wp) ::   rfact_rcp   ! = rn_rfact * rcp 
    4345   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_rnf   ! structure of input SST (file information, fields read) 
    4446 
    4547   !!---------------------------------------------------------------------- 
    46    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     48   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    4749   !! $Id$ 
    4850   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    6466      !!---------------------------------------------------------------------- 
    6567      INTEGER, INTENT(in) ::   kt          ! ocean time step 
    66       !! 
     68      ! 
    6769      INTEGER  ::   ji, jj   ! dummy loop indices 
    6870      INTEGER  ::   ierror   ! temporary integer 
     
    7880            ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,2) ) 
    7981         ENDIF 
    80          CALL sbc_rnf_init(sf_rnf) 
     82         CALL sbc_rnf_init( sf_rnf ) 
     83         ! 
     84         rfact_rcp = rn_rfact * rcp 
    8185      ENDIF 
    8286 
     
    8589         !                                                !-------------------! 
    8690         ! 
    87          CALL fld_read( kt, nn_fsbc, sf_rnf )   ! Read Runoffs data and provides it 
    88          !                                      ! at the current time-step 
    89  
    90          ! Runoff reduction only associated to the ORCA2_LIM configuration 
    91          ! when reading the NetCDF file runoff_1m_nomask.nc 
    92          IF( cp_cfg == 'orca' .AND. jp_cfg == 2 )   THEN 
    93             DO jj = 1, jpj 
     91         CALL fld_read( kt, nn_fsbc, sf_rnf )                    ! Read Runoffs data at the current time-step 
     92         ! 
     93!!gm CAUTION this is ugly  ===>>> to be removed! 
     94         IF( cp_cfg == 'orca' .AND. jp_cfg == 2 )   THEN         ! Runoff reduction only associated to the ORCA2_LIM configuration 
     95            DO jj = 1, jpj                                       ! when reading the NetCDF file runoff_1m_nomask.nc 
    9496               DO ji = 1, jpi 
    9597                  IF( gphit(ji,jj) > 40 .AND. gphit(ji,jj) < 65 )   sf_rnf(1)%fnow(ji,jj) = 0.85 * sf_rnf(1)%fnow(ji,jj) 
     
    9799            END DO 
    98100         ENDIF 
    99  
    100          ! C a u t i o n : runoff is negative and in kg/m2/s  
    101  
    102          IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 
    103             emp (:,:) = emp (:,:) - rn_rfact * ABS( sf_rnf(1)%fnow(:,:) ) 
    104             emps(:,:) = emps(:,:) - rn_rfact * ABS( sf_rnf(1)%fnow(:,:) ) 
     101         ! 
     102         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN                    ! C a u t i o n : runoff is negative and in kg/m2/s  
     103            emp(:,:) = emp(:,:) - rn_rfact  * ABS( sf_rnf(1)%fnow(:,:) )                ! mass flux 
     104            qns(:,:) = qns(:,:) + rfact_rcp * ABS( sf_rnf(1)%fnow(:,:) ) * sst_m(:,:)   ! its associated heat content (at SST) 
     105            ! 
    105106            CALL iom_put( "runoffs", sf_rnf(1)%fnow )         ! runoffs 
    106107         ENDIF 
  • branches/DEV_r1837_mass_heat_salt_fluxes/NEMO/OPA_SRC/SBC/sbcssr.F90

    r1730 r1859  
    66   !! History :  3.0  !  2006-06  (G. Madec)  Original code 
    77   !!            3.2  !  2009-04  (B. Lemaire)  Introduce iom_put 
     8   !!             -   !  2009-07  (C. Talandier, G. Madec)  Add a bound to the Erp  
     9   !!            3.3  !  2010-05  (Y. Aksenov G. Madec) salt flux + heat associated with emp 
    810   !!---------------------------------------------------------------------- 
    911 
     
    3739   REAL(wp)        ::   rn_deds     = -27.70    ! restoring factor on SST and SSS 
    3840   LOGICAL         ::   ln_sssr_bnd = .false.   ! flag to bound erp term  
    39    REAL(wp)        ::   rn_sssr_bnd =   0.e0    ! ABS(Max./Min.) value of erp term [mm/day] 
     41   REAL(wp)        ::   rn_sssr_bnd =   4.e0    ! ABS(Max./Min.) value of erp term [mm/day] 
    4042 
    4143   REAL(wp) , ALLOCATABLE, DIMENSION(:) ::   buffer   ! Temporary buffer for exchange 
     
    4648#  include "domzgr_substitute.h90" 
    4749   !!---------------------------------------------------------------------- 
    48    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     50   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    4951   !! $Id$ 
    5052   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    7072      !! 
    7173      INTEGER  ::   ji, jj   ! dummy loop indices 
    72       REAL(wp) ::   zerp     ! local scalar for evaporation damping 
    73       REAL(wp) ::   zqrp     ! local scalar for heat flux damping 
    74       REAL(wp) ::   zsrp     ! local scalar for unit conversion of rn_deds factor 
    75       REAL(wp) ::   zerp_bnd ! local scalar for unit conversion of rn_epr_max factor 
    7674      INTEGER  ::   ierror   ! return error code 
    77       !! 
    78       CHARACTER(len=100) ::  cn_dir          ! Root directory for location of ssr files 
     75      REAL(wp) ::   zerp, zqrp, zsrp, zerp_bnd    ! local scalar 
     76      !! 
     77      CHARACTER(len=100) ::  cn_dir = './'   ! Root directory for location of ssr files 
    7978      TYPE(FLD_N) ::   sn_sst, sn_sss        ! informations about the fields to be read 
    8079      NAMELIST/namsbc_ssr/ cn_dir, nn_sstr, nn_sssr, rn_dqdt, rn_deds, sn_sst, sn_sss, ln_sssr_bnd, rn_sssr_bnd 
     
    8584         !                                            ! -------------------- ! 
    8685         !                            !* set file information 
    87          cn_dir  = './'            ! directory in which the model is executed 
    8886         ! ... default values (NB: frequency positive => hours, negative => months) 
    8987         !            !   file    ! frequency !  variable  ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   ! 
     
    158156                  END DO 
    159157               END DO 
    160                CALL iom_put( "qrp", qrp )                             ! heat flux damping 
    161             ENDIF 
    162             ! 
    163             IF( nn_sssr == 1 ) THEN                   !* Salinity damping term (salt flux, emps only) 
     158               CALL iom_put( "qrp", qrp )                             ! heat flux damping  
     159            ENDIF 
     160            ! 
     161            IF( nn_sssr == 1 ) THEN                   !* Salinity damping term (salt flux only (emps)) 
    164162               zsrp = rn_deds / rday                                  ! from [mm/day] to [kg/m2/s] 
    165163!CDIR COLLAPSE 
     
    167165                  DO ji = 1, jpi 
    168166                     zerp = zsrp * ( 1. - 2.*rnfmsk(ji,jj) )   &      ! No damping in vicinity of river mouths 
    169                         &        * ( sss_m(ji,jj) - sf_sss(1)%fnow(ji,jj) )   & 
    170                         &        / ( sss_m(ji,jj) + 1.e-20   ) 
     167                        &        * ( sss_m(ji,jj) - sf_sss(1)%fnow(ji,jj) ) 
    171168                     emps(ji,jj) = emps(ji,jj) + zerp 
    172                      erp( ji,jj) = zerp 
     169                     erp( ji,jj) = zerp / MAX( sss_m(ji,jj), 1.e-20  )  ! converted into an equivalent emp (diag. only) 
    173170                  END DO 
    174171               END DO 
    175172               CALL iom_put( "erp", erp )                             ! freshwater flux damping 
    176173               ! 
    177             ELSEIF( nn_sssr == 2 ) THEN               !* Salinity damping term (volume flux, emp and emps) 
     174            ELSEIF( nn_sssr == 2 ) THEN               !* Salinity damping term (volume flux (emp) and qns) 
    178175               zsrp = rn_deds / rday                                  ! from [mm/day] to [kg/m2/s] 
    179176               zerp_bnd = rn_sssr_bnd / rday                          !       -              -     
     
    183180                     zerp = zsrp * ( 1. - 2.*rnfmsk(ji,jj) )   &      ! No damping in vicinity of river mouths 
    184181                        &        * ( sss_m(ji,jj) - sf_sss(1)%fnow(ji,jj) )   & 
    185                         &        / ( sss_m(ji,jj) + 1.e-20   ) 
     182                        &        / MAX(  sss_m(ji,jj), 1.e-20  ) 
    186183                     IF( ln_sssr_bnd )   zerp = SIGN( 1., zerp ) * MIN( zerp_bnd, ABS(zerp) ) 
    187                      emp (ji,jj) = emp (ji,jj) + zerp 
    188                      emps(ji,jj) = emps(ji,jj) + zerp 
    189                      erp (ji,jj) = zerp 
     184!!gm better coding   IF( ln_sssr_bnd )   zerp = MAX( -zerp_bnd, MIN( zerp, zerp_bnd )  ) 
     185                     emp(ji,jj) = emp(ji,jj) + zerp 
     186                     qns(ji,jj) = qns(ji,jj) - zerp * rcp * sst_m(ji,jj) 
     187                     erp(ji,jj) = zerp 
    190188                  END DO 
    191189               END DO 
Note: See TracChangeset for help on using the changeset viewer.