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 5260 for branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90 – NEMO

Ignore:
Timestamp:
2015-05-12T12:37:15+02:00 (9 years ago)
Author:
deazer
Message:

Merged branch with Trunk at revision 5253.
Checked with SETTE, passes modified iodef.xml for AMM12 experiment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90

    r3764 r5260  
    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  
    1112   !!---------------------------------------------------------------------- 
    1213 
     
    1819   USE dom_oce         ! ocean space domain variables 
    1920   USE phycst          ! physical constant 
     21   USE sbcmod          ! ln_rnf   
     22   USE sbcrnf          ! River runoff   
    2023   USE traqsr          ! solar radiation penetration 
    21    USE trdmod_oce      ! ocean trends  
    22    USE trdtra          ! ocean trends 
     24   USE trd_oce         ! trends: ocean variables 
     25   USE trdtra          ! trends manager: tracers  
     26   ! 
    2327   USE in_out_manager  ! I/O manager 
    2428   USE prtctl          ! Print control 
    2529   USE sbcrnf          ! River runoff   
     30   USE sbcisf          ! Ice shelf    
    2631   USE sbcmod          ! ln_rnf   
    2732   USE iom 
     
    2934   USE wrk_nemo        ! Memory Allocation 
    3035   USE timing          ! Timing 
     36   USE eosbn2 
    3137 
    3238   IMPLICIT NONE 
     
    3945#  include "vectopt_loop_substitute.h90" 
    4046   !!---------------------------------------------------------------------- 
    41    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     47   !! NEMO/OPA 3.7 , NEMO Consortium (2014) 
    4248   !! $Id$ 
    4349   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    9197      !!         where emp, the surface freshwater budget (evaporation minus 
    9298      !!         precipitation minus runoff) given in kg/m2/s is divided 
    93       !!         by rau0 = 1020 kg/m3 (density of sea water) to obtain m/s.     
     99      !!         by rau0 (density of sea water) to obtain m/s.     
    94100      !!         Note: even though Fwe does not appear explicitly for  
    95101      !!         temperature in this routine, the heat carried by the water 
     
    107113      !! ** Action  : - Update the 1st level of (ta,sa) with the trend associated 
    108114      !!                with the tracer surface boundary condition  
    109       !!              - save the trend it in ttrd ('key_trdtra') 
     115      !!              - send trends to trdtra module (l_trdtra=T) 
    110116      !!---------------------------------------------------------------------- 
    111117      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    112118      !! 
    113119      INTEGER  ::   ji, jj, jk, jn           ! dummy loop indices   
     120      INTEGER  ::   ikt, ikb  
     121      INTEGER  ::   nk_isf 
    114122      REAL(wp) ::   zfact, z1_e3t, zdep 
     123      REAL(wp) ::   zalpha, zhk 
     124      REAL(wp) ::  zt_frz, zpress 
    115125      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds 
    116126      !!---------------------------------------------------------------------- 
     
    124134      ENDIF 
    125135 
    126       IF( l_trdtra )   THEN                    !* Save ta and sa trends 
     136      IF( l_trdtra ) THEN                    !* Save ta and sa trends 
    127137         CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds )  
    128138         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
     
    137147 
    138148      !---------------------------------------- 
    139       !        EMP, EMPS and QNS effects 
     149      !        EMP, SFX and QNS effects 
    140150      !---------------------------------------- 
    141151      !                                          Set before sbc tracer content fields 
     
    146156              & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN 
    147157            IF(lwp) WRITE(numout,*) '          nit000-1 surface tracer content forcing fields red in the restart file' 
    148             zfact = 0.5e0 
     158            zfact = 0.5_wp 
    149159            CALL iom_get( numror, jpdom_autoglo, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem) )   ! before heat content sbc trend 
    150160            CALL iom_get( numror, jpdom_autoglo, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal) )   ! before salt content sbc trend 
    151161         ELSE                                         ! No restart or restart not found: Euler forward time stepping 
    152             zfact = 1.e0 
    153             sbc_tsc_b(:,:,:) = 0.e0 
     162            zfact = 1._wp 
     163            sbc_tsc_b(:,:,:) = 0._wp 
    154164         ENDIF 
    155165      ELSE                                         ! Swap of forcing fields 
    156166         !                                         ! ---------------------- 
    157          zfact = 0.5e0 
     167         zfact = 0.5_wp 
    158168         sbc_tsc_b(:,:,:) = sbc_tsc(:,:,:) 
    159169      ENDIF 
     
    182192            END DO 
    183193         END DO 
    184          CALL iom_put( "emp_x_sst", emp (:,:) * tsn(:,:,1,jp_tem) )                          ! c/d term on sst 
    185          CALL iom_put( "emp_x_sss", emp (:,:) * tsn(:,:,1,jp_sal) )                          ! c/d term on sss 
     194         IF( iom_use('emp_x_sst') )   CALL iom_put( "emp_x_sst", emp (:,:) * tsn(:,:,1,jp_tem) )   ! c/d term on sst 
     195         IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * tsn(:,:,1,jp_sal) )   ! c/d term on sss 
    186196      ENDIF 
    187197      ! Concentration dilution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff   
     
    205215      ENDIF 
    206216      ! 
     217      ! 
     218      !---------------------------------------- 
     219      !       Ice Shelf effects (ISF) 
     220      !     tbl treated as in Losh (2008) JGR 
     221      !---------------------------------------- 
     222      ! 
     223      IF( nn_isf > 0 ) THEN 
     224         zfact = 0.5e0 
     225         DO jj = 2, jpj 
     226            DO ji = fs_2, fs_jpim1 
     227          
     228               ikt = misfkt(ji,jj) 
     229               ikb = misfkb(ji,jj) 
     230    
     231               ! level fully include in the ice shelf boundary layer 
     232               ! if isfdiv, we have to remove heat flux due to inflow at 0oC (as in rnf when you add rnf at sst) 
     233               ! sign - because fwf sign of evapo (rnf sign of precip) 
     234               DO jk = ikt, ikb - 1 
     235               ! compute tfreez for the temperature correction (we add water at freezing temperature) 
     236!                  zpress = grav*rau0*fsdept(ji,jj,jk)*1.e-04 
     237                  zt_frz = -1.9 !eos_fzp( tsn(ji,jj,jk,jp_sal), zpress ) 
     238               ! compute trend 
     239                  tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem)                                          & 
     240                     &           + zfact * (risf_tsc_b(ji,jj,jp_tem) + risf_tsc(ji,jj,jp_tem)          & 
     241                     &               - rdivisf * (fwfisf(ji,jj) + fwfisf_b(ji,jj)) * zt_frz * r1_rau0) & 
     242                     &           * r1_hisf_tbl(ji,jj) 
     243                  tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal)                                          & 
     244                     &           + zfact * (risf_tsc_b(ji,jj,jp_sal) + risf_tsc(ji,jj,jp_sal)) * r1_hisf_tbl(ji,jj) 
     245               END DO 
     246    
     247               ! level partially include in ice shelf boundary layer  
     248               ! compute tfreez for the temperature correction (we add water at freezing temperature) 
     249!               zpress = grav*rau0*fsdept(ji,jj,ikb)*1.e-04 
     250               zt_frz = -1.9 !eos_fzp( tsn(ji,jj,ikb,jp_sal), zpress ) 
     251               ! compute trend 
     252               tsa(ji,jj,ikb,jp_tem) = tsa(ji,jj,ikb,jp_tem)                                           & 
     253                  &              + zfact * (risf_tsc_b(ji,jj,jp_tem) + risf_tsc(ji,jj,jp_tem)          & 
     254                  &                  - rdivisf * (fwfisf(ji,jj) + fwfisf_b(ji,jj)) * zt_frz * r1_rau0) &  
     255                  &              * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) 
     256               tsa(ji,jj,ikb,jp_sal) = tsa(ji,jj,ikb,jp_sal)                                           & 
     257                  &              + zfact * (risf_tsc_b(ji,jj,jp_sal) + risf_tsc(ji,jj,jp_sal)) * r1_hisf_tbl(ji,jj) * ralpha(ji,jj)  
     258            END DO 
     259         END DO 
     260         IF( lrst_oce ) THEN 
     261            IF(lwp) WRITE(numout,*) 
     262            IF(lwp) WRITE(numout,*) 'sbc : isf surface tracer content forcing fields written in ocean restart file ',   & 
     263               &                    'at it= ', kt,' date= ', ndastp 
     264            IF(lwp) WRITE(numout,*) '~~~~' 
     265            CALL iom_rstput( kt, nitrst, numrow, 'fwf_isf_b', fwfisf(:,:)          ) 
     266            CALL iom_rstput( kt, nitrst, numrow, 'isf_hc_b' , risf_tsc(:,:,jp_tem) ) 
     267            CALL iom_rstput( kt, nitrst, numrow, 'isf_sc_b' , risf_tsc(:,:,jp_sal) ) 
     268         ENDIF 
     269      END IF 
     270      ! 
    207271      !---------------------------------------- 
    208272      !        River Runoff effects 
     
    226290      ENDIF 
    227291  
    228       IF( l_trdtra )   THEN                      ! save the horizontal diffusive trends for further diagnostics 
     292      IF( l_trdtra )   THEN                      ! send trends for further diagnostics 
    229293         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 
    230294         ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:) 
    231          CALL trd_tra( kt, 'TRA', jp_tem, jptra_trd_nsr, ztrdt ) 
    232          CALL trd_tra( kt, 'TRA', jp_sal, jptra_trd_nsr, ztrds ) 
     295         CALL trd_tra( kt, 'TRA', jp_tem, jptra_nsr, ztrdt ) 
     296         CALL trd_tra( kt, 'TRA', jp_sal, jptra_nsr, ztrds ) 
    233297         CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds )  
    234298      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.