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 5329 – NEMO

Changeset 5329


Ignore:
Timestamp:
2015-06-01T15:11:25+02:00 (9 years ago)
Author:
pabouttier
Message:

Add stochastic parametrization of EOS

Location:
trunk/NEMOGCM
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/CONFIG/SHARED/namelist_ref

    r5321 r5329  
    1010!!              7 - dynamics         (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf) 
    1111!!              8 - Verical physics  (namzdf, namzdf_ric, namzdf_tke, namzdf_kpp, namzdf_ddm, namzdf_tmx) 
    12 !!              9 - diagnostics      (namnc4, namtrd, namspr, namflo, namhsb) 
     12!!              9 - diagnostics      (namnc4, namtrd, namspr, namflo, namhsb, namsto) 
    1313!!             10 - miscellaneous    (namsol, nammpp, namctl) 
    1414!!             11 - Obs & Assim      (namobs, nam_asminc) 
     
    5050!!                      ***  Domain namelists  *** 
    5151!!====================================================================== 
    52 !!   namcfg       parameters of the configuration       
     52!!   namcfg       parameters of the configuration 
    5353!!   namzgr       vertical coordinate 
    5454!!   namzgr_sco   s-coordinate or hybrid z-s-coordinate 
     
    5858! 
    5959!----------------------------------------------------------------------- 
    60 &namcfg     !   parameters of the configuration       
     60&namcfg     !   parameters of the configuration 
    6161!----------------------------------------------------------------------- 
    6262   cp_cfg      =  "default"            !  name of the configuration 
     
    7272   jperio      =       0               !  lateral cond. type (between 0 and 6) 
    7373                                       !  = 0 closed                 ;   = 1 cyclic East-West 
    74                                        !  = 2 equatorial symmetric   ;   = 3 North fold T-point pivot  
     74                                       !  = 2 equatorial symmetric   ;   = 3 North fold T-point pivot 
    7575                                       !  = 4 cyclic East-West AND North fold T-point pivot 
    7676                                       !  = 5 North fold F-point pivot 
    7777                                       !  = 6 cyclic East-West AND North fold F-point pivot 
    78    ln_use_jattr = .false.              !  use (T) the file attribute: open_ocean_jstart, if present  
     78   ln_use_jattr = .false.              !  use (T) the file attribute: open_ocean_jstart, if present 
    7979                                       !  in netcdf input files, as the start j-row for reading 
    8080/ 
     
    101101                        !!!!!!!  SH94 stretching coefficients  (ln_s_sh94 = .true.) 
    102102   rn_theta    =    6.0    !  surface control parameter (0<=theta<=20) 
    103    rn_bb       =    0.8    !  stretching with SH94 s-sigma    
     103   rn_bb       =    0.8    !  stretching with SH94 s-sigma 
    104104                        !!!!!!!  SF12 stretching coefficient  (ln_s_sf12 = .true.) 
    105105   rn_alpha    =    4.4    !  stretching with SF12 s-sigma 
     
    110110   rn_zb_b     =   -0.2    !  offset for calculating Zb 
    111111                        !!!!!!!! Other stretching (not SH94 or SF12) [also uses rn_theta above] 
    112    rn_thetb    =    1.0    !  bottom control parameter  (0<=thetb<= 1)  
     112   rn_thetb    =    1.0    !  bottom control parameter  (0<=thetb<= 1) 
    113113/ 
    114114!----------------------------------------------------------------------- 
     
    164164   nn_baro       =    30               !  Number of iterations of barotropic mode 
    165165                                       !  during rn_rdt seconds. Only used if ln_bt_nn_auto=F 
    166    rn_bt_cmax    =    0.8              !  Maximum courant number allowed if ln_bt_nn_auto=T  
     166   rn_bt_cmax    =    0.8              !  Maximum courant number allowed if ln_bt_nn_auto=T 
    167167   nn_bt_flt     =    1                !  Time filter choice 
    168168                                       !  = 0 None 
    169169                                       !  = 1 Boxcar over   nn_baro barotropic steps 
    170                                        !  = 2 Boxcar over 2*nn_baro     "        "   
     170                                       !  = 2 Boxcar over 2*nn_baro     "        " 
    171171/ 
    172172!----------------------------------------------------------------------- 
     
    245245   ln_rnf      = .true.    !  runoffs                                   (T   => fill namsbc_rnf) 
    246246   nn_isf      = 0         !  ice shelf melting/freezing                (/=0 => fill namsbc_isf) 
    247                            !  0 =no isf                  1 = presence of ISF  
    248                            !  2 = bg03 parametrisation   3 = rnf file for isf    
     247                           !  0 =no isf                  1 = presence of ISF 
     248                           !  2 = bg03 parametrisation   3 = rnf file for isf 
    249249                           !  4 = ISF fwf specified 
    250250                           !  option 1 and 4 need ln_isfcav = .true. (domzgr) 
     
    277277&namsbc_flx    !   surface boundary condition : flux formulation 
    278278!----------------------------------------------------------------------- 
    279 !              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !  
     279!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    280280!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    281281   sn_utau     = 'utau'      ,        24         , 'utau'    , .false.      , .false., 'yearly'  , ''       , ''       , '' 
     
    320320   ln_taudif   = .false.   !  HF tau contribution: use "mean of stress module - module of the mean stress" data 
    321321   rn_zqt      = 10.        !  Air temperature and humidity reference height (m) 
    322    rn_zu       = 10.        !  Wind vector reference height (m)                  
     322   rn_zu       = 10.        !  Wind vector reference height (m) 
    323323   rn_pfac     = 1.        !  multiplicative factor for precipitation (total & snow) 
    324324   rn_efac     = 1.        !  multiplicative factor for evaporation (0. or 1.) 
    325    rn_vfac     = 0.        !  multiplicative factor for ocean/ice velocity  
     325   rn_vfac     = 0.        !  multiplicative factor for ocean/ice velocity 
    326326                           !  in the calculation of the wind stress (0.=absolute winds or 1.=relative winds) 
    327327/ 
     
    373373!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    374374!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    375    sn_usp      = 'sas_grid_U' ,    120           , 'vozocrtx' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , ''       
     375   sn_usp      = 'sas_grid_U' ,    120           , 'vozocrtx' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
    376376   sn_vsp      = 'sas_grid_V' ,    120           , 'vomecrty' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
    377377   sn_tem      = 'sas_grid_T' ,    120           , 'sosstsst' ,  .true.    , .true. ,   'yearly'  , ''       , ''             , '' 
     
    422422/ 
    423423!----------------------------------------------------------------------- 
    424 &namsbc_isf    !  Top boundary layer (ISF)  
     424&namsbc_isf    !  Top boundary layer (ISF) 
    425425!----------------------------------------------------------------------- 
    426426!              ! file name ! frequency (hours) ! variable ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation ! 
     
    499499                                                      ! Initial mass required for an iceberg of each class 
    500500      rn_initial_mass          = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11 
    501                                                       ! Proportion of calving mass to apportion to each class   
     501                                                      ! Proportion of calving mass to apportion to each class 
    502502      rn_distribution          = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02 
    503503                                                      ! Ratio between effective and real iceberg mass (non-dim) 
    504                                                       ! i.e. number of icebergs represented at a point          
     504                                                      ! i.e. number of icebergs represented at a point 
    505505      rn_mass_scaling          = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1 
    506506                                                      ! thickness of newly calved bergs (m) 
     
    511511      rn_bits_erosion_fraction = 0.                   ! Fraction of erosion melt flux to divert to bergy bits 
    512512      rn_sicn_shift            = 0.                   ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1) 
    513       ln_passive_mode          = .false.              ! iceberg - ocean decoupling    
     513      ln_passive_mode          = .false.              ! iceberg - ocean decoupling 
    514514      nn_test_icebergs         =  10                  ! Create test icebergs of this class (-1 = no) 
    515515                                                      ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2) 
    516516      rn_test_box              = 108.0,  116.0, -66.0, -58.0 
    517       rn_speed_limit           = 0.                   ! CFL speed limit for a berg    
     517      rn_speed_limit           = 0.                   ! CFL speed limit for a berg 
    518518 
    519519!              ! file name ! frequency (hours) !   variable   ! time interp.   !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    520520!              !           !  (if <0  months)  !     name     !   (logical)    !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      ! 
    521521      sn_icb =  'calving' ,       -1           , 'calvingmask',  .true.        , .true.  , 'yearly'  , ''       , ''       , '' 
    522     
    523       cn_dir = './'  
     522 
     523      cn_dir = './' 
    524524/ 
    525525 
     
    597597                                          !  = 2, use tidal harmonic forcing data from files 
    598598                                          !  = 3, use external data AND tidal harmonic forcing 
    599     cn_dyn3d      =  'none'               !   
     599    cn_dyn3d      =  'none'               ! 
    600600    nn_dyn3d_dta  =  0                    !  = 0, bdy data are equal to the initial state 
    601601                                          !  = 1, bdy data are read in 'bdydata   .nc' files 
    602     cn_tra        =  'none'               !  
     602    cn_tra        =  'none'               ! 
    603603    nn_tra_dta    =  0                    !  = 0, bdy data are equal to the initial state 
    604604                                          !  = 1, bdy data are read in 'bdydata   .nc' files 
    605     cn_ice_lim      =  'none'             !   
     605    cn_ice_lim      =  'none'             ! 
    606606    nn_ice_lim_dta  =  0                  !  = 0, bdy data are equal to the initial state 
    607607                                          !  = 1, bdy data are read in 'bdydata   .nc' files 
     
    612612    ln_tra_dmp    =.false.                !  open boudaries conditions for tracers 
    613613    ln_dyn3d_dmp  =.false.                !  open boundary condition for baroclinic velocities 
    614     rn_time_dmp   =  1.                   ! Damping time scale in days  
     614    rn_time_dmp   =  1.                   ! Damping time scale in days 
    615615    rn_time_dmp_out =  1.                 ! Outflow damping time scale 
    616616    nn_rimwidth   = 10                    !  width of the relaxation zone 
     
    665665   rn_bfri2_max =   1.e-1  !  max. bottom drag coefficient (non linear case and ln_loglayer=T) 
    666666   rn_bfeb2    =    2.5e-3 !  bottom turbulent kinetic energy background  (m2/s2) 
    667    rn_bfrz0    =    3.e-3  !  bottom roughness [m] if ln_loglayer=T  
     667   rn_bfrz0    =    3.e-3  !  bottom roughness [m] if ln_loglayer=T 
    668668   ln_bfr2d    = .false.   !  horizontal variation of the bottom friction coef (read a 2D mask file ) 
    669669   rn_bfrien   =    50.    !  local multiplying factor of bfr (ln_bfr2d=T) 
     
    711711!----------------------------------------------------------------------- 
    712712   nn_eos      =  -1     !  type of equation of state and Brunt-Vaisala frequency 
    713                                  !  =-1, TEOS-10  
    714                                  !  = 0, EOS-80  
     713                                 !  =-1, TEOS-10 
     714                                 !  = 0, EOS-80 
    715715                                 !  = 1, S-EOS   (simplified eos) 
    716716   ln_useCT    = .true.  ! use of Conservative Temp. ==> surface CT converted in Pot. Temp. in sbcssm 
     
    811811&nam_vvl    !   vertical coordinate options 
    812812!----------------------------------------------------------------------- 
    813    ln_vvl_zstar  = .true.           !  zstar vertical coordinate                    
     813   ln_vvl_zstar  = .true.           !  zstar vertical coordinate 
    814814   ln_vvl_ztilde = .false.          !  ztilde vertical coordinate: only high frequency variations 
    815815   ln_vvl_layer  = .false.          !  full layer vertical coordinate 
     
    996996!!   namc1d_uvd        data: U & V currents                             ("key_c1d") 
    997997!!   namc1d_dyndmp     U & V newtonian damping                          ("key_c1d") 
     998!!   namsto            Stochastic parametrization of EOS 
    998999!!====================================================================== 
    9991000! 
     
    10541055   ln_dyndmp   =  .false.  !  add a damping term (T) or not (F) 
    10551056/ 
     1057!----------------------------------------------------------------------- 
     1058&namsto       ! Stochastic parametrization of EOS 
     1059!----------------------------------------------------------------------- 
     1060   ln_rststo = .false.           ! start from mean parameter (F) or from restart file (T) 
     1061   ln_rstseed = .true.           ! read seed of RNG from restart file 
     1062   cn_storst_in  = "restart_sto" !  suffix of stochastic parameter restart file (input) 
     1063   cn_storst_out = "restart_sto" !  suffix of stochastic parameter restart file (output) 
     1064 
     1065   ln_sto_eos = .false.          ! stochastic equation of state 
     1066   nn_sto_eos = 1                ! number of independent random walks 
     1067   rn_eos_stdxy = 1.4            ! random walk horz. standard deviation (in grid points) 
     1068   rn_eos_stdz  = 0.7            ! random walk vert. standard deviation (in grid points) 
     1069   rn_eos_tcor  = 1440.0         ! random walk time correlation (in timesteps) 
     1070   nn_eos_ord  = 1               ! order of autoregressive processes 
     1071   nn_eos_flt  = 0               ! passes of Laplacian filter 
     1072   rn_eos_lim  = 2.0             ! limitation factor (default = 3.0) 
     1073/ 
    10561074 
    10571075!!====================================================================== 
     
    11651183   ln_sst     = .false.     ! Logical switch for SST observations 
    11661184   ln_reysst  = .false.     !     ln_reysst               Logical switch for Reynolds observations 
    1167    ln_ghrsst  = .false.    !     ln_ghrsst               Logical switch for GHRSST observations       
     1185   ln_ghrsst  = .false.    !     ln_ghrsst               Logical switch for GHRSST observations 
    11681186 
    11691187   ln_sstfb   = .false.    ! Logical switch for feedback SST data 
     
    11921210   sstfbfiles = 'sst_01.nc' 
    11931211                           !     seaicefiles             Sea Ice input observation file names 
    1194    seaicefiles = 'seaice_01.nc'   
     1212   seaicefiles = 'seaice_01.nc' 
    11951213                           !     velavcurfiles           Vel. cur. daily av. input file name 
    11961214                           !     velhvcurfiles           Vel. cur. high freq. input file name 
  • trunk/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90

    r5147 r5329  
    4747   USE lbclnk         ! ocean lateral boundary conditions 
    4848   USE timing          ! Timing 
     49   USE stopar          ! Stochastic T/S fluctuations 
     50   USE stopts          ! Stochastic T/S fluctuations 
    4951 
    5052   IMPLICIT NONE 
     
    313315      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pdep   ! depth                      [m] 
    314316      ! 
    315       INTEGER  ::   ji, jj, jk                ! dummy loop indices 
    316       REAL(wp) ::   zt , zh , zs , ztm        ! local scalars 
    317       REAL(wp) ::   zn , zn0, zn1, zn2, zn3   !   -      - 
     317      INTEGER  ::   ji, jj, jk, jsmp             ! dummy loop indices 
     318      INTEGER  ::   jdof 
     319      REAL(wp) ::   zt , zh , zstemp, zs , ztm   ! local scalars 
     320      REAL(wp) ::   zn , zn0, zn1, zn2, zn3      !   -      - 
     321      REAL(wp), DIMENSION(:), ALLOCATABLE :: zn0_sto, zn_sto, zsign    ! local vectors 
    318322      !!---------------------------------------------------------------------- 
    319323      ! 
     
    324328      CASE( -1, 0 )                !==  polynomial TEOS-10 / EOS-80 ==! 
    325329         ! 
    326          DO jk = 1, jpkm1 
    327             DO jj = 1, jpj 
    328                DO ji = 1, jpi 
    329                   ! 
    330                   zh  = pdep(ji,jj,jk) * r1_Z0                                  ! depth 
    331                   zt  = pts (ji,jj,jk,jp_tem) * r1_T0                           ! temperature 
    332                   zs  = SQRT( ABS( pts(ji,jj,jk,jp_sal) + rdeltaS ) * r1_S0 )   ! square root salinity 
    333                   ztm = tmask(ji,jj,jk)                                         ! tmask 
    334                   ! 
    335                   zn3 = EOS013*zt   & 
    336                      &   + EOS103*zs+EOS003 
    337                      ! 
    338                   zn2 = (EOS022*zt   & 
    339                      &   + EOS112*zs+EOS012)*zt   & 
    340                      &   + (EOS202*zs+EOS102)*zs+EOS002 
    341                      ! 
    342                   zn1 = (((EOS041*zt   & 
    343                      &   + EOS131*zs+EOS031)*zt   & 
    344                      &   + (EOS221*zs+EOS121)*zs+EOS021)*zt   & 
    345                      &   + ((EOS311*zs+EOS211)*zs+EOS111)*zs+EOS011)*zt   & 
    346                      &   + (((EOS401*zs+EOS301)*zs+EOS201)*zs+EOS101)*zs+EOS001 
    347                      ! 
    348                   zn0 = (((((EOS060*zt   & 
    349                      &   + EOS150*zs+EOS050)*zt   & 
    350                      &   + (EOS240*zs+EOS140)*zs+EOS040)*zt   & 
    351                      &   + ((EOS330*zs+EOS230)*zs+EOS130)*zs+EOS030)*zt   & 
    352                      &   + (((EOS420*zs+EOS320)*zs+EOS220)*zs+EOS120)*zs+EOS020)*zt   & 
    353                      &   + ((((EOS510*zs+EOS410)*zs+EOS310)*zs+EOS210)*zs+EOS110)*zs+EOS010)*zt   & 
    354                      &   + (((((EOS600*zs+EOS500)*zs+EOS400)*zs+EOS300)*zs+EOS200)*zs+EOS100)*zs+EOS000 
    355                      ! 
    356                   zn  = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0 
    357                   ! 
    358                   prhop(ji,jj,jk) = zn0 * ztm                           ! potential density referenced at the surface 
    359                   ! 
    360                   prd(ji,jj,jk) = (  zn * r1_rau0 - 1._wp  ) * ztm      ! density anomaly (masked) 
     330         ! Stochastic equation of state 
     331         IF ( ln_sto_eos ) THEN 
     332            ALLOCATE(zn0_sto(1:2*nn_sto_eos)) 
     333            ALLOCATE(zn_sto(1:2*nn_sto_eos)) 
     334            ALLOCATE(zsign(1:2*nn_sto_eos)) 
     335            DO jsmp = 1, 2*nn_sto_eos, 2 
     336              zsign(jsmp)   = 1._wp 
     337              zsign(jsmp+1) = -1._wp 
     338            END DO 
     339            ! 
     340            DO jk = 1, jpkm1 
     341               DO jj = 1, jpj 
     342                  DO ji = 1, jpi 
     343                     ! 
     344                     ! compute density (2*nn_sto_eos) times: 
     345                     ! (1) for t+dt, s+ds (with the random TS fluctutation computed in sto_pts) 
     346                     ! (2) for t-dt, s-ds (with the opposite fluctuation) 
     347                     DO jsmp = 1, nn_sto_eos*2 
     348                        jdof   = (jsmp + 1) / 2 
     349                        zh     = pdep(ji,jj,jk) * r1_Z0                                  ! depth 
     350                        zt     = (pts (ji,jj,jk,jp_tem) + pts_ran(ji,jj,jk,jp_tem,jdof) * zsign(jsmp)) * r1_T0    ! temperature 
     351                        zstemp = pts  (ji,jj,jk,jp_sal) + pts_ran(ji,jj,jk,jp_sal,jdof) * zsign(jsmp) 
     352                        zs     = SQRT( ABS( zstemp + rdeltaS ) * r1_S0 )   ! square root salinity 
     353                        ztm    = tmask(ji,jj,jk)                                         ! tmask 
     354                        ! 
     355                        zn3 = EOS013*zt   & 
     356                           &   + EOS103*zs+EOS003 
     357                           ! 
     358                        zn2 = (EOS022*zt   & 
     359                           &   + EOS112*zs+EOS012)*zt   & 
     360                           &   + (EOS202*zs+EOS102)*zs+EOS002 
     361                           ! 
     362                        zn1 = (((EOS041*zt   & 
     363                           &   + EOS131*zs+EOS031)*zt   & 
     364                           &   + (EOS221*zs+EOS121)*zs+EOS021)*zt   & 
     365                           &   + ((EOS311*zs+EOS211)*zs+EOS111)*zs+EOS011)*zt   & 
     366                           &   + (((EOS401*zs+EOS301)*zs+EOS201)*zs+EOS101)*zs+EOS001 
     367                           ! 
     368                        zn0_sto(jsmp) = (((((EOS060*zt   & 
     369                           &   + EOS150*zs+EOS050)*zt   & 
     370                           &   + (EOS240*zs+EOS140)*zs+EOS040)*zt   & 
     371                           &   + ((EOS330*zs+EOS230)*zs+EOS130)*zs+EOS030)*zt   & 
     372                           &   + (((EOS420*zs+EOS320)*zs+EOS220)*zs+EOS120)*zs+EOS020)*zt   & 
     373                           &   + ((((EOS510*zs+EOS410)*zs+EOS310)*zs+EOS210)*zs+EOS110)*zs+EOS010)*zt   & 
     374                           &   + (((((EOS600*zs+EOS500)*zs+EOS400)*zs+EOS300)*zs+EOS200)*zs+EOS100)*zs+EOS000 
     375                           ! 
     376                        zn_sto(jsmp)  = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0_sto(jsmp) 
     377                     END DO 
     378                     ! 
     379                     ! compute stochastic density as the mean of the (2*nn_sto_eos) densities 
     380                     prhop(ji,jj,jk) = 0._wp ; prd(ji,jj,jk) = 0._wp 
     381                     DO jsmp = 1, nn_sto_eos*2 
     382                        prhop(ji,jj,jk) = prhop(ji,jj,jk) + zn0_sto(jsmp)                      ! potential density referenced at the surface 
     383                        ! 
     384                        prd(ji,jj,jk) = prd(ji,jj,jk) + (  zn_sto(jsmp) * r1_rau0 - 1._wp  )   ! density anomaly (masked) 
     385                     END DO 
     386                     prhop(ji,jj,jk) = 0.5_wp * prhop(ji,jj,jk) * ztm / nn_sto_eos 
     387                     prd  (ji,jj,jk) = 0.5_wp * prd  (ji,jj,jk) * ztm / nn_sto_eos 
     388                  END DO 
    361389               END DO 
    362390            END DO 
    363          END DO 
    364          ! 
     391            DEALLOCATE(zn0_sto,zn_sto,zsign) 
     392         ! Non-stochastic equation of state 
     393         ELSE 
     394            DO jk = 1, jpkm1 
     395               DO jj = 1, jpj 
     396                  DO ji = 1, jpi 
     397                     ! 
     398                     zh  = pdep(ji,jj,jk) * r1_Z0                                  ! depth 
     399                     zt  = pts (ji,jj,jk,jp_tem) * r1_T0                           ! temperature 
     400                     zs  = SQRT( ABS( pts(ji,jj,jk,jp_sal) + rdeltaS ) * r1_S0 )   ! square root salinity 
     401                     ztm = tmask(ji,jj,jk)                                         ! tmask 
     402                     ! 
     403                     zn3 = EOS013*zt   & 
     404                        &   + EOS103*zs+EOS003 
     405                        ! 
     406                     zn2 = (EOS022*zt   & 
     407                        &   + EOS112*zs+EOS012)*zt   & 
     408                        &   + (EOS202*zs+EOS102)*zs+EOS002 
     409                        ! 
     410                     zn1 = (((EOS041*zt   & 
     411                        &   + EOS131*zs+EOS031)*zt   & 
     412                        &   + (EOS221*zs+EOS121)*zs+EOS021)*zt   & 
     413                        &   + ((EOS311*zs+EOS211)*zs+EOS111)*zs+EOS011)*zt   & 
     414                        &   + (((EOS401*zs+EOS301)*zs+EOS201)*zs+EOS101)*zs+EOS001 
     415                        ! 
     416                     zn0 = (((((EOS060*zt   & 
     417                        &   + EOS150*zs+EOS050)*zt   & 
     418                        &   + (EOS240*zs+EOS140)*zs+EOS040)*zt   & 
     419                        &   + ((EOS330*zs+EOS230)*zs+EOS130)*zs+EOS030)*zt   & 
     420                        &   + (((EOS420*zs+EOS320)*zs+EOS220)*zs+EOS120)*zs+EOS020)*zt   & 
     421                        &   + ((((EOS510*zs+EOS410)*zs+EOS310)*zs+EOS210)*zs+EOS110)*zs+EOS010)*zt   & 
     422                        &   + (((((EOS600*zs+EOS500)*zs+EOS400)*zs+EOS300)*zs+EOS200)*zs+EOS100)*zs+EOS000 
     423                        ! 
     424                     zn  = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0 
     425                     ! 
     426                     prhop(ji,jj,jk) = zn0 * ztm                           ! potential density referenced at the surface 
     427                     ! 
     428                     prd(ji,jj,jk) = (  zn * r1_rau0 - 1._wp  ) * ztm      ! density anomaly (masked) 
     429                  END DO 
     430               END DO 
     431            END DO 
     432         ENDIF 
     433          
    365434      CASE( 1 )                !==  simplified EOS  ==! 
    366435         ! 
  • trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r5123 r5329  
    8282   USE crsini          ! initialise grid coarsening utility 
    8383   USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges  
     84   USE stopar 
     85   USE stopts 
    8486 
    8587   IMPLICIT NONE 
     
    432434      IF( nn_cla == 1 .AND. cp_cfg == 'orca' .AND. jp_cfg == 2 )   CALL cla_init       ! Cross Land Advection 
    433435                            CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
     436                            CALL sto_par_init   ! Stochastic parametrization 
     437      IF( ln_sto_eos     )  CALL sto_pts_init   ! RRandom T/S fluctuations 
    434438      
    435439#if defined key_top 
  • trunk/NEMOGCM/NEMO/OPA_SRC/step.F90

    r5147 r5329  
    106106 
    107107      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     108      ! Update stochastic parameters and random T/S fluctuations 
     109      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     110                        CALL sto_par( kstp )          ! Stochastic parameters 
     111 
     112      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    108113      ! Ocean physics update                (ua, va, tsa used as workspace) 
    109114      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     
    145150      ! 
    146151      IF( lk_ldfslp ) THEN                            ! slope of lateral mixing 
     152         IF(ln_sto_eos ) CALL sto_pts( tsn )          ! Random T/S fluctuations 
    147153                         CALL eos( tsb, rhd, gdept_0(:,:,:) )               ! before in situ density 
    148154         IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
     
    180186          ! Note that the computation of vertical velocity above, hence "after" sea level 
    181187          ! is necessary to compute momentum advection for the rhs of barotropic loop: 
     188            IF(ln_sto_eos ) CALL sto_pts( tsn )                             ! Random T/S fluctuations 
    182189                            CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation 
    183190            IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
     
    261268         IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection 
    262269                             CALL tra_nxt( kstp )                ! tracer fields at next time step 
     270            IF( ln_sto_eos ) CALL sto_pts( tsn )                 ! Random T/S fluctuations 
    263271                             CALL eos    ( tsa, rhd, rhop, fsdept_n(:,:,:) )  ! Time-filtered in situ density for hpg computation 
    264272            IF( ln_zps .AND. .NOT. ln_isfcav)                                & 
     
    271279      ELSE                                                  ! centered hpg  (eos then time stepping) 
    272280         IF ( .NOT. lk_dynspg_ts ) THEN                     ! eos already called in time-split case 
     281            IF( ln_sto_eos ) CALL sto_pts( tsn )    ! Random T/S fluctuations 
    273282                             CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )  ! now in situ density for hpg computation 
    274283         IF( ln_zps .AND. .NOT. ln_isfcav)                                   & 
  • trunk/NEMOGCM/NEMO/OPA_SRC/step_oce.F90

    r4990 r5329  
    5353 
    5454   USE dynnxt           ! time-stepping                    (dyn_nxt routine) 
     55 
     56   USE stopar           ! Stochastic parametrization       (sto_par routine) 
     57   USE stopts  
    5558 
    5659   USE bdy_par          ! for lk_bdy 
Note: See TracChangeset for help on using the changeset viewer.