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.
sbc_oce.F90 in NEMO/branches/2019/dev_ASINTER-01-05_merged/src/OCE/SBC – NEMO

source: NEMO/branches/2019/dev_ASINTER-01-05_merged/src/OCE/SBC/sbc_oce.F90 @ 12015

Last change on this file since 12015 was 12015, checked in by gsamson, 4 years ago

dev_ASINTER-01-05_merged: merge dev_r11085_ASINTER-05_Brodeau_Advanced_Bulk branch @rev11988 with dev_r11265_ASINTER-01_Guillaume_ABL1D branch @rev11937 (tickets #2159 and #2131); ORCA2_ICE(_ABL) reproductibility OK

  • Property svn:keywords set to Id
File size: 16.6 KB
RevLine 
[888]1MODULE sbc_oce
2   !!======================================================================
3   !!                       ***  MODULE  sbc_oce  ***
4   !! Surface module :   variables defined in core memory
5   !!======================================================================
[2528]6   !! History :  3.0  ! 2006-06  (G. Madec)  Original code
7   !!             -   ! 2008-08  (G. Madec)  namsbc moved from sbcmod
8   !!            3.3  ! 2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps
9   !!             -   ! 2010-11  (G. Madec) ice-ocean stress always computed at each ocean time-step
10   !!            3.3  ! 2010-10  (J. Chanut, C. Bricaud)  add the surface pressure forcing
[4161]11   !!            4.0  ! 2012-05  (C. Rousset) add attenuation coef for use in ice model
[7646]12   !!            4.0  ! 2016-06  (L. Brodeau) new unified bulk routine (based on AeroBulk)
[11275]13   !!            4.0  ! 2019-03  (F. Lemarié, G. Samson) add compatibility with ABL mode   
[888]14   !!----------------------------------------------------------------------
15
[2715]16   !!----------------------------------------------------------------------
17   !!   sbc_oce_alloc : allocation of sbc arrays
18   !!   sbc_tau2wnd   : wind speed estimated from wind stress
19   !!----------------------------------------------------------------------
20   USE par_oce        ! ocean parameters
21   USE in_out_manager ! I/O manager
22   USE lib_mpp        ! MPP library
23
[888]24   IMPLICIT NONE
25   PRIVATE
[2715]26
27   PUBLIC   sbc_oce_alloc   ! routine called in sbcmod.F90
28   PUBLIC   sbc_tau2wnd     ! routine called in several sbc modules
[888]29   
30   !!----------------------------------------------------------------------
[1218]31   !!           Namelist for the Ocean Surface Boundary Condition
32   !!----------------------------------------------------------------------
[4147]33   !                                   !!* namsbc namelist *
[7646]34   LOGICAL , PUBLIC ::   ln_usr         !: user defined formulation
[4147]35   LOGICAL , PUBLIC ::   ln_flx         !: flux      formulation
[7646]36   LOGICAL , PUBLIC ::   ln_blk         !: bulk formulation
[11275]37   LOGICAL , PUBLIC ::   ln_abl         !: Atmospheric boundary layer model
[4990]38#if defined key_oasis3
[5407]39   LOGICAL , PUBLIC ::   lk_oasis = .TRUE.  !: OASIS used
[4990]40#else
[5407]41   LOGICAL , PUBLIC ::   lk_oasis = .FALSE. !: OASIS unused
[4990]42#endif
[5407]43   LOGICAL , PUBLIC ::   ln_cpl         !: ocean-atmosphere coupled formulation
44   LOGICAL , PUBLIC ::   ln_mixcpl      !: ocean-atmosphere forced-coupled mixed formulation
[4147]45   LOGICAL , PUBLIC ::   ln_dm2dc       !: Daily mean to Diurnal Cycle short wave (qsr)
[4230]46   LOGICAL , PUBLIC ::   ln_rnf         !: runoffs / runoff mouths
[6140]47   LOGICAL , PUBLIC ::   ln_isf         !: ice shelf melting
[4147]48   LOGICAL , PUBLIC ::   ln_ssr         !: Sea Surface restoring on SST and/or SSS     
49   LOGICAL , PUBLIC ::   ln_apr_dyn     !: Atmospheric pressure forcing used on dynamics (ocean & ice)
50   INTEGER , PUBLIC ::   nn_ice         !: flag for ice in the surface boundary condition (=0/1/2/3)
[9019]51   LOGICAL , PUBLIC ::   ln_ice_embd    !: flag for levitating/embedding sea-ice in the ocean
52   !                                             !: =F levitating ice (no presure effect) with mass and salt exchanges
53   !                                             !: =T embedded sea-ice (pressure effect + mass and salt exchanges)
[5407]54   INTEGER , PUBLIC ::   nn_components  !: flag for sbc module (including sea-ice) coupling mode (see component definition below)
[4147]55   INTEGER , PUBLIC ::   nn_fwb         !: FreshWater Budget:
[1220]56   !                                             !:  = 0 unchecked
57   !                                             !:  = 1 global mean of e-p-r set to zero at each nn_fsbc time step
58   !                                             !:  = 2 annual global mean of e-p-r set to zero
[4147]59   LOGICAL , PUBLIC ::   ln_wave        !: true if some coupling with wave model
60   LOGICAL , PUBLIC ::   ln_cdgw        !: true if neutral drag coefficient from wave model
61   LOGICAL , PUBLIC ::   ln_sdw         !: true if 3d stokes drift from wave model
[9033]62   LOGICAL , PUBLIC ::   ln_tauwoc       !: true if normalized stress from wave is used
[9023]63   LOGICAL , PUBLIC ::   ln_tauw        !: true if ocean stress components from wave is used
[7646]64   LOGICAL , PUBLIC ::   ln_stcor       !: true if Stokes-Coriolis term is used
[4147]65   !
[9023]66   INTEGER , PUBLIC ::   nn_sdrift      ! type of parameterization to calculate vertical Stokes drift
67   !
[4147]68   LOGICAL , PUBLIC ::   ln_icebergs    !: Icebergs
[4161]69   !
[4990]70   INTEGER , PUBLIC ::   nn_lsm         !: Number of iteration if seaoverland is applied
[9019]71   !
72   !                                   !!* namsbc_cpl namelist *
73   INTEGER , PUBLIC ::   nn_cats_cpl    !: Number of sea ice categories over which the coupling is carried out
74
[1218]75   !!----------------------------------------------------------------------
[4990]76   !!           switch definition (improve readability)
77   !!----------------------------------------------------------------------
[7646]78   INTEGER , PUBLIC, PARAMETER ::   jp_usr     = 1        !: user defined                  formulation
[5407]79   INTEGER , PUBLIC, PARAMETER ::   jp_flx     = 2        !: flux                          formulation
[7646]80   INTEGER , PUBLIC, PARAMETER ::   jp_blk     = 3        !: bulk                          formulation
[11275]81   INTEGER , PUBLIC, PARAMETER ::   jp_abl     = 4        !: Atmospheric boundary layer    formulation
82   INTEGER , PUBLIC, PARAMETER ::   jp_purecpl = 5        !: Pure ocean-atmosphere Coupled formulation
83   INTEGER , PUBLIC, PARAMETER ::   jp_none    = 6        !: for OPA when doing coupling via SAS module
[4990]84   
85   !!----------------------------------------------------------------------
[9023]86   !!           Stokes drift parametrization definition
87   !!----------------------------------------------------------------------
[9115]88   INTEGER , PUBLIC, PARAMETER ::   jp_breivik_2014 = 0     !: Breivik  2014: v_z=v_0*[exp(2*k*z)/(1-8*k*z)]
89   INTEGER , PUBLIC, PARAMETER ::   jp_li_2017      = 1     !: Li et al 2017: Stokes drift based on Phillips spectrum (Breivik 2016)
90                                                            !  with depth averaged profile
91   INTEGER , PUBLIC, PARAMETER ::   jp_peakfr       = 2     !: Li et al 2017: using the peak wave number read from wave model instead
92                                                            !  of the inverse depth scale
93   LOGICAL , PUBLIC            ::   ll_st_bv2014  = .FALSE. !  logical indicator, .true. if Breivik 2014 parameterisation is active.
94   LOGICAL , PUBLIC            ::   ll_st_li2017  = .FALSE. !  logical indicator, .true. if Li 2017 parameterisation is active.
95   LOGICAL , PUBLIC            ::   ll_st_bv_li   = .FALSE. !  logical indicator, .true. if either Breivik or Li parameterisation is active.
96   LOGICAL , PUBLIC            ::   ll_st_peakfr  = .FALSE. !  logical indicator, .true. if using Li 2017 with peak wave number
[9023]97
98   !!----------------------------------------------------------------------
[5407]99   !!           component definition
100   !!----------------------------------------------------------------------
101   INTEGER , PUBLIC, PARAMETER ::   jp_iam_nemo = 0      !: Initial single executable configuration
102                                                         !  (no internal OASIS coupling)
103   INTEGER , PUBLIC, PARAMETER ::   jp_iam_opa  = 1      !: Multi executable configuration - OPA component
104                                                         !  (internal OASIS coupling)
105   INTEGER , PUBLIC, PARAMETER ::   jp_iam_sas  = 2      !: Multi executable configuration - SAS component
106                                                         !  (internal OASIS coupling)
107   !!----------------------------------------------------------------------
[888]108   !!              Ocean Surface Boundary Condition fields
109   !!----------------------------------------------------------------------
[5385]110   INTEGER , PUBLIC ::  ncpl_qsr_freq            !: qsr coupling frequency per days from atmosphere
111   !
[2528]112   !!                                   !!   now    ! before   !!
[2715]113   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau   , utau_b   !: sea surface i-stress (ocean referential)     [N/m2]
114   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vtau   , vtau_b   !: sea surface j-stress (ocean referential)     [N/m2]
115   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   taum              !: module of sea surface stress (at T-point)    [N/m2]
[11275]116   !! wndm is used compute surface gases exchanges in ice-free ocean or leads
[2715]117   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wndm              !: wind speed module at T-point (=|U10m-Uoce|)  [m/s]
[12015]118   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rhoa              !: air density at "rn_zu" m above the sea       [kg/m3] !LB
[2715]119   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr               !: sea heat flux:     solar                     [W/m2]
120   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns    , qns_b    !: sea heat flux: non solar                     [W/m2]
121   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr_tot           !: total     solar heat flux (over sea and ice) [W/m2]
122   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns_tot           !: total non solar heat flux (over sea and ice) [W/m2]
123   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp    , emp_b    !: freshwater budget: volume flux               [Kg/m2/s]
[10882]124   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sfx    , sfx_b    !: salt flux                                    [PSS.kg/m2/s]
[2715]125   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp_tot           !: total E-P over ocean and ice                 [Kg/m2/s]
[4148]126   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fmmflx            !: freshwater budget: freezing/melting          [Kg/m2/s]
[5120]127   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff        [Kg/m2/s] 
128   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fwfisf , fwfisf_b !: ice shelf melting   [Kg/m2/s] 
[7788]129   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fwficb , fwficb_b !: iceberg melting [Kg/m2/s] 
130
[2528]131   !!
[2715]132   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  sbc_tsc, sbc_tsc_b  !: sbc content trend                      [K.m/s] jpi,jpj,jpts
133   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  qsr_hc , qsr_hc_b   !: heat content trend due to qsr flux     [K.m/s] jpi,jpj,jpk
[2528]134   !!
[4161]135   !!
[2715]136   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tprecip           !: total precipitation                          [Kg/m2/s]
137   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sprecip           !: solid precipitation                          [Kg/m2/s]
138   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fr_i              !: ice fraction = 1 - lead fraction      (between 0 to 1)
139   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   atm_co2           !: atmospheric pCO2                             [ppm]
[5407]140   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xcplmask          !: coupling mask for ln_mixcpl (warning: allocated in sbccpl)
[888]141
[11275]142   !!---------------------------------------------------------------------
143   !! ABL Vertical Domain size 
144   !!---------------------------------------------------------------------
145   INTEGER , PUBLIC            ::   jpka   = 2     !: ABL number of vertical levels (default definition)
146   INTEGER , PUBLIC            ::   jpkam1 = 1     !: jpka-1
147   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   ght_abl, ghw_abl          !: ABL geopotential height (needed for iom)
148   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   e3t_abl, e3w_abl          !: ABL vertical scale factors (needed for iom)
149
[888]150   !!----------------------------------------------------------------------
151   !!                     Sea Surface Mean fields
152   !!----------------------------------------------------------------------
153   INTEGER , PUBLIC                     ::   nn_fsbc   !: frequency of sbc computation (as well as sea-ice model)
[2715]154   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ssu_m     !: mean (nn_fsbc time-step) surface sea i-current (U-point) [m/s]
155   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ssv_m     !: mean (nn_fsbc time-step) surface sea j-current (V-point) [m/s]
156   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sst_m     !: mean (nn_fsbc time-step) surface sea temperature     [Celsius]
157   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sss_m     !: mean (nn_fsbc time-step) surface sea salinity            [psu]
158   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ssh_m     !: mean (nn_fsbc time-step) sea surface height                [m]
[4990]159   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   e3t_m     !: mean (nn_fsbc time-step) sea surface layer thickness       [m]
[5407]160   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   frq_m     !: mean (nn_fsbc time-step) fraction of solar net radiation absorbed in the 1st T level [-]
[888]161
[12015]162   !!----------------------------------------------------------------------
163   !!                     Cool-skin/Warm-layer
164   !!----------------------------------------------------------------------
165   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tsk       !: sea-surface skin temperature (used if ln_skin_cs==.true. .OR. ln_skin_wl==.true.)  [K] !LB
166
167   
[2715]168   !! * Substitutions
169#  include "vectopt_loop_substitute.h90"
[888]170   !!----------------------------------------------------------------------
[9598]171   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
[2528]172   !! $Id$
[10068]173   !! Software governed by the CeCILL license (see ./LICENSE)
[2715]174   !!----------------------------------------------------------------------
175CONTAINS
176
177   INTEGER FUNCTION sbc_oce_alloc()
178      !!---------------------------------------------------------------------
179      !!                  ***  FUNCTION sbc_oce_alloc  ***
180      !!---------------------------------------------------------------------
[4292]181      INTEGER :: ierr(5)
[2715]182      !!---------------------------------------------------------------------
183      ierr(:) = 0
184      !
185      ALLOCATE( utau(jpi,jpj) , utau_b(jpi,jpj) , taum(jpi,jpj) ,     &
[12015]186         &      vtau(jpi,jpj) , vtau_b(jpi,jpj) , wndm(jpi,jpj) , rhoa(jpi,jpj) , STAT=ierr(1) ) 
[2715]187         !
[3625]188      ALLOCATE( qns_tot(jpi,jpj) , qns  (jpi,jpj) , qns_b(jpi,jpj),        &
189         &      qsr_tot(jpi,jpj) , qsr  (jpi,jpj) ,                        &
190         &      emp    (jpi,jpj) , emp_b(jpi,jpj) ,                        &
[4148]191         &      sfx    (jpi,jpj) , sfx_b(jpi,jpj) , emp_tot(jpi,jpj), fmmflx(jpi,jpj), STAT=ierr(2) )
[2715]192         !
[7788]193      ALLOCATE( fwfisf  (jpi,jpj), rnf  (jpi,jpj) , sbc_tsc  (jpi,jpj,jpts) , qsr_hc  (jpi,jpj,jpk) ,  &
194         &      fwfisf_b(jpi,jpj), rnf_b(jpi,jpj) , sbc_tsc_b(jpi,jpj,jpts) , qsr_hc_b(jpi,jpj,jpk) ,  &
195         &      fwficb  (jpi,jpj), fwficb_b(jpi,jpj), STAT=ierr(3) )
[2715]196         !
197      ALLOCATE( tprecip(jpi,jpj) , sprecip(jpi,jpj) , fr_i(jpi,jpj) ,     &
198         &      atm_co2(jpi,jpj) ,                                        &
[5407]199         &      ssu_m  (jpi,jpj) , sst_m(jpi,jpj) , frq_m(jpi,jpj) ,      &
200         &      ssv_m  (jpi,jpj) , sss_m(jpi,jpj) , ssh_m(jpi,jpj) , STAT=ierr(4) )
[11275]201      !
[4292]202      ALLOCATE( e3t_m(jpi,jpj) , STAT=ierr(5) )
[11275]203      !
[2715]204      sbc_oce_alloc = MAXVAL( ierr )
[10425]205      CALL mpp_sum ( 'sbc_oce', sbc_oce_alloc )
[2715]206      IF( sbc_oce_alloc > 0 )   CALL ctl_warn('sbc_oce_alloc: allocation of arrays failed')
207      !
208   END FUNCTION sbc_oce_alloc
209
210
211   SUBROUTINE sbc_tau2wnd
212      !!---------------------------------------------------------------------
213      !!                    ***  ROUTINE sbc_tau2wnd  ***
214      !!                   
215      !! ** Purpose : Estimation of wind speed as a function of wind stress   
216      !!
217      !! ** Method  : |tau|=rhoa*Cd*|U|^2
218      !!---------------------------------------------------------------------
219      USE dom_oce         ! ocean space and time domain
220      USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
221      REAL(wp) ::   zrhoa  = 1.22         ! Air density kg/m3
222      REAL(wp) ::   zcdrag = 1.5e-3       ! drag coefficient
223      REAL(wp) ::   ztx, zty, ztau, zcoef ! temporary variables
224      INTEGER  ::   ji, jj                ! dummy indices
225      !!---------------------------------------------------------------------
226      zcoef = 0.5 / ( zrhoa * zcdrag ) 
227      DO jj = 2, jpjm1
228         DO ji = fs_2, fs_jpim1   ! vect. opt.
229            ztx = utau(ji-1,jj  ) + utau(ji,jj) 
230            zty = vtau(ji  ,jj-1) + vtau(ji,jj) 
231            ztau = SQRT( ztx * ztx + zty * zty )
232            wndm(ji,jj) = SQRT ( ztau * zcoef ) * tmask(ji,jj,1)
233         END DO
234      END DO
[10425]235      CALL lbc_lnk( 'sbc_oce', wndm(:,:) , 'T', 1. )
[2715]236      !
237   END SUBROUTINE sbc_tau2wnd
238
[888]239   !!======================================================================
240END MODULE sbc_oce
Note: See TracBrowser for help on using the repository browser.