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 5948 for branches/2014/dev_r4650_UKMO12_CFL_diags_take2/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90 – NEMO

Ignore:
Timestamp:
2015-11-30T11:47:24+01:00 (8 years ago)
Author:
timgraham
Message:

Merged in head of trunk (r5936)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO12_CFL_diags_take2/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90

    r5947 r5948  
    2828   USE sbc_oce         ! surface boundary condition: ocean 
    2929   USE sbcrnf          ! river runoffs 
     30   USE sbcisf          ! ice shelf melting/freezing 
    3031   USE zdf_oce         ! ocean vertical mixing 
    3132   USE domvvl          ! variable volume 
    32    USE dynspg_oce      ! surface     pressure gradient variables 
    33    USE dynhpg          ! hydrostatic pressure gradient  
    3433   USE trd_oce         ! trends: ocean variables 
    3534   USE trdtra          ! trends manager: tracers  
    3635   USE traqsr          ! penetrative solar radiation (needed for nksr) 
    3736   USE phycst          ! physical constant 
    38    USE ldftra_oce      ! lateral physics on tracers 
     37   USE ldftra          ! lateral physics on tracers 
     38   USE ldfslp 
    3939   USE bdy_oce         ! BDY open boundary condition variables 
    4040   USE bdytra          ! open boundary condition (bdy_tra routine) 
     
    4646   USE timing          ! Timing 
    4747#if defined key_agrif 
    48    USE agrif_opa_update 
    4948   USE agrif_opa_interp 
    5049#endif 
     
    5756   PUBLIC   tra_nxt_vvl   ! to be used in trcnxt 
    5857 
    59    REAL(wp) ::   rbcp   ! Brown & Campana parameters for semi-implicit hpg 
    6058 
    6159   !! * Substitutions 
     
    8987      !! 
    9088      !! ** Action  : - (tb,sb) and (tn,sn) ready for the next time step 
    91       !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T) 
     89      !! 
    9290      !!---------------------------------------------------------------------- 
    9391      INTEGER, INTENT(in) ::   kt    ! ocean time-step index 
     
    104102         IF(lwp) WRITE(numout,*) 'tra_nxt : achieve the time stepping by Asselin filter and array swap' 
    105103         IF(lwp) WRITE(numout,*) '~~~~~~~' 
    106          ! 
    107          rbcp = 0.25_wp * (1._wp + atfp) * (1._wp + atfp) * ( 1._wp - atfp)      ! Brown & Campana parameter for semi-implicit hpg 
    108104      ENDIF 
    109105 
    110106      ! Update after tracer on domain lateral boundaries 
    111107      !  
     108      ! 
     109#if defined key_agrif 
     110      CALL Agrif_tra                     ! AGRIF zoom boundaries 
     111#endif 
     112      ! 
    112113      CALL lbc_lnk( tsa(:,:,:,jp_tem), 'T', 1._wp )      ! local domain boundaries  (T-point, unchanged sign) 
    113114      CALL lbc_lnk( tsa(:,:,:,jp_sal), 'T', 1._wp ) 
     
    115116#if defined key_bdy  
    116117      IF( lk_bdy )   CALL bdy_tra( kt )  ! BDY open boundaries 
    117 #endif 
    118 #if defined key_agrif 
    119       CALL Agrif_tra                     ! AGRIF zoom boundaries 
    120118#endif 
    121119  
     
    148146         ELSE                 ;   CALL tra_nxt_fix( kt, nit000,         'TRA', tsb, tsn, tsa, jpts )  ! fixed    volume level  
    149147         ENDIF 
    150       ENDIF  
    151       ! 
    152 #if defined key_agrif 
    153       ! Update tracer at AGRIF zoom boundaries 
    154       IF( .NOT.Agrif_Root() )    CALL Agrif_Update_Tra( kt )      ! children only 
    155 #endif       
     148      ENDIF      
    156149      ! 
    157150      ! trends computation 
     
    184177      !!  
    185178      !! ** Method  : - Apply a Asselin time filter on now fields. 
    186       !!              - save in (ta,sa) an average over the three time levels  
    187       !!             which will be used to compute rdn and thus the semi-implicit 
    188       !!             hydrostatic pressure gradient (ln_dynhpg_imp = T) 
    189179      !!              - swap tracer fields to prepare the next time_step. 
    190       !!                This can be summurized for tempearture as: 
    191       !!             ztm = tn + rbcp * [ta -2 tn + tb ]       ln_dynhpg_imp = T 
    192       !!             ztm = 0                                   otherwise 
    193       !!                   with rbcp=1/4 * (1-atfp^4) / (1-atfp) 
    194       !!             tb  = tn + atfp*[ tb - 2 tn + ta ] 
    195       !!             tn  = ta   
    196       !!             ta  = ztm       (NB: reset to 0 after eos_bn2 call) 
    197180      !! 
    198181      !! ** Action  : - (tb,sb) and (tn,sn) ready for the next time step 
    199       !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T) 
     182      !!               
    200183      !!---------------------------------------------------------------------- 
    201184      INTEGER         , INTENT(in   )                               ::   kt       ! ocean time-step index 
     
    208191      ! 
    209192      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices 
    210       LOGICAL  ::   ll_tra_hpg       ! local logical 
    211193      REAL(wp) ::   ztn, ztd         ! local scalars 
    212194      !!---------------------------------------------------------------------- 
     
    218200      ENDIF 
    219201      ! 
    220       IF( cdtype == 'TRA' )  THEN   ;   ll_tra_hpg = ln_dynhpg_imp    ! active  tracers case  and  semi-implicit hpg     
    221       ELSE                          ;   ll_tra_hpg = .FALSE.          ! passive tracers case or NO semi-implicit hpg 
    222       ENDIF 
    223202      ! 
    224203      DO jn = 1, kjpt 
     
    233212                  ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)                       ! ptn <-- pta 
    234213                  ! 
    235                   IF( ll_tra_hpg )   pta(ji,jj,jk,jn) = ztn + rbcp * ztd    ! pta <-- Brown & Campana average 
    236214               END DO 
    237215           END DO 
     
    251229      !!  
    252230      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields. 
    253       !!              - save in (ta,sa) a thickness weighted average over the three  
    254       !!             time levels which will be used to compute rdn and thus the semi- 
    255       !!             implicit hydrostatic pressure gradient (ln_dynhpg_imp = T) 
    256231      !!              - swap tracer fields to prepare the next time_step. 
    257232      !!                This can be summurized for tempearture as: 
    258       !!             ztm = ( e3t_n*tn + rbcp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] )   ln_dynhpg_imp = T 
    259       !!                  /( e3t_n    + rbcp*[ e3t_b    - 2 e3t_n    + e3t_a    ] )    
    260       !!             ztm = 0                                                       otherwise 
    261       !!             tb  = ( e3t_n*tn + atfp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] ) 
    262       !!                  /( e3t_n    + atfp*[ e3t_b    - 2 e3t_n    + e3t_a    ] ) 
    263       !!             tn  = ta  
    264       !!             ta  = zt        (NB: reset to 0 after eos_bn2 call) 
    265233      !! 
    266234      !! ** Action  : - (tb,sb) and (tn,sn) ready for the next time step 
    267       !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T) 
     235      !! 
    268236      !!---------------------------------------------------------------------- 
    269237      INTEGER         , INTENT(in   )                               ::  kt       ! ocean time-step index 
     
    279247 
    280248      !!      
    281       LOGICAL  ::   ll_tra_hpg, ll_traqsr, ll_rnf   ! local logical 
     249      LOGICAL  ::   ll_traqsr, ll_rnf, ll_isf   ! local logical 
    282250      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices 
    283251      REAL(wp) ::   zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar 
     
    292260      ! 
    293261      IF( cdtype == 'TRA' )  THEN    
    294          ll_tra_hpg = ln_dynhpg_imp    ! active  tracers case  and  semi-implicit hpg 
    295262         ll_traqsr  = ln_traqsr        ! active  tracers case  and  solar penetration 
    296263         ll_rnf     = ln_rnf           ! active  tracers case  and  river runoffs 
     264         IF (nn_isf .GE. 1) THEN  
     265            ll_isf = .TRUE.            ! active  tracers case  and  ice shelf melting/freezing 
     266         ELSE 
     267            ll_isf = .FALSE. 
     268         END IF 
    297269      ELSE                           
    298          ll_tra_hpg = .FALSE.          ! passive tracers case or NO semi-implicit hpg 
    299270         ll_traqsr  = .FALSE.          ! active  tracers case and NO solar penetration 
    300271         ll_rnf     = .FALSE.          ! passive tracers or NO river runoffs 
     272         ll_isf     = .FALSE.          ! passive tracers or NO ice shelf melting/freezing 
    301273      ENDIF 
    302274      ! 
     
    321293                  ztc_f  = ztc_n  + atfp * ztc_d 
    322294                  ! 
    323                   IF( jk == 1 ) THEN           ! first level  
    324                      ze3t_f = ze3t_f - zfact2 * ( emp_b(ji,jj) - emp(ji,jj) + rnf(ji,jj) - rnf_b(ji,jj) ) 
     295                  IF( jk == mikt(ji,jj) ) THEN           ! first level  
     296                     ze3t_f = ze3t_f - zfact2 * ( (emp_b(ji,jj)    - emp(ji,jj)   )  & 
     297                            &                   - (rnf_b(ji,jj)    - rnf(ji,jj)   )  & 
     298                            &                   + (fwfisf_b(ji,jj) - fwfisf(ji,jj))  ) 
    325299                     ztc_f  = ztc_f  - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) ) 
    326300                  ENDIF 
    327301 
    328                   IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )   &     ! solar penetration (temperature only) 
     302                  ! solar penetration (temperature only) 
     303                  IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )                            &  
    329304                     &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) )  
    330305 
    331                   IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )   &            ! river runoffs 
     306                  ! river runoff 
     307                  IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )                                          & 
    332308                     &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &  
    333309                     &                              * fse3t_n(ji,jj,jk) / h_rnf(ji,jj) 
     310 
     311                  ! ice shelf 
     312                  IF( ll_isf ) THEN 
     313                     ! level fully include in the Losch_2008 ice shelf boundary layer 
     314                     IF ( jk >= misfkt(ji,jj) .AND. jk < misfkb(ji,jj) )                          & 
     315                        ztc_f  = ztc_f  - zfact1 * ( risf_tsc(ji,jj,jn) - risf_tsc_b(ji,jj,jn) )  & 
     316                               &                 * fse3t_n(ji,jj,jk) * r1_hisf_tbl (ji,jj) 
     317                     ! level partially include in Losch_2008 ice shelf boundary layer  
     318                     IF ( jk == misfkb(ji,jj) )                                                   & 
     319                        ztc_f  = ztc_f  - zfact1 * ( risf_tsc(ji,jj,jn) - risf_tsc_b(ji,jj,jn) )  & 
     320                               &                 * fse3t_n(ji,jj,jk) * r1_hisf_tbl (ji,jj) * ralpha(ji,jj) 
     321                  END IF 
    334322 
    335323                  ze3t_f = 1.e0 / ze3t_f 
     
    337325                  ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)     ! ptn <-- pta 
    338326                  ! 
    339                   IF( ll_tra_hpg ) THEN        ! semi-implicit hpg (T & S only) 
    340                      ze3t_d           = 1.e0   / ( ze3t_n + rbcp * ze3t_d ) 
    341                      pta(ji,jj,jk,jn) = ze3t_d * ( ztc_n  + rbcp * ztc_d  )   ! ta <-- Brown & Campana average 
    342                   ENDIF 
    343327               END DO 
    344328            END DO 
Note: See TracChangeset for help on using the changeset viewer.