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 5965 for branches/2014/dev_r4650_UKMO14.5_SST_BIAS_CORRECTION/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90 – NEMO

Ignore:
Timestamp:
2015-12-01T16:35:30+01:00 (8 years ago)
Author:
timgraham
Message:

Upgraded branch to r5518 of trunk (v3.6 stable revision)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO14.5_SST_BIAS_CORRECTION/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90

    r3764 r5965  
    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   
     23   USE sbcisf          ! Ice shelf    
    2024   USE traqsr          ! solar radiation penetration 
    21    USE trdmod_oce      ! ocean trends  
    22    USE trdtra          ! ocean trends 
     25   USE trd_oce         ! trends: ocean variables 
     26   USE trdtra          ! trends manager: tracers  
     27   ! 
    2328   USE in_out_manager  ! I/O manager 
    2429   USE prtctl          ! Print control 
    25    USE sbcrnf          ! River runoff   
    26    USE sbcmod          ! ln_rnf   
    2730   USE iom 
    2831   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2932   USE wrk_nemo        ! Memory Allocation 
    3033   USE timing          ! Timing 
     34   USE eosbn2 
    3135 
    3236   IMPLICIT NONE 
     
    3943#  include "vectopt_loop_substitute.h90" 
    4044   !!---------------------------------------------------------------------- 
    41    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     45   !! NEMO/OPA 3.7 , NEMO Consortium (2014) 
    4246   !! $Id$ 
    4347   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    9195      !!         where emp, the surface freshwater budget (evaporation minus 
    9296      !!         precipitation minus runoff) given in kg/m2/s is divided 
    93       !!         by rau0 = 1020 kg/m3 (density of sea water) to obtain m/s.     
     97      !!         by rau0 (density of sea water) to obtain m/s.     
    9498      !!         Note: even though Fwe does not appear explicitly for  
    9599      !!         temperature in this routine, the heat carried by the water 
     
    107111      !! ** Action  : - Update the 1st level of (ta,sa) with the trend associated 
    108112      !!                with the tracer surface boundary condition  
    109       !!              - save the trend it in ttrd ('key_trdtra') 
     113      !!              - send trends to trdtra module (l_trdtra=T) 
    110114      !!---------------------------------------------------------------------- 
    111115      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    112116      !! 
    113117      INTEGER  ::   ji, jj, jk, jn           ! dummy loop indices   
     118      INTEGER  ::   ikt, ikb  
     119      INTEGER  ::   nk_isf 
    114120      REAL(wp) ::   zfact, z1_e3t, zdep 
     121      REAL(wp) ::   zalpha, zhk 
     122      REAL(wp) ::  zt_frz, zpress 
    115123      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds 
    116124      !!---------------------------------------------------------------------- 
     
    124132      ENDIF 
    125133 
    126       IF( l_trdtra )   THEN                    !* Save ta and sa trends 
     134      IF( l_trdtra ) THEN                    !* Save ta and sa trends 
    127135         CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds )  
    128136         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
     
    137145 
    138146      !---------------------------------------- 
    139       !        EMP, EMPS and QNS effects 
     147      !        EMP, SFX and QNS effects 
    140148      !---------------------------------------- 
    141149      !                                          Set before sbc tracer content fields 
     
    146154              & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN 
    147155            IF(lwp) WRITE(numout,*) '          nit000-1 surface tracer content forcing fields red in the restart file' 
    148             zfact = 0.5e0 
     156            zfact = 0.5_wp 
    149157            CALL iom_get( numror, jpdom_autoglo, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem) )   ! before heat content sbc trend 
    150158            CALL iom_get( numror, jpdom_autoglo, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal) )   ! before salt content sbc trend 
    151159         ELSE                                         ! No restart or restart not found: Euler forward time stepping 
    152             zfact = 1.e0 
    153             sbc_tsc_b(:,:,:) = 0.e0 
     160            zfact = 1._wp 
     161            sbc_tsc_b(:,:,:) = 0._wp 
    154162         ENDIF 
    155163      ELSE                                         ! Swap of forcing fields 
    156164         !                                         ! ---------------------- 
    157          zfact = 0.5e0 
     165         zfact = 0.5_wp 
    158166         sbc_tsc_b(:,:,:) = sbc_tsc(:,:,:) 
    159167      ENDIF 
     
    182190            END DO 
    183191         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 
     192         IF( iom_use('emp_x_sst') )   CALL iom_put( "emp_x_sst", emp (:,:) * tsn(:,:,1,jp_tem) )   ! c/d term on sst 
     193         IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * tsn(:,:,1,jp_sal) )   ! c/d term on sss 
    186194      ENDIF 
    187195      ! Concentration dilution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff   
     
    205213      ENDIF 
    206214      ! 
     215      ! 
     216      !---------------------------------------- 
     217      !       Ice Shelf effects (ISF) 
     218      !     tbl treated as in Losh (2008) JGR 
     219      !---------------------------------------- 
     220      ! 
     221      IF( nn_isf > 0 ) THEN 
     222         zfact = 0.5e0 
     223         DO jj = 2, jpj 
     224            DO ji = fs_2, fs_jpim1 
     225          
     226               ikt = misfkt(ji,jj) 
     227               ikb = misfkb(ji,jj) 
     228    
     229               ! level fully include in the ice shelf boundary layer 
     230               ! if isfdiv, we have to remove heat flux due to inflow at 0oC (as in rnf when you add rnf at sst) 
     231               ! sign - because fwf sign of evapo (rnf sign of precip) 
     232               DO jk = ikt, ikb - 1 
     233               ! compute tfreez for the temperature correction (we add water at freezing temperature) 
     234!                  zpress = grav*rau0*fsdept(ji,jj,jk)*1.e-04 
     235                  zt_frz = -1.9 !eos_fzp( tsn(ji,jj,jk,jp_sal), zpress ) 
     236               ! compute trend 
     237                  tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem)                                          & 
     238                     &           + zfact * (risf_tsc_b(ji,jj,jp_tem) + risf_tsc(ji,jj,jp_tem)          & 
     239                     &               - rdivisf * (fwfisf(ji,jj) + fwfisf_b(ji,jj)) * zt_frz * r1_rau0) & 
     240                     &           * r1_hisf_tbl(ji,jj) 
     241                  tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal)                                          & 
     242                     &           + zfact * (risf_tsc_b(ji,jj,jp_sal) + risf_tsc(ji,jj,jp_sal)) * r1_hisf_tbl(ji,jj) 
     243               END DO 
     244    
     245               ! level partially include in ice shelf boundary layer  
     246               ! compute tfreez for the temperature correction (we add water at freezing temperature) 
     247!               zpress = grav*rau0*fsdept(ji,jj,ikb)*1.e-04 
     248               zt_frz = -1.9 !eos_fzp( tsn(ji,jj,ikb,jp_sal), zpress ) 
     249               ! compute trend 
     250               tsa(ji,jj,ikb,jp_tem) = tsa(ji,jj,ikb,jp_tem)                                           & 
     251                  &              + zfact * (risf_tsc_b(ji,jj,jp_tem) + risf_tsc(ji,jj,jp_tem)          & 
     252                  &                  - rdivisf * (fwfisf(ji,jj) + fwfisf_b(ji,jj)) * zt_frz * r1_rau0) &  
     253                  &              * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) 
     254               tsa(ji,jj,ikb,jp_sal) = tsa(ji,jj,ikb,jp_sal)                                           & 
     255                  &              + zfact * (risf_tsc_b(ji,jj,jp_sal) + risf_tsc(ji,jj,jp_sal)) * r1_hisf_tbl(ji,jj) * ralpha(ji,jj)  
     256            END DO 
     257         END DO 
     258         IF( lrst_oce ) THEN 
     259            IF(lwp) WRITE(numout,*) 
     260            IF(lwp) WRITE(numout,*) 'sbc : isf surface tracer content forcing fields written in ocean restart file ',   & 
     261               &                    'at it= ', kt,' date= ', ndastp 
     262            IF(lwp) WRITE(numout,*) '~~~~' 
     263            CALL iom_rstput( kt, nitrst, numrow, 'fwf_isf_b', fwfisf(:,:)          ) 
     264            CALL iom_rstput( kt, nitrst, numrow, 'isf_hc_b' , risf_tsc(:,:,jp_tem) ) 
     265            CALL iom_rstput( kt, nitrst, numrow, 'isf_sc_b' , risf_tsc(:,:,jp_sal) ) 
     266         ENDIF 
     267      END IF 
     268      ! 
    207269      !---------------------------------------- 
    208270      !        River Runoff effects 
     
    226288      ENDIF 
    227289  
    228       IF( l_trdtra )   THEN                      ! save the horizontal diffusive trends for further diagnostics 
     290      IF( l_trdtra )   THEN                      ! send trends for further diagnostics 
    229291         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 
    230292         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 ) 
     293         CALL trd_tra( kt, 'TRA', jp_tem, jptra_nsr, ztrdt ) 
     294         CALL trd_tra( kt, 'TRA', jp_sal, jptra_nsr, ztrds ) 
    233295         CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds )  
    234296      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.