[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 | |
---|
| 30 | !! * Substitutions |
---|
[5836] | 31 | # include "vectopt_loop_substitute.h90" |
---|
[941] | 32 | !!---------------------------------------------------------------------- |
---|
[9598] | 33 | !! NEMO/TOP 3.3 , NEMO Consortium (2018) |
---|
[9900] | 34 | !! $Id$ |
---|
[9598] | 35 | !! Software governed by the CeCILL licence (./LICENSE) |
---|
[941] | 36 | !!---------------------------------------------------------------------- |
---|
| 37 | CONTAINS |
---|
| 38 | |
---|
| 39 | SUBROUTINE trc_sbc ( kt ) |
---|
| 40 | !!---------------------------------------------------------------------- |
---|
| 41 | !! *** ROUTINE trc_sbc *** |
---|
| 42 | !! |
---|
| 43 | !! ** Purpose : Compute the tracer surface boundary condition trend of |
---|
| 44 | !! (concentration/dilution effect) and add it to the general |
---|
| 45 | !! trend of tracer equations. |
---|
| 46 | !! |
---|
| 47 | !! ** Method : |
---|
| 48 | !! * concentration/dilution effect: |
---|
| 49 | !! The surface freshwater flux modify the ocean volume |
---|
| 50 | !! and thus the concentration of a tracer as : |
---|
| 51 | !! tra = tra + emp * trn / e3t for k=1 |
---|
| 52 | !! where emp, the surface freshwater budget (evaporation minus |
---|
[3680] | 53 | !! precipitation ) given in kg/m2/s is divided |
---|
[1739] | 54 | !! by 1035 kg/m3 (density of ocean water) to obtain m/s. |
---|
[941] | 55 | !! |
---|
| 56 | !! ** Action : - Update the 1st level of tra with the trend associated |
---|
| 57 | !! with the tracer surface boundary condition |
---|
| 58 | !! |
---|
| 59 | !!---------------------------------------------------------------------- |
---|
[9019] | 60 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
[2715] | 61 | ! |
---|
[9019] | 62 | INTEGER :: ji, jj, jn ! dummy loop indices |
---|
| 63 | REAL(wp) :: zse3t, zrtrn, zratio, zfact ! local scalars |
---|
| 64 | REAL(wp) :: zftra, zcd, zdtra, ztfx, ztra ! - - |
---|
[941] | 65 | CHARACTER (len=22) :: charout |
---|
[9125] | 66 | REAL(wp), DIMENSION(jpi,jpj) :: zsfx |
---|
| 67 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrtrd |
---|
[3294] | 68 | !!--------------------------------------------------------------------- |
---|
| 69 | ! |
---|
[9124] | 70 | IF( ln_timing ) CALL timing_start('trc_sbc') |
---|
[3294] | 71 | ! |
---|
| 72 | ! Allocate temporary workspace |
---|
[9125] | 73 | IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) |
---|
[5385] | 74 | ! |
---|
| 75 | zrtrn = 1.e-15_wp |
---|
[941] | 76 | |
---|
[3294] | 77 | IF( kt == nittrc000 ) THEN |
---|
[941] | 78 | IF(lwp) WRITE(numout,*) |
---|
| 79 | IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' |
---|
| 80 | IF(lwp) WRITE(numout,*) '~~~~~~~ ' |
---|
[9019] | 81 | ! |
---|
[6942] | 82 | IF( ln_rsttr .AND. .NOT.ln_top_euler .AND. & ! Restart: read in restart file |
---|
[5385] | 83 | iom_varid( numrtr, 'sbc_'//TRIM(ctrcnm(1))//'_b', ldstop = .FALSE. ) > 0 ) THEN |
---|
| 84 | IF(lwp) WRITE(numout,*) ' nittrc000-nn_dttrc surface tracer content forcing fields red in the restart file' |
---|
| 85 | zfact = 0.5_wp |
---|
| 86 | DO jn = 1, jptra |
---|
| 87 | CALL iom_get( numrtr, jpdom_autoglo, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc_b(:,:,jn) ) ! before tracer content sbc |
---|
| 88 | END DO |
---|
| 89 | ELSE ! No restart or restart not found: Euler forward time stepping |
---|
| 90 | zfact = 1._wp |
---|
[7753] | 91 | sbc_trc_b(:,:,:) = 0._wp |
---|
[5385] | 92 | ENDIF |
---|
| 93 | ELSE ! Swap of forcing fields |
---|
| 94 | IF( ln_top_euler ) THEN |
---|
| 95 | zfact = 1._wp |
---|
[7753] | 96 | sbc_trc_b(:,:,:) = 0._wp |
---|
[5385] | 97 | ELSE |
---|
| 98 | zfact = 0.5_wp |
---|
[7753] | 99 | sbc_trc_b(:,:,:) = sbc_trc(:,:,:) |
---|
[5385] | 100 | ENDIF |
---|
| 101 | ! |
---|
[941] | 102 | ENDIF |
---|
| 103 | |
---|
[3680] | 104 | ! Coupling online : river runoff is added to the horizontal divergence (hdivn) in the subroutine sbc_rnf_div |
---|
| 105 | ! one only consider the concentration/dilution effect due to evaporation minus precipitation + freezing/melting of sea-ice |
---|
[3719] | 106 | ! Coupling offline : runoff are in emp which contains E-P-R |
---|
| 107 | ! |
---|
[7646] | 108 | IF( .NOT.ln_linssh ) THEN ! online coupling with vvl |
---|
[7753] | 109 | zsfx(:,:) = 0._wp |
---|
[3719] | 110 | ELSE ! online coupling free surface or offline with free surface |
---|
[7753] | 111 | zsfx(:,:) = emp(:,:) |
---|
[3680] | 112 | ENDIF |
---|
[2528] | 113 | |
---|
[941] | 114 | ! 0. initialization |
---|
| 115 | DO jn = 1, jptra |
---|
[2528] | 116 | ! |
---|
[7753] | 117 | IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) ! save trends |
---|
[9019] | 118 | ! |
---|
| 119 | IF( nn_ice_tr == -1 ) THEN ! No tracers in sea ice (null concentration in sea ice) |
---|
[5385] | 120 | DO jj = 2, jpj |
---|
| 121 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
| 122 | sbc_trc(ji,jj,jn) = zsfx(ji,jj) * r1_rau0 * trn(ji,jj,1,jn) |
---|
| 123 | END DO |
---|
| 124 | END DO |
---|
| 125 | ELSE |
---|
| 126 | DO jj = 2, jpj |
---|
| 127 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[6140] | 128 | zse3t = 1. / e3t_n(ji,jj,1) |
---|
[5385] | 129 | ! tracer flux at the ice/ocean interface (tracer/m2/s) |
---|
| 130 | zftra = - trc_i(ji,jj,jn) * fmmflx(ji,jj) ! uptake of tracer in the sea ice |
---|
| 131 | zcd = trc_o(ji,jj,jn) * fmmflx(ji,jj) ! concentration dilution due to freezing-melting, |
---|
[9019] | 132 | ! ! only used in the levitating sea ice case |
---|
[5385] | 133 | ! tracer flux only : add concentration dilution term in net tracer flux, no F-M in volume flux |
---|
| 134 | ! tracer and mass fluxes : no concentration dilution term in net tracer flux, F-M term in volume flux |
---|
[9019] | 135 | ztfx = zftra ! net tracer flux |
---|
| 136 | ! |
---|
[5385] | 137 | zdtra = r1_rau0 * ( ztfx + zsfx(ji,jj) * trn(ji,jj,1,jn) ) |
---|
| 138 | IF ( zdtra < 0. ) THEN |
---|
[7646] | 139 | zratio = -zdtra * zse3t * r2dttrc / ( trn(ji,jj,1,jn) + zrtrn ) |
---|
[5385] | 140 | zdtra = MIN(1.0, zratio) * zdtra ! avoid negative concentrations to arise |
---|
| 141 | ENDIF |
---|
| 142 | sbc_trc(ji,jj,jn) = zdtra |
---|
| 143 | END DO |
---|
| 144 | END DO |
---|
| 145 | ENDIF |
---|
[6309] | 146 | ! |
---|
| 147 | CALL lbc_lnk( sbc_trc(:,:,jn), 'T', 1. ) |
---|
[5385] | 148 | ! Concentration dilution effect on tracers due to evaporation & precipitation |
---|
[941] | 149 | DO jj = 2, jpj |
---|
| 150 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[6140] | 151 | zse3t = zfact / e3t_n(ji,jj,1) |
---|
[5385] | 152 | tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ( sbc_trc_b(ji,jj,jn) + sbc_trc(ji,jj,jn) ) * zse3t |
---|
[941] | 153 | END DO |
---|
| 154 | END DO |
---|
[5385] | 155 | ! |
---|
[1175] | 156 | IF( l_trdtrc ) THEN |
---|
[7753] | 157 | ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) |
---|
[4990] | 158 | CALL trd_tra( kt, 'TRC', jn, jptra_nsr, ztrtrd ) |
---|
[1175] | 159 | END IF |
---|
| 160 | ! ! =========== |
---|
| 161 | END DO ! tracer loop |
---|
| 162 | ! ! =========== |
---|
[9019] | 163 | ! |
---|
[5385] | 164 | ! Write in the tracer restar file |
---|
| 165 | ! ******************************* |
---|
[6942] | 166 | IF( lrst_trc .AND. .NOT.ln_top_euler ) THEN |
---|
[5385] | 167 | IF(lwp) WRITE(numout,*) |
---|
| 168 | IF(lwp) WRITE(numout,*) 'sbc : ocean surface tracer content forcing fields written in tracer restart file ', & |
---|
| 169 | & 'at it= ', kt,' date= ', ndastp |
---|
| 170 | IF(lwp) WRITE(numout,*) '~~~~' |
---|
| 171 | DO jn = 1, jptra |
---|
| 172 | CALL iom_rstput( kt, nitrst, numrtw, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc(:,:,jn) ) |
---|
| 173 | END DO |
---|
| 174 | ENDIF |
---|
| 175 | ! |
---|
[2528] | 176 | IF( ln_ctl ) THEN |
---|
| 177 | WRITE(charout, FMT="('sbc ')") ; CALL prt_ctl_trc_info(charout) |
---|
| 178 | CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) |
---|
[941] | 179 | ENDIF |
---|
[9125] | 180 | IF( l_trdtrc ) DEALLOCATE( ztrtrd ) |
---|
[3294] | 181 | ! |
---|
[9124] | 182 | IF( ln_timing ) CALL timing_stop('trc_sbc') |
---|
[3294] | 183 | ! |
---|
[941] | 184 | END SUBROUTINE trc_sbc |
---|
| 185 | |
---|
| 186 | #else |
---|
| 187 | !!---------------------------------------------------------------------- |
---|
| 188 | !! Dummy module : NO passive tracer |
---|
| 189 | !!---------------------------------------------------------------------- |
---|
| 190 | CONTAINS |
---|
| 191 | SUBROUTINE trc_sbc (kt) ! Empty routine |
---|
| 192 | INTEGER, INTENT(in) :: kt |
---|
| 193 | WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt |
---|
| 194 | END SUBROUTINE trc_sbc |
---|
| 195 | #endif |
---|
| 196 | |
---|
| 197 | !!====================================================================== |
---|
| 198 | END MODULE trcsbc |
---|