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 12590 for NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA/trasbc.F90 – NEMO

Ignore:
Timestamp:
2020-03-23T22:16:19+01:00 (4 years ago)
Author:
techene
Message:

all: add e3 substitute, OCE/DOM/domzgr_substitute.h90: correct a bug for e3f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA/trasbc.F90

    r12377 r12590  
    99   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps 
    1010   !!             -   !  2010-09  (C. Ethe, G. Madec) Merge TRA-TRC 
    11    !!            3.6  !  2014-11  (P. Mathiot) isf melting forcing  
     11   !!            3.6  !  2014-11  (P. Mathiot) isf melting forcing 
    1212   !!            4.1  !  2019-09  (P. Mathiot) isf moved in traisf 
    1313   !!---------------------------------------------------------------------- 
     
    2121   USE phycst         ! physical constant 
    2222   USE eosbn2         ! Equation Of State 
    23    USE sbcmod         ! ln_rnf   
    24    USE sbcrnf         ! River runoff   
     23   USE sbcmod         ! ln_rnf 
     24   USE sbcrnf         ! River runoff 
    2525   USE traqsr         ! solar radiation penetration 
    2626   USE trd_oce        ! trends: ocean variables 
    27    USE trdtra         ! trends manager: tracers  
    28 #if defined key_asminc    
     27   USE trdtra         ! trends manager: tracers 
     28#if defined key_asminc 
    2929   USE asminc         ! Assimilation increment 
    3030#endif 
     
    4343   !! * Substitutions 
    4444#  include "do_loop_substitute.h90" 
     45#  include "domzgr_substitute.h90" 
    4546   !!---------------------------------------------------------------------- 
    4647   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    5354      !!---------------------------------------------------------------------- 
    5455      !!                  ***  ROUTINE tra_sbc  *** 
    55       !!                    
     56      !! 
    5657      !! ** Purpose :   Compute the tracer surface boundary condition trend of 
    5758      !!      (flux through the interface, concentration/dilution effect) 
    5859      !!      and add it to the general trend of tracer equations. 
    5960      !! 
    60       !! ** Method :   The (air+ice)-sea flux has two components:  
    61       !!      (1) Fext, external forcing (i.e. flux through the (air+ice)-sea interface);  
    62       !!      (2) Fwe , tracer carried with the water that is exchanged with air+ice.  
     61      !! ** Method :   The (air+ice)-sea flux has two components: 
     62      !!      (1) Fext, external forcing (i.e. flux through the (air+ice)-sea interface); 
     63      !!      (2) Fwe , tracer carried with the water that is exchanged with air+ice. 
    6364      !!               The input forcing fields (emp, rnf, sfx) contain Fext+Fwe, 
    6465      !!             they are simply added to the tracer trend (ts(Krhs)). 
     
    6869      !!             concentration/dilution effect associated with water exchanges. 
    6970      !! 
    70       !! ** Action  : - Update ts(Krhs) with the surface boundary condition trend  
     71      !! ** Action  : - Update ts(Krhs) with the surface boundary condition trend 
    7172      !!              - send trends to trdtra module for further diagnostics(l_trdtra=T) 
    7273      !!---------------------------------------------------------------------- 
     
    7576      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts        ! active tracers and RHS of tracer equation 
    7677      ! 
    77       INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices   
     78      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices 
    7879      INTEGER  ::   ikt, ikb                    ! local integers 
    7980      REAL(wp) ::   zfact, z1_e3t, zdep, ztim   ! local scalar 
     
    9091      ! 
    9192      IF( l_trdtra ) THEN                    !* Save ta and sa trends 
    92          ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )  
     93         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
    9394         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) 
    9495         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) 
     
    127128         sbc_tsc(ji,jj,jp_sal) = r1_rau0     * sfx(ji,jj)   ! salt flux due to freezing/melting 
    128129      END_2D 
    129       IF( ln_linssh ) THEN                !* linear free surface   
     130      IF( ln_linssh ) THEN                !* linear free surface 
    130131         DO_2D_01_00 
    131132            sbc_tsc(ji,jj,jp_tem) = sbc_tsc(ji,jj,jp_tem) + r1_rau0 * emp(ji,jj) * pts(ji,jj,1,jp_tem,Kmm) 
     
    138139      DO jn = 1, jpts               !==  update tracer trend  ==! 
    139140         DO_2D_01_00 
    140             pts(ji,jj,1,jn,Krhs) = pts(ji,jj,1,jn,Krhs) + zfact * ( sbc_tsc_b(ji,jj,jn) + sbc_tsc(ji,jj,jn) ) / e3t(ji,jj,1,Kmm) 
     141            pts(ji,jj,1,jn,Krhs) = pts(ji,jj,1,jn,Krhs) + zfact * ( sbc_tsc_b(ji,jj,jn) + sbc_tsc(ji,jj,jn) )    & 
     142               &                                                / e3t(ji,jj,1,Kmm) 
    141143         END_2D 
    142144      END DO 
    143       !                   
     145      ! 
    144146      IF( lrst_oce ) THEN           !==  write sbc_tsc in the ocean restart file  ==! 
    145147         IF( lwxios ) CALL iom_swap(      cwxios_context          ) 
     
    153155      !---------------------------------------- 
    154156      ! 
    155       IF( ln_rnf ) THEN         ! input of heat and salt due to river runoff  
     157      IF( ln_rnf ) THEN         ! input of heat and salt due to river runoff 
    156158         zfact = 0.5_wp 
    157159         DO_2D_01_00 
     
    162164                                        &                      +  ( rnf_tsc_b(ji,jj,jp_tem) + rnf_tsc(ji,jj,jp_tem) ) * zdep 
    163165                  IF( ln_rnf_sal )   pts(ji,jj,jk,jp_sal,Krhs) = pts(ji,jj,jk,jp_sal,Krhs)                                  & 
    164                                         &                      +  ( rnf_tsc_b(ji,jj,jp_sal) + rnf_tsc(ji,jj,jp_sal) ) * zdep  
     166                                        &                      +  ( rnf_tsc_b(ji,jj,jp_sal) + rnf_tsc(ji,jj,jp_sal) ) * zdep 
    165167               END DO 
    166168            ENDIF 
     
    179181      IF( ln_sshinc ) THEN         ! input of heat and salt due to assimilation 
    180182          ! 
    181          IF( ln_linssh ) THEN  
     183         IF( ln_linssh ) THEN 
    182184            DO_2D_01_00 
    183185               ztim = ssh_iau(ji,jj) / e3t(ji,jj,1,Kmm) 
     
    202204         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_nsr, ztrdt ) 
    203205         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_nsr, ztrds ) 
    204          DEALLOCATE( ztrdt , ztrds )  
     206         DEALLOCATE( ztrdt , ztrds ) 
    205207      ENDIF 
    206208      ! 
Note: See TracChangeset for help on using the changeset viewer.