[941] | 1 | MODULE trcsbc |
---|
| 2 | !!============================================================================== |
---|
| 3 | !! *** MODULE trcsbc *** |
---|
| 4 | !! Ocean passive tracers: surface boundary condition |
---|
[1175] | 5 | !!====================================================================== |
---|
[2528] | 6 | !! History : 8.2 ! 1998-10 (G. Madec, G. Roullet, M. Imbard) Original code |
---|
| 7 | !! 8.2 ! 2001-02 (D. Ludicone) sea ice and free surface |
---|
| 8 | !! 8.5 ! 2002-06 (G. Madec) F90: Free form and module |
---|
| 9 | !! 9.0 ! 2004-03 (C. Ethe) adapted for passive tracers |
---|
| 10 | !! ! 2006-08 (C. Deltel) Diagnose ML trends for passive tracers |
---|
[941] | 11 | !!============================================================================== |
---|
| 12 | #if defined key_top |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
| 14 | !! 'key_top' TOP models |
---|
| 15 | !!---------------------------------------------------------------------- |
---|
| 16 | !! trc_sbc : update the tracer trend at ocean surface |
---|
| 17 | !!---------------------------------------------------------------------- |
---|
[2715] | 18 | USE oce_trc ! ocean dynamics and active tracers variables |
---|
| 19 | USE trc ! ocean passive tracers variables |
---|
| 20 | USE prtctl_trc ! Print control for debbuging |
---|
[5385] | 21 | USE iom |
---|
[4990] | 22 | USE trd_oce |
---|
[2528] | 23 | USE trdtra |
---|
[941] | 24 | |
---|
| 25 | IMPLICIT NONE |
---|
| 26 | PRIVATE |
---|
| 27 | |
---|
[2715] | 28 | PUBLIC trc_sbc ! routine called by step.F90 |
---|
[941] | 29 | |
---|
[5385] | 30 | REAL(wp) :: r2dt ! time-step at surface |
---|
| 31 | |
---|
[941] | 32 | !! * Substitutions |
---|
| 33 | # include "top_substitute.h90" |
---|
| 34 | !!---------------------------------------------------------------------- |
---|
[2528] | 35 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
[7470] | 36 | !! $Id$ |
---|
[2715] | 37 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[941] | 38 | !!---------------------------------------------------------------------- |
---|
| 39 | CONTAINS |
---|
| 40 | |
---|
| 41 | SUBROUTINE trc_sbc ( kt ) |
---|
| 42 | !!---------------------------------------------------------------------- |
---|
| 43 | !! *** ROUTINE trc_sbc *** |
---|
| 44 | !! |
---|
| 45 | !! ** Purpose : Compute the tracer surface boundary condition trend of |
---|
| 46 | !! (concentration/dilution effect) and add it to the general |
---|
| 47 | !! trend of tracer equations. |
---|
| 48 | !! |
---|
| 49 | !! ** Method : |
---|
| 50 | !! * concentration/dilution effect: |
---|
| 51 | !! The surface freshwater flux modify the ocean volume |
---|
| 52 | !! and thus the concentration of a tracer as : |
---|
| 53 | !! tra = tra + emp * trn / e3t for k=1 |
---|
| 54 | !! where emp, the surface freshwater budget (evaporation minus |
---|
[3680] | 55 | !! precipitation ) given in kg/m2/s is divided |
---|
[1739] | 56 | !! by 1035 kg/m3 (density of ocean water) to obtain m/s. |
---|
[941] | 57 | !! |
---|
| 58 | !! ** Action : - Update the 1st level of tra with the trend associated |
---|
| 59 | !! with the tracer surface boundary condition |
---|
| 60 | !! |
---|
| 61 | !!---------------------------------------------------------------------- |
---|
[2715] | 62 | ! |
---|
[941] | 63 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
[2715] | 64 | ! |
---|
[5385] | 65 | INTEGER :: ji, jj, jn ! dummy loop indices |
---|
| 66 | REAL(wp) :: zse3t, zrtrn, zratio, zfact ! temporary scalars |
---|
| 67 | REAL(wp) :: zswitch, zftra, zcd, zdtra, ztfx, ztra ! temporary scalars |
---|
[941] | 68 | CHARACTER (len=22) :: charout |
---|
[3625] | 69 | REAL(wp), POINTER, DIMENSION(:,: ) :: zsfx |
---|
[3294] | 70 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd |
---|
[5385] | 71 | |
---|
[3294] | 72 | !!--------------------------------------------------------------------- |
---|
| 73 | ! |
---|
| 74 | IF( nn_timing == 1 ) CALL timing_start('trc_sbc') |
---|
| 75 | ! |
---|
| 76 | ! Allocate temporary workspace |
---|
[3625] | 77 | CALL wrk_alloc( jpi, jpj, zsfx ) |
---|
[3294] | 78 | IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrtrd ) |
---|
[5385] | 79 | ! |
---|
| 80 | zrtrn = 1.e-15_wp |
---|
[941] | 81 | |
---|
[5385] | 82 | SELECT CASE( nn_ice_embd ) ! levitating or embedded sea-ice option |
---|
| 83 | CASE( 0 ) ; zswitch = 1 ! (0) standard levitating sea-ice : salt exchange only |
---|
| 84 | CASE( 1, 2 ) ; zswitch = 0 ! (1) levitating sea-ice: salt and volume exchange but no pressure effect |
---|
| 85 | ! (2) embedded sea-ice : salt and volume fluxes and pressure |
---|
| 86 | END SELECT |
---|
| 87 | |
---|
| 88 | IF( ln_top_euler) THEN |
---|
| 89 | r2dt = rdttrc(1) ! = rdttrc (use Euler time stepping) |
---|
| 90 | ELSE |
---|
| 91 | IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! at nittrc000 |
---|
| 92 | r2dt = rdttrc(1) ! = rdttrc (restarting with Euler time stepping) |
---|
| 93 | ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN ! at nittrc000 or nittrc000+1 |
---|
| 94 | r2dt = 2. * rdttrc(1) ! = 2 rdttrc (leapfrog) |
---|
| 95 | ENDIF |
---|
| 96 | ENDIF |
---|
| 97 | |
---|
| 98 | |
---|
[3294] | 99 | IF( kt == nittrc000 ) THEN |
---|
[941] | 100 | IF(lwp) WRITE(numout,*) |
---|
| 101 | IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' |
---|
| 102 | IF(lwp) WRITE(numout,*) '~~~~~~~ ' |
---|
[5385] | 103 | |
---|
| 104 | IF( ln_rsttr .AND. & ! Restart: read in restart file |
---|
| 105 | iom_varid( numrtr, 'sbc_'//TRIM(ctrcnm(1))//'_b', ldstop = .FALSE. ) > 0 ) THEN |
---|
| 106 | IF(lwp) WRITE(numout,*) ' nittrc000-nn_dttrc surface tracer content forcing fields red in the restart file' |
---|
| 107 | zfact = 0.5_wp |
---|
| 108 | DO jn = 1, jptra |
---|
| 109 | CALL iom_get( numrtr, jpdom_autoglo, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc_b(:,:,jn) ) ! before tracer content sbc |
---|
| 110 | END DO |
---|
| 111 | ELSE ! No restart or restart not found: Euler forward time stepping |
---|
| 112 | zfact = 1._wp |
---|
| 113 | sbc_trc_b(:,:,:) = 0._wp |
---|
| 114 | ENDIF |
---|
| 115 | ELSE ! Swap of forcing fields |
---|
| 116 | IF( ln_top_euler ) THEN |
---|
| 117 | zfact = 1._wp |
---|
| 118 | sbc_trc_b(:,:,:) = 0._wp |
---|
| 119 | ELSE |
---|
| 120 | zfact = 0.5_wp |
---|
| 121 | sbc_trc_b(:,:,:) = sbc_trc(:,:,:) |
---|
| 122 | ENDIF |
---|
| 123 | ! |
---|
[941] | 124 | ENDIF |
---|
| 125 | |
---|
[3680] | 126 | ! Coupling online : river runoff is added to the horizontal divergence (hdivn) in the subroutine sbc_rnf_div |
---|
| 127 | ! one only consider the concentration/dilution effect due to evaporation minus precipitation + freezing/melting of sea-ice |
---|
[3719] | 128 | ! Coupling offline : runoff are in emp which contains E-P-R |
---|
| 129 | ! |
---|
| 130 | IF( .NOT. lk_offline .AND. lk_vvl ) THEN ! online coupling with vvl |
---|
| 131 | zsfx(:,:) = 0._wp |
---|
| 132 | ELSE ! online coupling free surface or offline with free surface |
---|
[3681] | 133 | zsfx(:,:) = emp(:,:) |
---|
[3680] | 134 | ENDIF |
---|
[2528] | 135 | |
---|
[941] | 136 | ! 0. initialization |
---|
| 137 | DO jn = 1, jptra |
---|
[2528] | 138 | ! |
---|
[1175] | 139 | IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) ! save trends |
---|
[2528] | 140 | ! ! add the trend to the general tracer trend |
---|
[5385] | 141 | |
---|
| 142 | IF ( nn_ice_tr == -1 ) THEN ! No tracers in sea ice (null concentration in sea ice) |
---|
| 143 | |
---|
| 144 | DO jj = 2, jpj |
---|
| 145 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
| 146 | sbc_trc(ji,jj,jn) = zsfx(ji,jj) * r1_rau0 * trn(ji,jj,1,jn) |
---|
| 147 | END DO |
---|
| 148 | END DO |
---|
| 149 | |
---|
| 150 | ELSE |
---|
| 151 | |
---|
| 152 | DO jj = 2, jpj |
---|
| 153 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
| 154 | zse3t = 1. / fse3t(ji,jj,1) |
---|
| 155 | ! tracer flux at the ice/ocean interface (tracer/m2/s) |
---|
| 156 | zftra = - trc_i(ji,jj,jn) * fmmflx(ji,jj) ! uptake of tracer in the sea ice |
---|
| 157 | zcd = trc_o(ji,jj,jn) * fmmflx(ji,jj) ! concentration dilution due to freezing-melting, |
---|
| 158 | ! only used in the levitating sea ice case |
---|
| 159 | ! tracer flux only : add concentration dilution term in net tracer flux, no F-M in volume flux |
---|
| 160 | ! tracer and mass fluxes : no concentration dilution term in net tracer flux, F-M term in volume flux |
---|
| 161 | ztfx = zftra + zswitch * zcd ! net tracer flux (+C/D if no ice/ocean mass exchange) |
---|
| 162 | |
---|
| 163 | zdtra = r1_rau0 * ( ztfx + zsfx(ji,jj) * trn(ji,jj,1,jn) ) |
---|
| 164 | IF ( zdtra < 0. ) THEN |
---|
| 165 | zratio = -zdtra * zse3t * r2dt / ( trn(ji,jj,1,jn) + zrtrn ) |
---|
| 166 | zdtra = MIN(1.0, zratio) * zdtra ! avoid negative concentrations to arise |
---|
| 167 | ENDIF |
---|
| 168 | sbc_trc(ji,jj,jn) = zdtra |
---|
| 169 | END DO |
---|
| 170 | END DO |
---|
| 171 | ENDIF |
---|
| 172 | ! Concentration dilution effect on tracers due to evaporation & precipitation |
---|
[941] | 173 | DO jj = 2, jpj |
---|
| 174 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[5385] | 175 | zse3t = zfact / fse3t(ji,jj,1) |
---|
| 176 | tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ( sbc_trc_b(ji,jj,jn) + sbc_trc(ji,jj,jn) ) * zse3t |
---|
[941] | 177 | END DO |
---|
| 178 | END DO |
---|
[5385] | 179 | ! |
---|
[1175] | 180 | IF( l_trdtrc ) THEN |
---|
| 181 | ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) |
---|
[4990] | 182 | CALL trd_tra( kt, 'TRC', jn, jptra_nsr, ztrtrd ) |
---|
[1175] | 183 | END IF |
---|
| 184 | ! ! =========== |
---|
| 185 | END DO ! tracer loop |
---|
| 186 | ! ! =========== |
---|
[5385] | 187 | |
---|
| 188 | ! Write in the tracer restar file |
---|
| 189 | ! ******************************* |
---|
| 190 | IF( lrst_trc ) THEN |
---|
| 191 | IF(lwp) WRITE(numout,*) |
---|
| 192 | IF(lwp) WRITE(numout,*) 'sbc : ocean surface tracer content forcing fields written in tracer restart file ', & |
---|
| 193 | & 'at it= ', kt,' date= ', ndastp |
---|
| 194 | IF(lwp) WRITE(numout,*) '~~~~' |
---|
| 195 | DO jn = 1, jptra |
---|
| 196 | CALL iom_rstput( kt, nitrst, numrtw, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc(:,:,jn) ) |
---|
| 197 | END DO |
---|
| 198 | ENDIF |
---|
| 199 | ! |
---|
[2528] | 200 | IF( ln_ctl ) THEN |
---|
| 201 | WRITE(charout, FMT="('sbc ')") ; CALL prt_ctl_trc_info(charout) |
---|
| 202 | CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) |
---|
[941] | 203 | ENDIF |
---|
[3625] | 204 | CALL wrk_dealloc( jpi, jpj, zsfx ) |
---|
[3294] | 205 | IF( l_trdtrc ) CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd ) |
---|
| 206 | ! |
---|
| 207 | IF( nn_timing == 1 ) CALL timing_stop('trc_sbc') |
---|
| 208 | ! |
---|
[941] | 209 | END SUBROUTINE trc_sbc |
---|
| 210 | |
---|
| 211 | #else |
---|
| 212 | !!---------------------------------------------------------------------- |
---|
| 213 | !! Dummy module : NO passive tracer |
---|
| 214 | !!---------------------------------------------------------------------- |
---|
| 215 | CONTAINS |
---|
| 216 | SUBROUTINE trc_sbc (kt) ! Empty routine |
---|
| 217 | INTEGER, INTENT(in) :: kt |
---|
| 218 | WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt |
---|
| 219 | END SUBROUTINE trc_sbc |
---|
| 220 | #endif |
---|
| 221 | |
---|
| 222 | !!====================================================================== |
---|
| 223 | END MODULE trcsbc |
---|