[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 |
---|
[4990] | 21 | USE trd_oce |
---|
[2528] | 22 | USE trdtra |
---|
[941] | 23 | |
---|
| 24 | IMPLICIT NONE |
---|
| 25 | PRIVATE |
---|
| 26 | |
---|
[2715] | 27 | PUBLIC trc_sbc ! routine called by step.F90 |
---|
[941] | 28 | |
---|
| 29 | !! * Substitutions |
---|
| 30 | # include "top_substitute.h90" |
---|
| 31 | !!---------------------------------------------------------------------- |
---|
[2528] | 32 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
[7740] | 33 | !! $Id$ |
---|
[2715] | 34 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[941] | 35 | !!---------------------------------------------------------------------- |
---|
| 36 | CONTAINS |
---|
| 37 | |
---|
| 38 | SUBROUTINE trc_sbc ( kt ) |
---|
| 39 | !!---------------------------------------------------------------------- |
---|
| 40 | !! *** ROUTINE trc_sbc *** |
---|
| 41 | !! |
---|
| 42 | !! ** Purpose : Compute the tracer surface boundary condition trend of |
---|
| 43 | !! (concentration/dilution effect) and add it to the general |
---|
| 44 | !! trend of tracer equations. |
---|
| 45 | !! |
---|
| 46 | !! ** Method : |
---|
| 47 | !! * concentration/dilution effect: |
---|
| 48 | !! The surface freshwater flux modify the ocean volume |
---|
| 49 | !! and thus the concentration of a tracer as : |
---|
| 50 | !! tra = tra + emp * trn / e3t for k=1 |
---|
| 51 | !! where emp, the surface freshwater budget (evaporation minus |
---|
[3680] | 52 | !! precipitation ) given in kg/m2/s is divided |
---|
[1739] | 53 | !! by 1035 kg/m3 (density of ocean water) to obtain m/s. |
---|
[941] | 54 | !! |
---|
| 55 | !! ** Action : - Update the 1st level of tra with the trend associated |
---|
| 56 | !! with the tracer surface boundary condition |
---|
| 57 | !! |
---|
| 58 | !!---------------------------------------------------------------------- |
---|
[2715] | 59 | ! |
---|
[941] | 60 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
[2715] | 61 | ! |
---|
[941] | 62 | INTEGER :: ji, jj, jn ! dummy loop indices |
---|
[2528] | 63 | REAL(wp) :: zsrau, zse3t ! temporary scalars |
---|
[941] | 64 | CHARACTER (len=22) :: charout |
---|
[3625] | 65 | REAL(wp), POINTER, DIMENSION(:,: ) :: zsfx |
---|
[3294] | 66 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd |
---|
| 67 | !!--------------------------------------------------------------------- |
---|
| 68 | ! |
---|
| 69 | IF( nn_timing == 1 ) CALL timing_start('trc_sbc') |
---|
| 70 | ! |
---|
| 71 | ! Allocate temporary workspace |
---|
[3625] | 72 | CALL wrk_alloc( jpi, jpj, zsfx ) |
---|
[3294] | 73 | IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrtrd ) |
---|
[941] | 74 | |
---|
[3294] | 75 | IF( kt == nittrc000 ) THEN |
---|
[941] | 76 | IF(lwp) WRITE(numout,*) |
---|
| 77 | IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' |
---|
| 78 | IF(lwp) WRITE(numout,*) '~~~~~~~ ' |
---|
| 79 | ENDIF |
---|
| 80 | |
---|
[3680] | 81 | ! Coupling online : river runoff is added to the horizontal divergence (hdivn) in the subroutine sbc_rnf_div |
---|
| 82 | ! one only consider the concentration/dilution effect due to evaporation minus precipitation + freezing/melting of sea-ice |
---|
[3719] | 83 | ! Coupling offline : runoff are in emp which contains E-P-R |
---|
| 84 | ! |
---|
| 85 | IF( .NOT. lk_offline .AND. lk_vvl ) THEN ! online coupling with vvl |
---|
| 86 | zsfx(:,:) = 0._wp |
---|
| 87 | ELSE ! online coupling free surface or offline with free surface |
---|
[3681] | 88 | zsfx(:,:) = emp(:,:) |
---|
[3680] | 89 | ENDIF |
---|
[2528] | 90 | |
---|
[941] | 91 | ! 0. initialization |
---|
[1739] | 92 | zsrau = 1. / rau0 |
---|
[941] | 93 | DO jn = 1, jptra |
---|
[2528] | 94 | ! |
---|
[1175] | 95 | IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) ! save trends |
---|
[2528] | 96 | ! ! add the trend to the general tracer trend |
---|
[941] | 97 | DO jj = 2, jpj |
---|
| 98 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[2528] | 99 | zse3t = 1. / fse3t(ji,jj,1) |
---|
[3625] | 100 | tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zsfx(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t |
---|
[941] | 101 | END DO |
---|
| 102 | END DO |
---|
| 103 | |
---|
[1175] | 104 | IF( l_trdtrc ) THEN |
---|
| 105 | ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) |
---|
[4990] | 106 | CALL trd_tra( kt, 'TRC', jn, jptra_nsr, ztrtrd ) |
---|
[1175] | 107 | END IF |
---|
| 108 | ! ! =========== |
---|
| 109 | END DO ! tracer loop |
---|
| 110 | ! ! =========== |
---|
[2528] | 111 | IF( ln_ctl ) THEN |
---|
| 112 | WRITE(charout, FMT="('sbc ')") ; CALL prt_ctl_trc_info(charout) |
---|
| 113 | CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) |
---|
[941] | 114 | ENDIF |
---|
[3625] | 115 | CALL wrk_dealloc( jpi, jpj, zsfx ) |
---|
[3294] | 116 | IF( l_trdtrc ) CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd ) |
---|
| 117 | ! |
---|
| 118 | IF( nn_timing == 1 ) CALL timing_stop('trc_sbc') |
---|
| 119 | ! |
---|
[941] | 120 | END SUBROUTINE trc_sbc |
---|
| 121 | |
---|
| 122 | #else |
---|
| 123 | !!---------------------------------------------------------------------- |
---|
| 124 | !! Dummy module : NO passive tracer |
---|
| 125 | !!---------------------------------------------------------------------- |
---|
| 126 | CONTAINS |
---|
| 127 | SUBROUTINE trc_sbc (kt) ! Empty routine |
---|
| 128 | INTEGER, INTENT(in) :: kt |
---|
| 129 | WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt |
---|
| 130 | END SUBROUTINE trc_sbc |
---|
| 131 | #endif |
---|
| 132 | |
---|
| 133 | !!====================================================================== |
---|
| 134 | END MODULE trcsbc |
---|