[888] | 1 | MODULE 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) |
---|
[888] | 13 | !!---------------------------------------------------------------------- |
---|
| 14 | |
---|
[2715] | 15 | !!---------------------------------------------------------------------- |
---|
| 16 | !! sbc_oce_alloc : allocation of sbc arrays |
---|
| 17 | !! sbc_tau2wnd : wind speed estimated from wind stress |
---|
| 18 | !!---------------------------------------------------------------------- |
---|
| 19 | USE par_oce ! ocean parameters |
---|
| 20 | USE in_out_manager ! I/O manager |
---|
| 21 | USE lib_mpp ! MPP library |
---|
| 22 | |
---|
[888] | 23 | IMPLICIT NONE |
---|
| 24 | PRIVATE |
---|
[2715] | 25 | |
---|
| 26 | PUBLIC sbc_oce_alloc ! routine called in sbcmod.F90 |
---|
| 27 | PUBLIC sbc_tau2wnd ! routine called in several sbc modules |
---|
[888] | 28 | |
---|
| 29 | !!---------------------------------------------------------------------- |
---|
[1218] | 30 | !! Namelist for the Ocean Surface Boundary Condition |
---|
| 31 | !!---------------------------------------------------------------------- |
---|
[4147] | 32 | ! !!* namsbc namelist * |
---|
[7646] | 33 | LOGICAL , PUBLIC :: ln_usr !: user defined formulation |
---|
[4147] | 34 | LOGICAL , PUBLIC :: ln_flx !: flux formulation |
---|
[7646] | 35 | LOGICAL , PUBLIC :: ln_blk !: bulk formulation |
---|
[4990] | 36 | #if defined key_oasis3 |
---|
[5407] | 37 | LOGICAL , PUBLIC :: lk_oasis = .TRUE. !: OASIS used |
---|
[4990] | 38 | #else |
---|
[5407] | 39 | LOGICAL , PUBLIC :: lk_oasis = .FALSE. !: OASIS unused |
---|
[4990] | 40 | #endif |
---|
[5407] | 41 | LOGICAL , PUBLIC :: ln_cpl !: ocean-atmosphere coupled formulation |
---|
| 42 | LOGICAL , PUBLIC :: ln_mixcpl !: ocean-atmosphere forced-coupled mixed formulation |
---|
[4147] | 43 | LOGICAL , PUBLIC :: ln_dm2dc !: Daily mean to Diurnal Cycle short wave (qsr) |
---|
[4230] | 44 | LOGICAL , PUBLIC :: ln_rnf !: runoffs / runoff mouths |
---|
[6140] | 45 | LOGICAL , PUBLIC :: ln_isf !: ice shelf melting |
---|
[4147] | 46 | LOGICAL , PUBLIC :: ln_ssr !: Sea Surface restoring on SST and/or SSS |
---|
| 47 | LOGICAL , PUBLIC :: ln_apr_dyn !: Atmospheric pressure forcing used on dynamics (ocean & ice) |
---|
| 48 | INTEGER , PUBLIC :: nn_ice !: flag for ice in the surface boundary condition (=0/1/2/3) |
---|
[9019] | 49 | LOGICAL , PUBLIC :: ln_ice_embd !: flag for levitating/embedding sea-ice in the ocean |
---|
| 50 | ! !: =F levitating ice (no presure effect) with mass and salt exchanges |
---|
| 51 | ! !: =T embedded sea-ice (pressure effect + mass and salt exchanges) |
---|
[5407] | 52 | INTEGER , PUBLIC :: nn_components !: flag for sbc module (including sea-ice) coupling mode (see component definition below) |
---|
[4147] | 53 | INTEGER , PUBLIC :: nn_fwb !: FreshWater Budget: |
---|
[1220] | 54 | ! !: = 0 unchecked |
---|
| 55 | ! !: = 1 global mean of e-p-r set to zero at each nn_fsbc time step |
---|
| 56 | ! !: = 2 annual global mean of e-p-r set to zero |
---|
[4147] | 57 | LOGICAL , PUBLIC :: ln_wave !: true if some coupling with wave model |
---|
| 58 | LOGICAL , PUBLIC :: ln_cdgw !: true if neutral drag coefficient from wave model |
---|
| 59 | LOGICAL , PUBLIC :: ln_sdw !: true if 3d stokes drift from wave model |
---|
[9033] | 60 | LOGICAL , PUBLIC :: ln_tauwoc !: true if normalized stress from wave is used |
---|
[9023] | 61 | LOGICAL , PUBLIC :: ln_tauw !: true if ocean stress components from wave is used |
---|
[7646] | 62 | LOGICAL , PUBLIC :: ln_stcor !: true if Stokes-Coriolis term is used |
---|
[4147] | 63 | ! |
---|
[9023] | 64 | INTEGER , PUBLIC :: nn_sdrift ! type of parameterization to calculate vertical Stokes drift |
---|
| 65 | ! |
---|
[4147] | 66 | LOGICAL , PUBLIC :: ln_icebergs !: Icebergs |
---|
[4161] | 67 | ! |
---|
[4990] | 68 | INTEGER , PUBLIC :: nn_lsm !: Number of iteration if seaoverland is applied |
---|
[9019] | 69 | ! |
---|
| 70 | ! !!* namsbc_cpl namelist * |
---|
| 71 | INTEGER , PUBLIC :: nn_cats_cpl !: Number of sea ice categories over which the coupling is carried out |
---|
| 72 | |
---|
[1218] | 73 | !!---------------------------------------------------------------------- |
---|
[4990] | 74 | !! switch definition (improve readability) |
---|
| 75 | !!---------------------------------------------------------------------- |
---|
[7646] | 76 | INTEGER , PUBLIC, PARAMETER :: jp_usr = 1 !: user defined formulation |
---|
[5407] | 77 | INTEGER , PUBLIC, PARAMETER :: jp_flx = 2 !: flux formulation |
---|
[7646] | 78 | INTEGER , PUBLIC, PARAMETER :: jp_blk = 3 !: bulk formulation |
---|
| 79 | INTEGER , PUBLIC, PARAMETER :: jp_purecpl = 4 !: Pure ocean-atmosphere Coupled formulation |
---|
| 80 | INTEGER , PUBLIC, PARAMETER :: jp_none = 5 !: for OPA when doing coupling via SAS module |
---|
[4990] | 81 | |
---|
| 82 | !!---------------------------------------------------------------------- |
---|
[9023] | 83 | !! Stokes drift parametrization definition |
---|
| 84 | !!---------------------------------------------------------------------- |
---|
| 85 | INTEGER , PUBLIC, PARAMETER :: jp_breivik = 0 ! Breivik 2015: v_z=v_0*[exp(2*k*z)/(1-8*k*z)] |
---|
| 86 | INTEGER , PUBLIC, PARAMETER :: jp_phillips = 1 ! Phillips: v_z=v_o*[exp(2*k*z)-beta*sqrt(-2*k*pi*z)*erfc(sqrt(-2*k*z))] |
---|
| 87 | INTEGER , PUBLIC, PARAMETER :: jp_peakfr = 2 ! Phillips using the peak wave number read from wave model instead of the inverse depth scale |
---|
| 88 | |
---|
| 89 | !!---------------------------------------------------------------------- |
---|
[5407] | 90 | !! component definition |
---|
| 91 | !!---------------------------------------------------------------------- |
---|
| 92 | INTEGER , PUBLIC, PARAMETER :: jp_iam_nemo = 0 !: Initial single executable configuration |
---|
| 93 | ! (no internal OASIS coupling) |
---|
| 94 | INTEGER , PUBLIC, PARAMETER :: jp_iam_opa = 1 !: Multi executable configuration - OPA component |
---|
| 95 | ! (internal OASIS coupling) |
---|
| 96 | INTEGER , PUBLIC, PARAMETER :: jp_iam_sas = 2 !: Multi executable configuration - SAS component |
---|
| 97 | ! (internal OASIS coupling) |
---|
| 98 | !!---------------------------------------------------------------------- |
---|
[888] | 99 | !! Ocean Surface Boundary Condition fields |
---|
| 100 | !!---------------------------------------------------------------------- |
---|
[5385] | 101 | INTEGER , PUBLIC :: ncpl_qsr_freq !: qsr coupling frequency per days from atmosphere |
---|
| 102 | ! |
---|
[2528] | 103 | LOGICAL , PUBLIC :: lhftau = .FALSE. !: HF tau used in TKE: mean(stress module) - module(mean stress) |
---|
| 104 | !! !! now ! before !! |
---|
[2715] | 105 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: utau , utau_b !: sea surface i-stress (ocean referential) [N/m2] |
---|
| 106 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vtau , vtau_b !: sea surface j-stress (ocean referential) [N/m2] |
---|
| 107 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: taum !: module of sea surface stress (at T-point) [N/m2] |
---|
| 108 | !! wndm is used onmpute surface gases exchanges in ice-free ocean or leads |
---|
| 109 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: wndm !: wind speed module at T-point (=|U10m-Uoce|) [m/s] |
---|
| 110 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qsr !: sea heat flux: solar [W/m2] |
---|
| 111 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qns , qns_b !: sea heat flux: non solar [W/m2] |
---|
| 112 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qsr_tot !: total solar heat flux (over sea and ice) [W/m2] |
---|
| 113 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qns_tot !: total non solar heat flux (over sea and ice) [W/m2] |
---|
| 114 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp , emp_b !: freshwater budget: volume flux [Kg/m2/s] |
---|
[3625] | 115 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sfx , sfx_b !: salt flux [PSU/m2/s] |
---|
[2715] | 116 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_tot !: total E-P over ocean and ice [Kg/m2/s] |
---|
[4148] | 117 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fmmflx !: freshwater budget: freezing/melting [Kg/m2/s] |
---|
[5120] | 118 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rnf , rnf_b !: river runoff [Kg/m2/s] |
---|
| 119 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fwfisf , fwfisf_b !: ice shelf melting [Kg/m2/s] |
---|
[7788] | 120 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fwficb , fwficb_b !: iceberg melting [Kg/m2/s] |
---|
| 121 | |
---|
[2528] | 122 | !! |
---|
[2715] | 123 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: sbc_tsc, sbc_tsc_b !: sbc content trend [K.m/s] jpi,jpj,jpts |
---|
| 124 | 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] | 125 | !! |
---|
[4161] | 126 | !! |
---|
[2715] | 127 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tprecip !: total precipitation [Kg/m2/s] |
---|
| 128 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sprecip !: solid precipitation [Kg/m2/s] |
---|
| 129 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr_i !: ice fraction = 1 - lead fraction (between 0 to 1) |
---|
| 130 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: atm_co2 !: atmospheric pCO2 [ppm] |
---|
[5407] | 131 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xcplmask !: coupling mask for ln_mixcpl (warning: allocated in sbccpl) |
---|
[888] | 132 | |
---|
| 133 | !!---------------------------------------------------------------------- |
---|
| 134 | !! Sea Surface Mean fields |
---|
| 135 | !!---------------------------------------------------------------------- |
---|
| 136 | INTEGER , PUBLIC :: nn_fsbc !: frequency of sbc computation (as well as sea-ice model) |
---|
[2715] | 137 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ssu_m !: mean (nn_fsbc time-step) surface sea i-current (U-point) [m/s] |
---|
| 138 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ssv_m !: mean (nn_fsbc time-step) surface sea j-current (V-point) [m/s] |
---|
| 139 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sst_m !: mean (nn_fsbc time-step) surface sea temperature [Celsius] |
---|
| 140 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sss_m !: mean (nn_fsbc time-step) surface sea salinity [psu] |
---|
| 141 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ssh_m !: mean (nn_fsbc time-step) sea surface height [m] |
---|
[4990] | 142 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: e3t_m !: mean (nn_fsbc time-step) sea surface layer thickness [m] |
---|
[5407] | 143 | 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] | 144 | |
---|
[2715] | 145 | !! * Substitutions |
---|
| 146 | # include "vectopt_loop_substitute.h90" |
---|
[888] | 147 | !!---------------------------------------------------------------------- |
---|
[2715] | 148 | !! NEMO/OPA 4.0 , NEMO Consortium (2011) |
---|
[2528] | 149 | !! $Id$ |
---|
| 150 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[2715] | 151 | !!---------------------------------------------------------------------- |
---|
| 152 | CONTAINS |
---|
| 153 | |
---|
| 154 | INTEGER FUNCTION sbc_oce_alloc() |
---|
| 155 | !!--------------------------------------------------------------------- |
---|
| 156 | !! *** FUNCTION sbc_oce_alloc *** |
---|
| 157 | !!--------------------------------------------------------------------- |
---|
[4292] | 158 | INTEGER :: ierr(5) |
---|
[2715] | 159 | !!--------------------------------------------------------------------- |
---|
| 160 | ierr(:) = 0 |
---|
| 161 | ! |
---|
| 162 | ALLOCATE( utau(jpi,jpj) , utau_b(jpi,jpj) , taum(jpi,jpj) , & |
---|
| 163 | & vtau(jpi,jpj) , vtau_b(jpi,jpj) , wndm(jpi,jpj) , STAT=ierr(1) ) |
---|
| 164 | ! |
---|
[3625] | 165 | ALLOCATE( qns_tot(jpi,jpj) , qns (jpi,jpj) , qns_b(jpi,jpj), & |
---|
| 166 | & qsr_tot(jpi,jpj) , qsr (jpi,jpj) , & |
---|
| 167 | & emp (jpi,jpj) , emp_b(jpi,jpj) , & |
---|
[4148] | 168 | & sfx (jpi,jpj) , sfx_b(jpi,jpj) , emp_tot(jpi,jpj), fmmflx(jpi,jpj), STAT=ierr(2) ) |
---|
[2715] | 169 | ! |
---|
[7788] | 170 | ALLOCATE( fwfisf (jpi,jpj), rnf (jpi,jpj) , sbc_tsc (jpi,jpj,jpts) , qsr_hc (jpi,jpj,jpk) , & |
---|
| 171 | & fwfisf_b(jpi,jpj), rnf_b(jpi,jpj) , sbc_tsc_b(jpi,jpj,jpts) , qsr_hc_b(jpi,jpj,jpk) , & |
---|
| 172 | & fwficb (jpi,jpj), fwficb_b(jpi,jpj), STAT=ierr(3) ) |
---|
[2715] | 173 | ! |
---|
| 174 | ALLOCATE( tprecip(jpi,jpj) , sprecip(jpi,jpj) , fr_i(jpi,jpj) , & |
---|
| 175 | & atm_co2(jpi,jpj) , & |
---|
[5407] | 176 | & ssu_m (jpi,jpj) , sst_m(jpi,jpj) , frq_m(jpi,jpj) , & |
---|
| 177 | & ssv_m (jpi,jpj) , sss_m(jpi,jpj) , ssh_m(jpi,jpj) , STAT=ierr(4) ) |
---|
[2715] | 178 | ! |
---|
[4292] | 179 | ALLOCATE( e3t_m(jpi,jpj) , STAT=ierr(5) ) |
---|
| 180 | ! |
---|
[2715] | 181 | sbc_oce_alloc = MAXVAL( ierr ) |
---|
| 182 | IF( lk_mpp ) CALL mpp_sum ( sbc_oce_alloc ) |
---|
| 183 | IF( sbc_oce_alloc > 0 ) CALL ctl_warn('sbc_oce_alloc: allocation of arrays failed') |
---|
| 184 | ! |
---|
| 185 | END FUNCTION sbc_oce_alloc |
---|
| 186 | |
---|
| 187 | |
---|
| 188 | SUBROUTINE sbc_tau2wnd |
---|
| 189 | !!--------------------------------------------------------------------- |
---|
| 190 | !! *** ROUTINE sbc_tau2wnd *** |
---|
| 191 | !! |
---|
| 192 | !! ** Purpose : Estimation of wind speed as a function of wind stress |
---|
| 193 | !! |
---|
| 194 | !! ** Method : |tau|=rhoa*Cd*|U|^2 |
---|
| 195 | !!--------------------------------------------------------------------- |
---|
| 196 | USE dom_oce ! ocean space and time domain |
---|
| 197 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 198 | REAL(wp) :: zrhoa = 1.22 ! Air density kg/m3 |
---|
| 199 | REAL(wp) :: zcdrag = 1.5e-3 ! drag coefficient |
---|
| 200 | REAL(wp) :: ztx, zty, ztau, zcoef ! temporary variables |
---|
| 201 | INTEGER :: ji, jj ! dummy indices |
---|
| 202 | !!--------------------------------------------------------------------- |
---|
| 203 | zcoef = 0.5 / ( zrhoa * zcdrag ) |
---|
| 204 | DO jj = 2, jpjm1 |
---|
| 205 | DO ji = fs_2, fs_jpim1 ! vect. opt. |
---|
| 206 | ztx = utau(ji-1,jj ) + utau(ji,jj) |
---|
| 207 | zty = vtau(ji ,jj-1) + vtau(ji,jj) |
---|
| 208 | ztau = SQRT( ztx * ztx + zty * zty ) |
---|
| 209 | wndm(ji,jj) = SQRT ( ztau * zcoef ) * tmask(ji,jj,1) |
---|
| 210 | END DO |
---|
| 211 | END DO |
---|
| 212 | CALL lbc_lnk( wndm(:,:) , 'T', 1. ) |
---|
| 213 | ! |
---|
| 214 | END SUBROUTINE sbc_tau2wnd |
---|
| 215 | |
---|
[888] | 216 | !!====================================================================== |
---|
| 217 | END MODULE sbc_oce |
---|