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 8143 for branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90 – NEMO

Ignore:
Timestamp:
2017-06-06T15:55:44+02:00 (7 years ago)
Author:
gm
Message:

#1880 (HPC-09) - step-7: top/bottom drag computed at T-points, zdfbfr.F90 replaced by zdfdrg.F90 + changes in namelist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90

    r7816 r8143  
    55   !!                   shelf 
    66   !!====================================================================== 
    7    !! History :  3.2   !  2011-02  (C.Harris  ) Original code isf cav 
    8    !!            X.X   !  2006-02  (C. Wang   ) Original code bg03 
    9    !!            3.4   !  2013-03  (P. Mathiot) Merging + parametrization 
     7   !! History :  3.2  !  2011-02  (C.Harris  ) Original code isf cav 
     8   !!            X.X  !  2006-02  (C. Wang   ) Original code bg03 
     9   !!            3.4  !  2013-03  (P. Mathiot) Merging + parametrization 
    1010   !!---------------------------------------------------------------------- 
    1111 
    1212   !!---------------------------------------------------------------------- 
    13    !!   sbc_isf        : update sbc under ice shelf 
     13   !!   sbc_isf       : update sbc under ice shelf 
    1414   !!---------------------------------------------------------------------- 
    15    USE oce             ! ocean dynamics and tracers 
    16    USE dom_oce         ! ocean space and time domain 
    17    USE phycst          ! physical constants 
    18    USE eosbn2          ! equation of state 
    19    USE sbc_oce         ! surface boundary condition: ocean fields 
    20    USE zdfbfr          ! 
     15   USE oce            ! ocean dynamics and tracers 
     16   USE dom_oce        ! ocean space and time domain 
     17   USE phycst         ! physical constants 
     18   USE eosbn2         ! equation of state 
     19   USE sbc_oce        ! surface boundary condition: ocean fields 
     20   USE zdfdrg         ! vertical physics: top/bottom drag coef. 
    2121   ! 
    22    USE in_out_manager  ! I/O manager 
    23    USE iom             ! I/O manager library 
    24    USE fldread         ! read input field at current time step 
    25    USE lbclnk          ! 
    26    USE wrk_nemo        ! Memory allocation 
    27    USE timing          ! Timing 
    28    USE lib_fortran     ! glob_sum 
     22   USE in_out_manager ! I/O manager 
     23   USE iom            ! I/O manager library 
     24   USE fldread        ! read input field at current time step 
     25   USE lbclnk         ! 
     26   USE wrk_nemo       ! Memory allocation 
     27   USE timing         ! Timing 
     28   USE lib_fortran    ! glob_sum 
    2929 
    3030   IMPLICIT NONE 
     
    7777CONTAINS 
    7878  
    79   SUBROUTINE sbc_isf(kt) 
     79  SUBROUTINE sbc_isf( kt ) 
    8080      !!--------------------------------------------------------------------- 
    8181      !!                  ***  ROUTINE sbc_isf  *** 
     
    9494      INTEGER               :: ji, jj, jk           ! loop index 
    9595      INTEGER               :: ikt, ikb             ! loop index 
    96       REAL(wp), DIMENSION (:,:), POINTER :: zt_frz, zdep ! freezing temperature (zt_frz) at depth (zdep)  
     96      REAL(wp), DIMENSION(jpi,jpj) ::   zt_frz, zdep  ! freezing temperature (zt_frz) at depth (zdep)  
    9797      REAL(wp), DIMENSION(:,:,:), POINTER :: zfwfisf3d, zqhcisf3d, zqlatisf3d 
    9898      REAL(wp), DIMENSION(:,:  ), POINTER :: zqhcisf2d 
     
    100100      ! 
    101101      IF( MOD( kt-1, nn_fsbc) == 0 ) THEN 
    102          ! allocation 
    103          CALL wrk_alloc( jpi,jpj, zt_frz, zdep  ) 
    104102 
    105103         ! compute salt and heat flux 
     
    204202            CALL wrk_dealloc( jpi,jpj,     zqhcisf2d                        ) 
    205203          END IF 
    206           ! deallocation 
    207           CALL wrk_dealloc( jpi,jpj, zt_frz, zdep  ) 
    208204          ! 
    209205        END IF 
     
    254250  END FUNCTION 
    255251 
     252 
    256253  SUBROUTINE sbc_isf_init 
    257254      !!--------------------------------------------------------------------- 
     
    289286 
    290287      IF ( lwp ) WRITE(numout,*) 
    291       IF ( lwp ) WRITE(numout,*) 'sbc_isf: heat flux of the ice shelf' 
    292       IF ( lwp ) WRITE(numout,*) '~~~~~~~~~' 
    293       IF ( lwp ) WRITE(numout,*) 'sbcisf :'  
    294       IF ( lwp ) WRITE(numout,*) '~~~~~~~~' 
     288      IF ( lwp ) WRITE(numout,*) 'sbc_isf_init : heat flux of the ice shelf' 
     289      IF ( lwp ) WRITE(numout,*) '~~~~~~~~~~~' 
    295290      IF ( lwp ) WRITE(numout,*) '        nn_isf      = ', nn_isf 
    296291      IF ( lwp ) WRITE(numout,*) '        nn_isfblk   = ', nn_isfblk 
     
    299294      IF ( lwp ) WRITE(numout,*) '        rn_gammat0  = ', rn_gammat0   
    300295      IF ( lwp ) WRITE(numout,*) '        rn_gammas0  = ', rn_gammas0   
    301       IF ( lwp ) WRITE(numout,*) '        rn_tfri2    = ', rn_tfri2  
     296      IF ( lwp ) WRITE(numout,*) '        rn_Cd0      = ', r_Cdmin_top  
    302297      ! 
    303298      ! Allocate public variable 
     
    305300      ! 
    306301      ! initialisation 
    307       qisf(:,:)        = 0._wp  ; fwfisf  (:,:) = 0._wp 
    308       risf_tsc(:,:,:)  = 0._wp  ; fwfisf_b(:,:) = 0._wp 
     302      qisf    (:,:)    = 0._wp   ;  fwfisf  (:,:) = 0._wp 
     303      risf_tsc(:,:,:)  = 0._wp   ;  fwfisf_b(:,:) = 0._wp 
    309304      ! 
    310305      ! define isf tbl tickness, top and bottom indice 
     
    312307      CASE ( 1 )  
    313308         rhisf_tbl(:,:) = rn_hisf_tbl 
    314          misfkt(:,:)    = mikt(:,:)         ! same indice for bg03 et cav => used in isfdiv 
     309         misfkt   (:,:) = mikt(:,:)         ! same indice for bg03 et cav => used in isfdiv 
    315310 
    316311      CASE ( 2 , 3 ) 
     
    346341            DO jj = 1, jpj 
    347342                ik = 2 
     343!!gm potential bug: use gdepw_0 not _n 
    348344                DO WHILE ( ik <= mbkt(ji,jj) .AND. gdepw_n(ji,jj,ik) < rzisf_tbl(ji,jj) ) ;  ik = ik + 1 ;  END DO 
    349345                misfkt(ji,jj) = ik-1 
     
    354350         ! as in nn_isf == 1 
    355351         rhisf_tbl(:,:) = rn_hisf_tbl 
    356          misfkt(:,:)    = mikt(:,:)         ! same indice for bg03 et cav => used in isfdiv 
     352         misfkt   (:,:) = mikt(:,:)         ! same indice for bg03 et cav => used in isfdiv 
    357353          
    358354         ! load variable used in fldread (use for temporal interpolation of isf fwf forcing) 
     
    377373            ! determine the deepest level influenced by the boundary layer 
    378374            DO jk = ikt+1, mbkt(ji,jj) 
    379                IF ( (SUM(e3t_n(ji,jj,ikt:jk-1)) < rhisf_tbl(ji,jj)) .AND. (tmask(ji,jj,jk) == 1) ) ikb = jk 
     375               IF( (SUM(e3t_n(ji,jj,ikt:jk-1)) < rhisf_tbl(ji,jj)) .AND. (tmask(ji,jj,jk) == 1) )  ikb = jk 
    380376            END DO 
    381377            rhisf_tbl(ji,jj) = MIN(rhisf_tbl(ji,jj), SUM(e3t_n(ji,jj,ikt:ikb))) ! limit the tbl to water thickness. 
     
    390386  END SUBROUTINE sbc_isf_init 
    391387 
     388 
    392389  SUBROUTINE sbc_isf_bg03(kt) 
    393390      !!--------------------------------------------------------------------- 
     
    402399      !!         interaction for climate models", Ocean Modelling 5(2003) 157-170. 
    403400      !!         (hereafter BG) 
    404       !! History : 
    405       !!         06-02  (C. Wang) Original code 
     401      !! History :  06-02  (C. Wang) Original code 
    406402      !!---------------------------------------------------------------------- 
    407403      INTEGER, INTENT ( in ) :: kt 
     
    415411      !!---------------------------------------------------------------------- 
    416412 
    417       IF ( nn_timing == 1 ) CALL timing_start('sbc_isf_bg03') 
     413      IF( nn_timing == 1 )  CALL timing_start('sbc_isf_bg03') 
    418414      ! 
    419415      DO ji = 1, jpi 
     
    441437               !add to salinity trend 
    442438            ELSE 
    443                qisf(ji,jj) = 0._wp ; fwfisf(ji,jj) = 0._wp 
     439               qisf(ji,jj) = 0._wp   ;  fwfisf(ji,jj) = 0._wp 
    444440            END IF 
    445441         END DO 
    446442      END DO 
    447443      ! 
    448       IF( nn_timing == 1 )  CALL timing_stop('sbc_isf_bg03') 
     444      IF( nn_timing == 1 )   CALL timing_stop('sbc_isf_bg03') 
    449445      ! 
    450446  END SUBROUTINE sbc_isf_bg03 
     447 
    451448 
    452449  SUBROUTINE sbc_isf_cav( kt ) 
     
    463460      !!                emp, emps  : update freshwater flux below ice shelf 
    464461      !!--------------------------------------------------------------------- 
    465       INTEGER, INTENT(in)          ::   kt         ! ocean time step 
     462      INTEGER, INTENT(in) ::   kt   ! ocean time step 
    466463      ! 
    467464      INTEGER  ::   ji, jj     ! dummy loop indices 
    468465      INTEGER  ::   nit 
     466      LOGICAL  ::   lit 
    469467      REAL(wp) ::   zlamb1, zlamb2, zlamb3 
    470468      REAL(wp) ::   zeps1,zeps2,zeps3,zeps4,zeps6,zeps7 
     
    472470      REAL(wp) ::   zeps = 1.e-20_wp         
    473471      REAL(wp) ::   zerr 
    474       REAL(wp), DIMENSION(:,:), POINTER ::   zfrz 
    475       REAL(wp), DIMENSION(:,:), POINTER ::   zgammat, zgammas  
    476       REAL(wp), DIMENSION(:,:), POINTER ::   zfwflx, zhtflx, zhtflx_b 
    477       LOGICAL  ::   lit 
     472      REAL(wp), DIMENSION(jpi,jpj) ::   zfrz 
     473      REAL(wp), DIMENSION(jpi,jpj) ::   zgammat, zgammas  
     474      REAL(wp), DIMENSION(jpi,jpj) ::   zfwflx, zhtflx, zhtflx_b 
    478475      !!--------------------------------------------------------------------- 
    479476      ! coeficient for linearisation of potential tfreez 
     
    484481      IF( nn_timing == 1 )  CALL timing_start('sbc_isf_cav') 
    485482      ! 
    486       CALL wrk_alloc( jpi,jpj, zfrz  , zgammat, zgammas  ) 
    487       CALL wrk_alloc( jpi,jpj, zfwflx, zhtflx , zhtflx_b ) 
    488  
    489483      ! initialisation 
    490484      zgammat(:,:) = rn_gammat0 ; zgammas (:,:) = rn_gammas0 
     
    578572      CALL iom_put('isfgammas', zgammas) 
    579573      !  
    580       CALL wrk_dealloc( jpi,jpj, zfrz  , zgammat, zgammas  ) 
    581       CALL wrk_dealloc( jpi,jpj, zfwflx, zhtflx , zhtflx_b ) 
    582       ! 
    583574      IF( nn_timing == 1 )  CALL timing_stop('sbc_isf_cav') 
    584575      ! 
     
    600591      INTEGER  :: ikt                         
    601592      INTEGER  :: ji, jj                     ! loop index 
    602       REAL(wp), DIMENSION(:,:), POINTER :: zustar           ! U, V at T point and friction velocity 
    603593      REAL(wp) :: zdku, zdkv                 ! U, V shear  
    604594      REAL(wp) :: zPr, zSc, zRc              ! Prandtl, Scmidth and Richardson number  
     
    614604      REAL(wp), PARAMETER :: znu   = 1.95e-6_wp ! kinamatic viscosity of sea water (m2.s-1) 
    615605      REAL(wp), DIMENSION(2) :: zts, zab 
     606      REAL(wp), DIMENSION(jpi,jpj) :: zustar   ! U, V at T point and friction velocity 
    616607      !!--------------------------------------------------------------------- 
    617       CALL wrk_alloc( jpi,jpj, zustar ) 
    618608      ! 
    619609      SELECT CASE ( nn_gammablk ) 
     
    626616         !! Jenkins et al., 2010, JPO, p2298-2312 
    627617         !! Adopted by Asay-Davis et al. (2015) 
    628  
    629          !! compute ustar (eq. 24) 
    630          zustar(:,:) = SQRT( rn_tfri2 * (utbl(:,:) * utbl(:,:) + vtbl(:,:) * vtbl(:,:) + rn_tfeb2) ) 
     618!!gm  I don't understand the u* expression in those papers... (see for example zdfglf module) 
     619!!    for me ustar= Cd0 * |U|  not  (Cd0)^1/2 * |U| ....  which is what you can find in Jenkins et al. 
     620 
     621         !! compute ustar (eq. 24)           !! NB: here r_Cdmin_top = rn_Cd0 read in namdrg_top namelist) 
     622         zustar(:,:) = SQRT( r_Cdmin_top * (utbl(:,:) * utbl(:,:) + vtbl(:,:) * vtbl(:,:) + r_ke0_top) ) 
    631623 
    632624         !! Compute gammats 
     
    638630         !! as MOL depends of flux and flux depends of MOL, best will be iteration (TO DO) 
    639631         !! compute ustar 
    640          zustar(:,:) = SQRT( rn_tfri2 * (utbl(:,:) * utbl(:,:) + vtbl(:,:) * vtbl(:,:) + rn_tfeb2) ) 
     632         zustar(:,:) = SQRT( r_Cdmin_top * (utbl(:,:) * utbl(:,:) + vtbl(:,:) * vtbl(:,:) + r_ke0_top) ) 
    641633 
    642634         !! compute Pr and Sc number (can be improved) 
     
    649641 
    650642         !! compute gamma 
    651          DO ji=2,jpi 
    652             DO jj=2,jpj 
     643         DO ji = 2, jpi 
     644            DO jj = 2, jpj 
    653645               ikt = mikt(ji,jj) 
    654646 
    655                IF (zustar(ji,jj) == 0._wp) THEN           ! only for kt = 1 I think 
     647               IF( zustar(ji,jj) == 0._wp ) THEN           ! only for kt = 1 I think 
    656648                  pgt = rn_gammat0 
    657649                  pgs = rn_gammas0 
    658650               ELSE 
    659651                  !! compute Rc number (as done in zdfric.F90) 
     652!!gm better to do it like in the new zdfric.F90   i.e. avm weighted Ri computation 
     653!!gm moreover, use Max(rn2,0) to take care of static instabilities.... 
    660654                  zcoef = 0.5_wp / e3w_n(ji,jj,ikt) 
    661655                  !                                            ! shear of horizontal velocity 
     
    703697         CALL lbc_lnk(pgs(:,:),'T',1.) 
    704698      END SELECT 
    705       CALL wrk_dealloc( jpi,jpj, zustar ) 
    706699      ! 
    707700   END SUBROUTINE sbc_isf_gammats 
    708701 
     702 
    709703   SUBROUTINE sbc_isf_tbl( pvarin, pvarout, cd_ptin ) 
    710704      !!---------------------------------------------------------------------- 
     
    714708      !! 
    715709      !!---------------------------------------------------------------------- 
    716       REAL(wp), DIMENSION(:,:,:), INTENT( in  ) :: pvarin 
    717       REAL(wp), DIMENSION(:,:)  , INTENT( out ) :: pvarout 
    718       CHARACTER(len=1),           INTENT( in  ) :: cd_ptin ! point of variable in/out 
    719       ! 
    720       REAL(wp) :: ze3, zhk 
     710      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) :: pvarin 
     711      REAL(wp), DIMENSION(:,:)  , INTENT(  out) :: pvarout 
     712      CHARACTER(len=1),           INTENT(in   ) :: cd_ptin ! point of variable in/out 
     713      ! 
     714      INTEGER ::   ji, jj, jk                ! loop index 
     715      INTEGER ::   ikt, ikb                    ! top and bottom index of the tbl 
     716      REAL(wp) ::   ze3, zhk 
    721717      REAL(wp), DIMENSION(:,:), POINTER :: zhisf_tbl ! thickness of the tbl 
    722  
    723       INTEGER :: ji, jj, jk                  ! loop index 
    724       INTEGER :: ikt, ikb                    ! top and bottom index of the tbl 
    725718      !!---------------------------------------------------------------------- 
    726719      ! allocation 
     
    736729               ikt = miku(ji,jj) ; ikb = miku(ji,jj) 
    737730               ! thickness of boundary layer at least the top level thickness 
    738                zhisf_tbl(ji,jj) = MAX(rhisf_tbl_0(ji,jj), e3u_n(ji,jj,ikt)) 
     731               zhisf_tbl(ji,jj) = MAX( rhisf_tbl_0(ji,jj) , e3u_n(ji,jj,ikt) ) 
    739732 
    740733               ! determine the deepest level influenced by the boundary layer 
     
    755748            END DO 
    756749         END DO 
    757          DO jj = 2,jpj 
    758             DO ji = 2,jpi 
     750         DO jj = 2, jpj 
     751            DO ji = 2, jpi 
     752!!gm a wet-point only average should be used here !!! 
    759753               pvarout(ji,jj) = 0.5_wp * (pvarout(ji,jj) + pvarout(ji-1,jj)) 
    760754            END DO 
     
    786780            END DO 
    787781         END DO 
    788          DO jj = 2,jpj 
    789             DO ji = 2,jpi 
     782         DO jj = 2, jpj 
     783            DO ji = 2, jpi 
     784!!gm a wet-point only average should be used here !!! 
    790785               pvarout(ji,jj) = 0.5_wp * (pvarout(ji,jj) + pvarout(ji,jj-1)) 
    791786            END DO 
     
    882877      ! 
    883878   END SUBROUTINE sbc_isf_div 
     879 
    884880   !!====================================================================== 
    885881END MODULE sbcisf 
Note: See TracChangeset for help on using the changeset viewer.