[3] | 1 | MODULE trasbc |
---|
| 2 | !!============================================================================== |
---|
| 3 | !! *** MODULE trasbc *** |
---|
| 4 | !! Ocean active tracers: surface boundary condition |
---|
| 5 | !!============================================================================== |
---|
[2528] | 6 | !! History : OPA ! 1998-10 (G. Madec, G. Roullet, M. Imbard) Original code |
---|
| 7 | !! 8.2 ! 2001-02 (D. Ludicone) sea ice and free surface |
---|
| 8 | !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module |
---|
| 9 | !! 3.3 ! 2010-04 (M. Leclair, G. Madec) Forcing averaged over 2 time steps |
---|
| 10 | !! - ! 2010-09 (C. Ethe, G. Madec) Merge TRA-TRC |
---|
[3] | 11 | !!---------------------------------------------------------------------- |
---|
[503] | 12 | |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
[3] | 14 | !! tra_sbc : update the tracer trend at ocean surface |
---|
| 15 | !!---------------------------------------------------------------------- |
---|
| 16 | USE oce ! ocean dynamics and active tracers |
---|
[888] | 17 | USE sbc_oce ! surface boundary condition: ocean |
---|
[3] | 18 | USE dom_oce ! ocean space domain variables |
---|
| 19 | USE phycst ! physical constant |
---|
[216] | 20 | USE traqsr ! solar radiation penetration |
---|
[2528] | 21 | USE trdmod_oce ! ocean trends |
---|
| 22 | USE trdtra ! ocean trends |
---|
[3] | 23 | USE in_out_manager ! I/O manager |
---|
[258] | 24 | USE prtctl ! Print control |
---|
[2528] | 25 | USE sbcrnf ! River runoff |
---|
| 26 | USE sbcmod ! ln_rnf |
---|
| 27 | USE iom |
---|
| 28 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
[3294] | 29 | USE wrk_nemo ! Memory Allocation |
---|
| 30 | USE timing ! Timing |
---|
[3] | 31 | |
---|
| 32 | IMPLICIT NONE |
---|
| 33 | PRIVATE |
---|
| 34 | |
---|
[503] | 35 | PUBLIC tra_sbc ! routine called by step.F90 |
---|
[3] | 36 | |
---|
| 37 | !! * Substitutions |
---|
| 38 | # include "domzgr_substitute.h90" |
---|
| 39 | # include "vectopt_loop_substitute.h90" |
---|
| 40 | !!---------------------------------------------------------------------- |
---|
[2528] | 41 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
[888] | 42 | !! $Id$ |
---|
[2715] | 43 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[3] | 44 | !!---------------------------------------------------------------------- |
---|
| 45 | CONTAINS |
---|
| 46 | |
---|
| 47 | SUBROUTINE tra_sbc ( kt ) |
---|
| 48 | !!---------------------------------------------------------------------- |
---|
| 49 | !! *** ROUTINE tra_sbc *** |
---|
| 50 | !! |
---|
| 51 | !! ** Purpose : Compute the tracer surface boundary condition trend of |
---|
| 52 | !! (flux through the interface, concentration/dilution effect) |
---|
| 53 | !! and add it to the general trend of tracer equations. |
---|
| 54 | !! |
---|
| 55 | !! ** Method : |
---|
[664] | 56 | !! Following Roullet and Madec (2000), the air-sea flux can be divided |
---|
| 57 | !! into three effects: (1) Fext, external forcing; |
---|
| 58 | !! (2) Fwi, concentration/dilution effect due to water exchanged |
---|
| 59 | !! at the surface by evaporation, precipitations and runoff (E-P-R); |
---|
| 60 | !! (3) Fwe, tracer carried with the water that is exchanged. |
---|
[3625] | 61 | !! - salinity : salt flux only due to freezing/melting |
---|
| 62 | !! sa = sa + sfx / rau0 / e3t for k=1 |
---|
[664] | 63 | !! |
---|
| 64 | !! Fext, flux through the air-sea interface for temperature and salt: |
---|
[3] | 65 | !! - temperature : heat flux q (w/m2). If penetrative solar |
---|
| 66 | !! radiation q is only the non solar part of the heat flux, the |
---|
| 67 | !! solar part is added in traqsr.F routine. |
---|
| 68 | !! ta = ta + q /(rau0 rcp e3t) for k=1 |
---|
| 69 | !! - salinity : no salt flux |
---|
[664] | 70 | !! |
---|
| 71 | !! The formulation for Fwb and Fwi vary according to the free |
---|
| 72 | !! surface formulation (linear or variable volume). |
---|
| 73 | !! * Linear free surface |
---|
| 74 | !! The surface freshwater flux modifies the ocean volume |
---|
[3] | 75 | !! and thus the concentration of a tracer and the temperature. |
---|
| 76 | !! First order of the effect of surface freshwater exchange |
---|
| 77 | !! for salinity, it can be neglected on temperature (especially |
---|
[664] | 78 | !! as the temperature of precipitations and runoffs is usually |
---|
| 79 | !! unknown). |
---|
[3] | 80 | !! - temperature : we assume that the temperature of both |
---|
| 81 | !! precipitations and runoffs is equal to the SST, thus there |
---|
| 82 | !! is no additional flux since in this case, the concentration |
---|
| 83 | !! dilution effect is balanced by the net heat flux associated |
---|
[664] | 84 | !! to the freshwater exchange (Fwe+Fwi=0): |
---|
| 85 | !! (Tp P - Te E) + SST (P-E) = 0 when Tp=Te=SST |
---|
[3] | 86 | !! - salinity : evaporation, precipitation and runoff |
---|
[3625] | 87 | !! water has a zero salinity but there is a salt flux due to |
---|
| 88 | !! freezing/melting, thus: |
---|
| 89 | !! sa = sa + emp * sn / rau0 / e3t for k=1 |
---|
| 90 | !! + sfx / rau0 / e3t |
---|
[3] | 91 | !! where emp, the surface freshwater budget (evaporation minus |
---|
| 92 | !! precipitation minus runoff) given in kg/m2/s is divided |
---|
[3625] | 93 | !! by rau0 = 1020 kg/m3 (density of sea water) to obtain m/s. |
---|
[664] | 94 | !! Note: even though Fwe does not appear explicitly for |
---|
| 95 | !! temperature in this routine, the heat carried by the water |
---|
| 96 | !! exchanged through the surface is part of the total heat flux |
---|
| 97 | !! forcing and must be taken into account in the global heat |
---|
| 98 | !! balance). |
---|
| 99 | !! * nonlinear free surface (variable volume, lk_vvl) |
---|
| 100 | !! contrary to the linear free surface case, Fwi is properly |
---|
| 101 | !! taken into account by using the true layer thicknesses to |
---|
| 102 | !! calculate tracer content and advection. There is no need to |
---|
| 103 | !! deal with it in this routine. |
---|
| 104 | !! - temperature: Fwe=SST (P-E+R) is added to Fext. |
---|
| 105 | !! - salinity: Fwe = 0, there is no surface flux of salt. |
---|
[3] | 106 | !! |
---|
| 107 | !! ** Action : - Update the 1st level of (ta,sa) with the trend associated |
---|
| 108 | !! with the tracer surface boundary condition |
---|
| 109 | !! - save the trend it in ttrd ('key_trdtra') |
---|
[503] | 110 | !!---------------------------------------------------------------------- |
---|
[2528] | 111 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
[3] | 112 | !! |
---|
[2528] | 113 | INTEGER :: ji, jj, jk, jn ! dummy loop indices |
---|
[3625] | 114 | REAL(wp) :: zfact, z1_e3t, zdep |
---|
[3294] | 115 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdt, ztrds |
---|
[3] | 116 | !!---------------------------------------------------------------------- |
---|
[3294] | 117 | ! |
---|
| 118 | IF( nn_timing == 1 ) CALL timing_start('tra_sbc') |
---|
| 119 | ! |
---|
[3] | 120 | IF( kt == nit000 ) THEN |
---|
| 121 | IF(lwp) WRITE(numout,*) |
---|
| 122 | IF(lwp) WRITE(numout,*) 'tra_sbc : TRAcer Surface Boundary Condition' |
---|
| 123 | IF(lwp) WRITE(numout,*) '~~~~~~~ ' |
---|
| 124 | ENDIF |
---|
| 125 | |
---|
[2528] | 126 | IF( l_trdtra ) THEN !* Save ta and sa trends |
---|
[3294] | 127 | CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) |
---|
| 128 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) |
---|
| 129 | ztrds(:,:,:) = tsa(:,:,:,jp_sal) |
---|
[216] | 130 | ENDIF |
---|
| 131 | |
---|
[2528] | 132 | !!gm IF( .NOT.ln_traqsr ) qsr(:,:) = 0.e0 ! no solar radiation penetration |
---|
| 133 | IF( .NOT.ln_traqsr ) THEN ! no solar radiation penetration |
---|
| 134 | qns(:,:) = qns(:,:) + qsr(:,:) ! total heat flux in qns |
---|
| 135 | qsr(:,:) = 0.e0 ! qsr set to zero |
---|
| 136 | ENDIF |
---|
[3] | 137 | |
---|
[2528] | 138 | !---------------------------------------- |
---|
| 139 | ! EMP, EMPS and QNS effects |
---|
| 140 | !---------------------------------------- |
---|
| 141 | ! Set before sbc tracer content fields |
---|
| 142 | ! ************************************ |
---|
| 143 | IF( kt == nit000 ) THEN ! Set the forcing field at nit000 - 1 |
---|
| 144 | ! ! ----------------------------------- |
---|
| 145 | IF( ln_rstart .AND. & ! Restart: read in restart file |
---|
| 146 | & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN |
---|
| 147 | IF(lwp) WRITE(numout,*) ' nit000-1 surface tracer content forcing fields red in the restart file' |
---|
| 148 | zfact = 0.5e0 |
---|
| 149 | CALL iom_get( numror, jpdom_autoglo, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem) ) ! before heat content sbc trend |
---|
| 150 | CALL iom_get( numror, jpdom_autoglo, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal) ) ! before salt content sbc trend |
---|
| 151 | ELSE ! No restart or restart not found: Euler forward time stepping |
---|
| 152 | zfact = 1.e0 |
---|
| 153 | sbc_tsc_b(:,:,:) = 0.e0 |
---|
| 154 | ENDIF |
---|
| 155 | ELSE ! Swap of forcing fields |
---|
| 156 | ! ! ---------------------- |
---|
| 157 | zfact = 0.5e0 |
---|
| 158 | sbc_tsc_b(:,:,:) = sbc_tsc(:,:,:) |
---|
| 159 | ENDIF |
---|
| 160 | ! Compute now sbc tracer content fields |
---|
| 161 | ! ************************************* |
---|
| 162 | |
---|
| 163 | ! Concentration dilution effect on (t,s) due to |
---|
| 164 | ! evaporation, precipitation and qns, but not river runoff |
---|
| 165 | |
---|
[3625] | 166 | IF( lk_vvl ) THEN ! Variable Volume case ==>> heat content of mass flux is in qns |
---|
[3294] | 167 | DO jj = 1, jpj |
---|
| 168 | DO ji = 1, jpi |
---|
[3625] | 169 | sbc_tsc(ji,jj,jp_tem) = r1_rau0_rcp * qns(ji,jj) ! non solar heat flux |
---|
| 170 | sbc_tsc(ji,jj,jp_sal) = r1_rau0 * sfx(ji,jj) ! salt flux due to freezing/melting |
---|
[2528] | 171 | END DO |
---|
[3] | 172 | END DO |
---|
[3625] | 173 | ELSE ! Constant Volume case ==>> Concentration dilution effect |
---|
[2528] | 174 | DO jj = 2, jpj |
---|
| 175 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
| 176 | ! temperature : heat flux |
---|
[3625] | 177 | sbc_tsc(ji,jj,jp_tem) = r1_rau0_rcp * qns(ji,jj) & ! non solar heat flux |
---|
| 178 | & + r1_rau0 * emp(ji,jj) * tsn(ji,jj,1,jp_tem) ! concent./dilut. effect |
---|
| 179 | ! salinity : salt flux + concent./dilut. effect (both in sfx) |
---|
| 180 | sbc_tsc(ji,jj,jp_sal) = r1_rau0 * ( sfx(ji,jj) & ! salt flux (freezing/melting) |
---|
| 181 | & + emp(ji,jj) * tsn(ji,jj,1,jp_sal) ) ! concent./dilut. effect |
---|
[2528] | 182 | END DO |
---|
| 183 | END DO |
---|
[3625] | 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 |
---|
[2528] | 186 | ENDIF |
---|
| 187 | ! Concentration dilution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff |
---|
| 188 | DO jn = 1, jpts |
---|
| 189 | DO jj = 2, jpj |
---|
| 190 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
| 191 | z1_e3t = zfact / fse3t(ji,jj,1) |
---|
| 192 | tsa(ji,jj,1,jn) = tsa(ji,jj,1,jn) + ( sbc_tsc_b(ji,jj,jn) + sbc_tsc(ji,jj,jn) ) * z1_e3t |
---|
| 193 | END DO |
---|
| 194 | END DO |
---|
[3] | 195 | END DO |
---|
[2528] | 196 | ! Write in the ocean restart file |
---|
| 197 | ! ******************************* |
---|
| 198 | IF( lrst_oce ) THEN |
---|
| 199 | IF(lwp) WRITE(numout,*) |
---|
| 200 | IF(lwp) WRITE(numout,*) 'sbc : ocean surface tracer content forcing fields written in ocean restart file ', & |
---|
| 201 | & 'at it= ', kt,' date= ', ndastp |
---|
| 202 | IF(lwp) WRITE(numout,*) '~~~~' |
---|
| 203 | CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem) ) |
---|
| 204 | CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal) ) |
---|
| 205 | ENDIF |
---|
| 206 | ! |
---|
| 207 | !---------------------------------------- |
---|
| 208 | ! River Runoff effects |
---|
| 209 | !---------------------------------------- |
---|
| 210 | ! |
---|
[3764] | 211 | IF( ln_rnf ) THEN ! input of heat and salt due to river runoff |
---|
| 212 | zfact = 0.5_wp |
---|
[2528] | 213 | DO jj = 2, jpj |
---|
| 214 | DO ji = fs_2, fs_jpim1 |
---|
[3764] | 215 | IF( rnf(ji,jj) /= 0._wp ) THEN |
---|
| 216 | zdep = zfact / h_rnf(ji,jj) |
---|
[2528] | 217 | DO jk = 1, nk_rnf(ji,jj) |
---|
| 218 | tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) & |
---|
| 219 | & + ( rnf_tsc_b(ji,jj,jp_tem) + rnf_tsc(ji,jj,jp_tem) ) * zdep |
---|
| 220 | IF( ln_rnf_sal ) tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal) & |
---|
| 221 | & + ( rnf_tsc_b(ji,jj,jp_sal) + rnf_tsc(ji,jj,jp_sal) ) * zdep |
---|
[2715] | 222 | END DO |
---|
[2528] | 223 | ENDIF |
---|
[2715] | 224 | END DO |
---|
| 225 | END DO |
---|
[3764] | 226 | ENDIF |
---|
| 227 | |
---|
[2528] | 228 | IF( l_trdtra ) THEN ! save the horizontal diffusive trends for further diagnostics |
---|
| 229 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) |
---|
| 230 | 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 ) |
---|
[3294] | 233 | CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) |
---|
[216] | 234 | ENDIF |
---|
[503] | 235 | ! |
---|
[2528] | 236 | IF(ln_ctl) CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' sbc - Ta: ', mask1=tmask, & |
---|
| 237 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
[503] | 238 | ! |
---|
[3294] | 239 | IF( nn_timing == 1 ) CALL timing_stop('tra_sbc') |
---|
| 240 | ! |
---|
[3] | 241 | END SUBROUTINE tra_sbc |
---|
| 242 | |
---|
| 243 | !!====================================================================== |
---|
| 244 | END MODULE trasbc |
---|