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 7905 for branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90 – NEMO

Ignore:
Timestamp:
2017-04-13T12:07:16+02:00 (7 years ago)
Author:
jcastill
Message:

Series of small bug fixes and stetic changes:

-Fix possible bug in the calculation of Stokes-Coriolis
-Move all the wave control variables to namelist namsbc_wave
-Use one namelist variable instead of two to set Stokes drift velocity coupling
-Cap the values of the Craig and Banner constant as calculated from wave input fields to take into account small values of the friction velocity
-Add new Phillips parametrization for Stokes drift vertical velocity, using the inverse depth scale as in Breivik 2015, instead of the peak wave number as calculated from wave input fields
-Better control of the wave fields that are read from file depending on the wave parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90

    r7853 r7905  
    2424   USE phycst         ! physical constants 
    2525   USE zdfmxl         ! mixed layer 
    26    USE sbcwave, ONLY: hsw,rn_crban 
     26   USE sbcwave 
    2727   !  
    2828   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
     
    6262   INTEGER  ::   nn_stab_func      ! stability functions G88, KC or Canuto (=0/1/2) 
    6363   INTEGER  ::   nn_clos           ! closure 0/1/2/3 MY82/k-eps/k-w/gen 
    64    INTEGER  ::   nn_wmix           ! type of wave breaking mixing 
    65    INTEGER, PUBLIC, PARAMETER ::   jp_craigbanner = 0   ! Craig and Banner formulation (original NEMO formulation - 
    66                                                         !    direct conversion of mechanical to turbulent energy) 
    67    INTEGER, PUBLIC, PARAMETER ::   jp_janssen     = 1   ! Janssen formulation - no assumption on direct energy conversion  
    6864   REAL(wp) ::   rn_clim_galp      ! Holt 2008 value for k-eps: 0.267 
    6965   REAL(wp) ::   rn_epsmin         ! minimum value of dissipation (m2/s3) 
     
    181177            rsbc_tke3(:,:) = rdt * rn_crban(:,:)                                           ! Neumann + Wave breaking 
    182178            rsbc_psi1(:,:) = rc0**rpp * rsbc_tke1(:,:)**rmm * rl_sf**rnn                   ! Dirichlet + Wave breaking 
    183          ELSE 
     179         ELSE IF( nn_wmix==jp_craigbanner ) THEN 
    184180            rsbc_tke1(:,:) = -3._wp/2._wp*rn_crban(:,:)*ra_sf*rl_sf 
    185181            rsbc_tke3(:,:) = rdt * rn_crban(:,:) / rl_sf 
     
    359355               z_elem_c(:,:,2) = 0._wp 
    360356               z_elem_b(:,:,2) = 1._wp 
    361             ELSE 
     357            ELSE IF( nn_wmix==jp_craigbanner ) THEN 
    362358               en(:,:,1) = rc02r * ustars2(:,:) * (1._wp + rsbc_tke1(:,:))**(2._wp/3._wp) 
    363359               en(:,:,1) = MAX(en(:,:,1), rn_emin)  
     
    405401               zflxs(:,:) = rsbc_tke3(:,:) * ustars2(:,:)**1.5_wp * ((zhsro(:,:)+fsdept(:,:,1) ) / zhsro(:,:) )**(1.5*ra_sf) 
    406402               en(:,:,2) = en(:,:,2) + zflxs(:,:) / fse3w(:,:,2) 
    407             ELSE 
     403            ELSE IF( nn_wmix==jp_craigbanner ) THEN 
    408404               ! Dirichlet conditions at k=1 
    409405               en(:,:,1)       = rc02r * ustars2(:,:) * (1._wp + rsbc_tke1(:,:))**(2._wp/3._wp) 
     
    652648               !  
    653649               ! 
    654             ELSE 
     650            ELSE IF( nn_wmix==jp_craigbanner ) THEN 
    655651               ! Surface value 
    656652               zdep(:,:)       = zhsro(:,:) * rl_sf ! Cosmetic 
     
    708704               psi(:,:,2) = psi(:,:,2) + zflxs(:,:) / fse3w(:,:,2) 
    709705               ! 
    710             ELSE 
     706            ELSE IF( nn_wmix==jp_craigbanner ) THEN 
    711707               ! Surface value: Dirichlet 
    712708               zdep(:,:)       = zhsro(:,:) * rl_sf 
     
    10471043         &            rn_crban_default, rn_charn, rn_frac_hs,& 
    10481044         &            nn_bc_surf, nn_bc_bot, nn_z0_met,      & 
    1049          &            nn_stab_func, nn_clos, nn_wmix 
     1045         &            nn_stab_func, nn_clos 
    10501046      !!---------------------------------------------------------- 
    10511047      ! 
     
    10901086      IF( nn_bc_surf < 0 .OR. nn_bc_surf > 1 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_bc_surf is 0 or 1' )  
    10911087      IF( nn_z0_met < 0 .OR. nn_z0_met > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_z0_met is 0, 1, 2 or 3' )  
    1092       IF( nn_z0_met == 3 .AND. .NOT.ln_sdw ) CALL ctl_stop( 'zdf_gls_init: nn_z0_met=3 requires ln_sdw=T' )  
     1088      IF( nn_z0_met == 3 .AND. .NOT.ln_rough ) CALL ctl_stop( 'zdf_gls_init: nn_z0_met=3 requires ln_rough=T' )  
     1089      IF( nn_z0_met .NE. 3 .AND. ln_rough ) THEN 
     1090         CALL ctl_warn('W A R N I N G:  ln_rough=.TRUE. but nn_z0_met is not 3 - resetting nn_z0_met to 3') 
     1091         nn_z0_met = 3 
     1092      ENDIF 
    10931093      IF( nn_stab_func  < 0 .OR. nn_stab_func  > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_stab_func is 0, 1, 2 and 3' )  
    10941094      IF( nn_clos       < 0 .OR. nn_clos       > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_clos is 0, 1, 2 or 3' ) 
Note: See TracChangeset for help on using the changeset viewer.