Changeset 2528 for trunk/NEMOGCM/NEMO/TOP_SRC
- Timestamp:
- 2010-12-27T18:33:53+01:00 (13 years ago)
- Location:
- trunk/NEMOGCM/NEMO/TOP_SRC
- Files:
-
- 34 deleted
- 77 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90
- Property svn:keywords set to Id
r2047 r2528 6 6 !! History : 2.0 ! 2008-12 (C. Ethe, G. Madec) revised architecture 7 7 !!---------------------------------------------------------------------- 8 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)9 !! $Id : par_cfc.F90 1152 2008-06-26 14:11:13Z rblod$10 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)8 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 9 !! $Id$ 10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 11 !!---------------------------------------------------------------------- 12 12 USE par_lobster, ONLY : jp_lobster !: number of tracers in LOBSTER -
trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcini_c14b.F90
- Property svn:keywords set to Id
r1581 r2528 41 41 42 42 !!--------------------------------------------------------------------- 43 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)44 !! $Id : trcini_cfc.F90 1146 2008-06-25 11:42:56Z rblod$45 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)43 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 44 !! $Id$ 45 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 46 46 !!---------------------------------------------------------------------- 47 47 … … 59 59 !!---------------------------------------------------------------------- 60 60 61 IF(lwp) WRITE(numout,*) 62 IF(lwp) WRITE(numout,*) ' trc_ini_cfc: initialisation of CFC chemical model' 61 ! Control consitency 62 CALL trc_ctl_c14b 63 64 IF(lwp) WRITE(numout,*) '' 65 IF(lwp) WRITE(numout,*) ' trc_ini_c14b: initialisation of Bomb C14 chemical model' 63 66 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 64 67 … … 162 165 END SUBROUTINE trc_ini_c14b 163 166 167 SUBROUTINE trc_ctl_c14b 168 !!---------------------------------------------------------------------- 169 !! *** ROUTINE trc_ctl_c14b *** 170 !! 171 !! ** Purpose : control the cpp options, namelist and files 172 !!---------------------------------------------------------------------- 173 174 IF(lwp) THEN 175 WRITE(numout,*) ' C14 bomb Model ' 176 WRITE(numout,*) ' ' 177 ENDIF 178 179 ! Check number of tracers 180 ! ----------------------- 181 IF( jp_c14b > 1) CALL ctl_stop( ' Change jp_c14b to be equal 1 in par_c14b.F90' ) 182 183 ! Check tracer names 184 ! ------------------ 185 IF ( ctrcnm(jpc14) /= 'C14B' ) THEN 186 ctrcnm(jpc14) = 'C14B' 187 ctrcnl(jpc14) = 'Bomb C14 concentration' 188 ENDIF 189 190 IF(lwp) THEN 191 CALL ctl_warn( ' we force tracer names' ) 192 WRITE(numout,*) ' tracer nb: ',jpc14,' name = ',ctrcnm(jpc14), ctrcnl(jpc14) 193 WRITE(numout,*) ' ' 194 ENDIF 195 196 ! Check tracer units 197 ! ------------------ 198 IF( ctrcun(jpc14) /= 'ration' ) THEN 199 ctrcun(jpc14) = 'ration' 200 IF(lwp) THEN 201 CALL ctl_warn( ' we force tracer unit' ) 202 WRITE(numout,*) ' tracer ',ctrcnm(jpc14), 'UNIT= ',ctrcun(jpc14) 203 WRITE(numout,*) ' ' 204 ENDIF 205 ENDIF 206 ! 207 END SUBROUTINE trc_ctl_c14b 164 208 #else 165 209 !!---------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcrst_c14b.F90
- Property svn:keywords set to Id
r1801 r2528 43 43 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 44 44 45 DO jn = jp_c14b0, jp_c14b1 46 CALL iom_get( knum, jpdom_autoglo, 'qint_'//ctrcnm(jn), qint_c14(:,:,jn) ) 47 END DO 45 CALL iom_get( knum, jpdom_autoglo, 'qint_c14', qint_c14 ) 48 46 49 47 END SUBROUTINE trc_rst_read_c14b … … 59 57 INTEGER, INTENT(in) :: kitrst ! time step of restart write 60 58 INTEGER, INTENT(in) :: knum ! unit of the restart file 61 INTEGER :: jn ! dummy loop indices62 59 !!---------------------------------------------------------------------- 63 60 … … 66 63 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 67 64 68 DO jn = jp_c14b0, jp_c14b1 69 CALL iom_rstput( kt, kitrst, kum, 'qint_'//ctrcnm(jn), qint_c14(:,:,jn) ) 70 END DO 65 CALL iom_rstput( kt, kitrst, knum, 'qint_c14', qint_c14 ) 71 66 72 67 END SUBROUTINE trc_rst_wri_c14b -
trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
- Property svn:keywords set to Id
r1736 r2528 17 17 USE par_trc ! TOP parameters 18 18 USE trc ! TOP variables 19 USE trdm ld_trc_oce20 USE trdm ld_trc19 USE trdmod_oce 20 USE trdmod_trc 21 21 USE iom 22 22 … … 126 126 zpv , & !: piston velocity 127 127 zdemi, ztra 128 #if defined key_ trc_dia3d&& defined key_iomput128 #if defined key_diatrc && defined key_iomput 129 129 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zw3d 130 130 #endif 131 131 !!---------------------------------------------------------------------- 132 132 133 IF( kt == nit trc000 ) THEN133 IF( kt == nit000 ) THEN 134 134 ! Computation of decay coeffcient 135 135 zdemi = 5730. … … 234 234 ! Computation of solubility 235 235 IF (tmask(ji,jj,1) > 0.) THEN 236 ztp = ( t n(ji,jj,1) + 273.16 ) * 0.01236 ztp = ( tsn(ji,jj,1,jp_tem) + 273.16 ) * 0.01 237 237 zsk = 0.023517 + ztp * ( -0.023656 + 0.0047036 * ztp ) 238 zsol = EXP( -60.2409 + 93.4517 / ztp + 23.3585 * LOG( ztp ) + zsk * sn(ji,jj,1) )238 zsol = EXP( -60.2409 + 93.4517 / ztp + 23.3585 * LOG( ztp ) + zsk * tsn(ji,jj,1,jp_sal) ) 239 239 ! convert solubilities [mol/(l * atm)] -> [mol/(m^3 * ppm)] 240 240 zsol = zsol * 1.0e-03 … … 247 247 248 248 ! Computes the Schmidt number of CO2 in seawater 249 zt = t n(ji,jj,1)249 zt = tsn(ji,jj,1,jp_tem) 250 250 zsch = 2073.1 + zt * ( -125.62 + zt * (3.6276 - 0.043219 * zt ) ) 251 251 … … 259 259 qtr_c14(ji,jj) = -zpv * zsol * zpco2at & 260 260 & * ( trb(ji,jj,1,jpc14) - zatmbc14(ji,jj) ) & 261 #if defined key_ off_degrad261 #if defined key_degrad 262 262 & * facvol(ji,jj,1) & 263 263 #endif … … 270 270 qint_c14(ji,jj) = qint_c14(ji,jj) + qtr_c14(ji,jj) * rdt 271 271 272 # if defined key_ trc_diaadd&& ! defined key_iomput272 # if defined key_diatrc && ! defined key_iomput 273 273 ! Save 2D diagnostics 274 274 trc2d(ji,jj,jp_c14b0_2d ) = qtr_c14 (ji,jj) … … 282 282 DO jj = 1, jpj 283 283 DO ji = 1, jpi 284 #if ! defined key_ off_degrad284 #if ! defined key_degrad 285 285 ztra = trn(ji,jj,jk,jpc14) * xaccum 286 286 #else … … 288 288 #endif 289 289 tra(ji,jj,jk,jpc14) = tra(ji,jj,jk,jpc14) - ztra / rdt 290 #if defined key_ trc_dia3d290 #if defined key_diatrc 291 291 ! Save 3D diagnostics 292 292 # if ! defined key_iomput … … 300 300 END DO 301 301 302 #if defined key_ trc_diaadd&& defined key_iomput302 #if defined key_diatrc && defined key_iomput 303 303 CALL iom_put( "qtrC14b" , qtr_c14 ) 304 304 CALL iom_put( "qintC14b" , qint_c14 ) 305 305 #endif 306 #if defined key_ trc_dia3d&& defined key_iomput306 #if defined key_diatrc && defined key_iomput 307 307 CALL iom_put( "fdecay" , zw3d ) 308 308 #endif 309 309 IF( l_trdtrc ) THEN 310 CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptr c_trd_sms, kt ) ! save trends310 CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_trd_sms, kt ) ! save trends 311 311 END IF 312 312 -
trunk/NEMOGCM/NEMO/TOP_SRC/CFC/par_cfc.F90
r2047 r2528 6 6 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) revised architecture 7 7 !!---------------------------------------------------------------------- 8 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)8 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 9 9 !! $Id$ 10 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 11 !!---------------------------------------------------------------------- 12 12 USE par_lobster, ONLY : jp_lobster !: number of tracers in LOBSTER -
trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90
r2047 r2528 30 30 31 31 !!---------------------------------------------------------------------- 32 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)32 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 33 33 !! $Id$ 34 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)34 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 35 35 !!---------------------------------------------------------------------- 36 36 -
trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcrst_cfc.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
r2423 r2528 18 18 USE par_trc ! TOP parameters 19 19 USE trc ! TOP variables 20 USE trdm ld_trc_oce21 USE trdm ld_trc20 USE trdmod_oce 21 USE trdmod_trc 22 22 USE iom 23 23 … … 34 34 INTEGER , PUBLIC :: npyear ! Number of years read in CFC1112 file 35 35 36 REAL(wp), PUBLIC, DIMENSION(jpyear,jphem, 2) :: p_cfc ! partial hemispheric pressure for CFC37 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: xphem ! spatial interpolation factor for patm36 REAL(wp), PUBLIC, DIMENSION(jpyear,jphem, 2 ) :: p_cfc ! partial hemispheric pressure for CFC 37 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: xphem ! spatial interpolation factor for patm 38 38 REAL(wp), PUBLIC, DIMENSION(jpi,jpj ,jp_cfc) :: qtr_cfc ! flux at surface 39 39 REAL(wp), PUBLIC, DIMENSION(jpi,jpj ,jp_cfc) :: qint_cfc ! cumulative flux … … 52 52 # include "top_substitute.h90" 53 53 !!---------------------------------------------------------------------- 54 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)54 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 55 55 !! $Id$ 56 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)56 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 57 57 !!---------------------------------------------------------------------- 58 58 … … 93 93 !!---------------------------------------------------------------------- 94 94 95 IF( kt == nit trc000 ) CALL trc_cfc_cst95 IF( kt == nit000 ) CALL trc_cfc_cst 96 96 97 97 ! Temporal interpolation … … 129 129 ! coefficient for solubility for CFC-11/12 in mol/l/atm 130 130 IF( tmask(ji,jj,1) .GE. 0.5 ) THEN 131 ztap = ( t n(ji,jj,1) + 273.16 ) * 0.01131 ztap = ( tsn(ji,jj,1,jp_tem) + 273.16 ) * 0.01 132 132 zdtap = sob(1,jl) + ztap * ( sob(2,jl) + ztap * sob(3,jl) ) 133 133 zsol = EXP( soa(1,jl) + soa(2,jl) / ztap + soa(3,jl) * LOG( ztap ) & 134 & + soa(4,jl) * ztap * ztap + sn(ji,jj,1) * zdtap )134 & + soa(4,jl) * ztap * ztap + tsn(ji,jj,1,jp_sal) * zdtap ) 135 135 ELSE 136 136 zsol = 0.e0 … … 143 143 ! Computation of speed transfert 144 144 ! Schmidt number 145 zt1 = t n(ji,jj,1)145 zt1 = tsn(ji,jj,1,jp_tem) 146 146 zt2 = zt1 * zt1 147 147 zt3 = zt1 * zt2 … … 156 156 ! trn in pico-mol/l idem qtr; ak in en m/s 157 157 qtr_cfc(ji,jj,jl) = -zak_cfc * ( trb(ji,jj,1,jn) - zca_cfc ) & 158 #if defined key_ off_degrad158 #if defined key_degrad 159 159 & * facvol(ji,jj,1) & 160 160 #endif … … 173 173 ! !----------------! 174 174 175 #if defined key_ trc_diaadd175 #if defined key_diatrc 176 176 ! Save diagnostics , just for CFC11 177 177 # if ! defined key_iomput … … 187 187 DO jn = jp_cfc0, jp_cfc1 188 188 ztrcfc(:,:,:) = tra(:,:,:,jn) 189 CALL trd_mod_trc( ztrcfc, jn, jptr c_trd_sms, kt ) ! save trends189 CALL trd_mod_trc( ztrcfc, jn, jptra_trd_sms, kt ) ! save trends 190 190 END DO 191 191 END IF -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/par_lobster.F90
r2047 r2528 6 6 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) revised architecture 7 7 !!---------------------------------------------------------------------- 8 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)8 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 9 9 !! $Id$ 10 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 11 !!---------------------------------------------------------------------- 12 12 … … 19 19 LOGICAL, PUBLIC, PARAMETER :: lk_lobster = .TRUE. !: LOBSTER flag 20 20 INTEGER, PUBLIC, PARAMETER :: jp_lobster = 6 !: number of LOBSTER tracers 21 INTEGER, PUBLIC, PARAMETER :: jp_lobster_2d = 19 !: additional 2d output arrays ('key_ trc_diaadd')22 INTEGER, PUBLIC, PARAMETER :: jp_lobster_3d = 3 !: additional 3d output arrays ('key_ trc_diaadd')21 INTEGER, PUBLIC, PARAMETER :: jp_lobster_2d = 19 !: additional 2d output arrays ('key_diatrc') 22 INTEGER, PUBLIC, PARAMETER :: jp_lobster_3d = 3 !: additional 3d output arrays ('key_diatrc') 23 23 INTEGER, PUBLIC, PARAMETER :: jp_lobster_trd = 17 !: number of sms trends for LOBSTER 24 24 25 25 ! assign an index in trc arrays for each LOBSTER prognostic variables 26 INTEGER, PUBLIC, PARAMETER :: jp det= 1 !: detritus [mmoleN/m3]27 INTEGER, PUBLIC, PARAMETER :: jp zoo= 2 !: zooplancton concentration [mmoleN/m3]28 INTEGER, PUBLIC, PARAMETER :: jp phy= 3 !: phytoplancton concentration [mmoleN/m3]29 INTEGER, PUBLIC, PARAMETER :: jp no3= 4 !: nitrate concentration [mmoleN/m3]30 INTEGER, PUBLIC, PARAMETER :: jp nh4= 5 !: ammonium concentration [mmoleN/m3]31 INTEGER, PUBLIC, PARAMETER :: jp dom= 6 !: dissolved organic matter [mmoleN/m3]26 INTEGER, PUBLIC, PARAMETER :: jp_lob_det = 1 !: detritus [mmoleN/m3] 27 INTEGER, PUBLIC, PARAMETER :: jp_lob_zoo = 2 !: zooplancton concentration [mmoleN/m3] 28 INTEGER, PUBLIC, PARAMETER :: jp_lob_phy = 3 !: phytoplancton concentration [mmoleN/m3] 29 INTEGER, PUBLIC, PARAMETER :: jp_lob_no3 = 4 !: nitrate concentration [mmoleN/m3] 30 INTEGER, PUBLIC, PARAMETER :: jp_lob_nh4 = 5 !: ammonium concentration [mmoleN/m3] 31 INTEGER, PUBLIC, PARAMETER :: jp_lob_dom = 6 !: dissolved organic matter [mmoleN/m3] 32 32 33 33 ! productive layer depth -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/sms_lobster.F90
r1152 r2528 23 23 24 24 !!---------------------------------------------------------------------- 25 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)25 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 26 26 !! $Id$ 27 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)27 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 28 28 !!---------------------------------------------------------------------- 29 29 -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90
r1795 r2528 20 20 USE lbclnk ! 21 21 USE prtctl_trc ! Print control for debbuging 22 USE trdm ld_trc23 USE trdm ld_trc_oce22 USE trdmod_oce 23 USE trdmod_trc 24 24 USE iom 25 25 … … 32 32 # include "top_substitute.h90" 33 33 !!---------------------------------------------------------------------- 34 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)34 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 35 35 !! $Id$ 36 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)36 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 37 37 !!---------------------------------------------------------------------- 38 38 … … 57 57 !! source sink 58 58 !! 59 !! IF 'key_ trc_diabio' defined , the biogeochemical trends59 !! IF 'key_diabio' defined , the biogeochemical trends 60 60 !! for passive tracers are saved for futher diagnostics. 61 61 !!--------------------------------------------------------------------- … … 71 71 REAL(wp) :: zfilpz, zfildz, zphya, zzooa, zno3a 72 72 REAL(wp) :: znh4a, zdeta, zdoma, zzoobod, zboddet, zdomaju 73 #if defined key_ trc_diaadd73 #if defined key_diatrc 74 74 REAL(wp) :: ze3t 75 75 #endif 76 #if defined key_ trc_diaadd&& defined key_iomput76 #if defined key_diatrc && defined key_iomput 77 77 REAL(wp), DIMENSION(jpi,jpj,17) :: zw2d 78 # if defined key_trc_dia3d79 78 REAL(wp), DIMENSION(jpi,jpj,jpk,3) :: zw3d 80 # endif81 79 #endif 82 80 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: ztrbio … … 91 89 92 90 fbod(:,:) = 0.e0 93 #if defined key_ trc_diaadd&& ! defined key_iomput91 #if defined key_diatrc && ! defined key_iomput 94 92 DO jl = jp_lob0_2d, jp_lob1_2d 95 93 trc2d(:,:,jl) = 0.e0 96 94 END DO 97 95 #endif 98 #if defined key_ trc_diaadd&& defined key_iomput96 #if defined key_diatrc && defined key_iomput 99 97 zw2d(:,:,:) = 0.e0 100 # if defined key_trc_dia3d101 98 zw3d(:,:,:,:) = 0.e0 102 # endif103 99 #endif 104 100 … … 117 113 118 114 ! negative trophic variables DO not contribute to the fluxes 119 zdet = MAX( 0.e0, trn(ji,jj,jk,jp det) )120 zzoo = MAX( 0.e0, trn(ji,jj,jk,jp zoo) )121 zphy = MAX( 0.e0, trn(ji,jj,jk,jp phy) )122 zno3 = MAX( 0.e0, trn(ji,jj,jk,jp no3) )123 znh4 = MAX( 0.e0, trn(ji,jj,jk,jp nh4) )124 zdom = MAX( 0.e0, trn(ji,jj,jk,jp dom) )115 zdet = MAX( 0.e0, trn(ji,jj,jk,jp_lob_det) ) 116 zzoo = MAX( 0.e0, trn(ji,jj,jk,jp_lob_zoo) ) 117 zphy = MAX( 0.e0, trn(ji,jj,jk,jp_lob_phy) ) 118 zno3 = MAX( 0.e0, trn(ji,jj,jk,jp_lob_no3) ) 119 znh4 = MAX( 0.e0, trn(ji,jj,jk,jp_lob_nh4) ) 120 zdom = MAX( 0.e0, trn(ji,jj,jk,jp_lob_dom) ) 125 121 126 122 ! Limitations … … 194 190 195 191 ! tracer flux at totox-point added to the general trend 196 tra(ji,jj,jk,jp det) = tra(ji,jj,jk,jpdet) + zdeta197 tra(ji,jj,jk,jp zoo) = tra(ji,jj,jk,jpzoo) + zzooa198 tra(ji,jj,jk,jp phy) = tra(ji,jj,jk,jpphy) + zphya199 tra(ji,jj,jk,jp no3) = tra(ji,jj,jk,jpno3) + zno3a200 tra(ji,jj,jk,jp nh4) = tra(ji,jj,jk,jpnh4) + znh4a201 tra(ji,jj,jk,jp dom) = tra(ji,jj,jk,jpdom) + zdoma202 203 #if defined key_ trc_diabio192 tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + zdeta 193 tra(ji,jj,jk,jp_lob_zoo) = tra(ji,jj,jk,jp_lob_zoo) + zzooa 194 tra(ji,jj,jk,jp_lob_phy) = tra(ji,jj,jk,jp_lob_phy) + zphya 195 tra(ji,jj,jk,jp_lob_no3) = tra(ji,jj,jk,jp_lob_no3) + zno3a 196 tra(ji,jj,jk,jp_lob_nh4) = tra(ji,jj,jk,jp_lob_nh4) + znh4a 197 tra(ji,jj,jk,jp_lob_dom) = tra(ji,jj,jk,jp_lob_dom) + zdoma 198 199 #if defined key_diabio 204 200 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 205 201 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy … … 238 234 ENDIF 239 235 240 #if defined key_ trc_diaadd236 #if defined key_diatrc 241 237 ! convert fluxes in per day 242 238 ze3t = fse3t(ji,jj,jk) * 86400. … … 282 278 zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t 283 279 #endif 284 #if defined key_ trc_dia3d280 #if defined key_diatrc 285 281 # if ! defined key_iomput 286 282 trc3d(ji,jj,jk,jp_lob0_3d ) = zno3phy * 86400 … … 307 303 ! trophic variables( det, zoo, phy, no3, nh4, dom) 308 304 ! negative trophic variables DO not contribute to the fluxes 309 zdet = MAX( 0.e0, trn(ji,jj,jk,jp det) )310 zzoo = MAX( 0.e0, trn(ji,jj,jk,jp zoo) )311 zphy = MAX( 0.e0, trn(ji,jj,jk,jp phy) )312 zno3 = MAX( 0.e0, trn(ji,jj,jk,jp no3) )313 znh4 = MAX( 0.e0, trn(ji,jj,jk,jp nh4) )314 zdom = MAX( 0.e0, trn(ji,jj,jk,jp dom) )305 zdet = MAX( 0.e0, trn(ji,jj,jk,jp_lob_det) ) 306 zzoo = MAX( 0.e0, trn(ji,jj,jk,jp_lob_zoo) ) 307 zphy = MAX( 0.e0, trn(ji,jj,jk,jp_lob_phy) ) 308 zno3 = MAX( 0.e0, trn(ji,jj,jk,jp_lob_no3) ) 309 znh4 = MAX( 0.e0, trn(ji,jj,jk,jp_lob_nh4) ) 310 zdom = MAX( 0.e0, trn(ji,jj,jk,jp_lob_dom) ) 315 311 316 312 ! Limitations … … 363 359 364 360 ! tracer flux at totox-point added to the general trend 365 tra(ji,jj,jk,jp det) = tra(ji,jj,jk,jpdet) + zdeta366 tra(ji,jj,jk,jp zoo) = tra(ji,jj,jk,jpzoo) + zzooa367 tra(ji,jj,jk,jp phy) = tra(ji,jj,jk,jpphy) + zphya368 tra(ji,jj,jk,jp no3) = tra(ji,jj,jk,jpno3) + zno3a369 tra(ji,jj,jk,jp nh4) = tra(ji,jj,jk,jpnh4) + znh4a370 tra(ji,jj,jk,jp dom) = tra(ji,jj,jk,jpdom) + zdoma361 tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + zdeta 362 tra(ji,jj,jk,jp_lob_zoo) = tra(ji,jj,jk,jp_lob_zoo) + zzooa 363 tra(ji,jj,jk,jp_lob_phy) = tra(ji,jj,jk,jp_lob_phy) + zphya 364 tra(ji,jj,jk,jp_lob_no3) = tra(ji,jj,jk,jp_lob_no3) + zno3a 365 tra(ji,jj,jk,jp_lob_nh4) = tra(ji,jj,jk,jp_lob_nh4) + znh4a 366 tra(ji,jj,jk,jp_lob_dom) = tra(ji,jj,jk,jp_lob_dom) + zdoma 371 367 ! 372 #if defined key_ trc_diabio368 #if defined key_diabio 373 369 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 374 370 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy … … 406 402 ! trend number 17 in trcexp 407 403 ENDIF 408 #if defined key_ trc_diaadd && defined key_trc_dia3d404 #if defined key_diatrc 409 405 # if ! defined key_iomput 410 406 trc3d(ji,jj,jk,jp_lob0_3d ) = zno3phy * 86400 … … 421 417 END DO 422 418 423 #if defined key_ trc_diaadd419 #if defined key_diatrc 424 420 ! Lateral boundary conditions 425 421 # if ! defined key_iomput … … 452 448 #endif 453 449 454 #if defined key_ trc_diaadd && defined key_trc_dia3d450 #if defined key_diatrc 455 451 ! Lateral boundary conditions 456 452 # if ! defined key_iomput … … 469 465 #endif 470 466 471 #if defined key_ trc_diabio467 #if defined key_diabio 472 468 ! Lateral boundary conditions on trcbio 473 469 DO jl = jp_lob0_trd, jp_lob1_trd -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90
r1795 r2528 19 19 USE lbclnk 20 20 USE trc 21 USE trc trp_lec21 USE trcnam_trp 22 22 USE prtctl_trc ! Print control for debbuging 23 USE trdm ld_trc24 USE trdm ld_trc_oce23 USE trdmod_oce 24 USE trdmod_trc 25 25 USE iom 26 26 … … 33 33 # include "top_substitute.h90" 34 34 !!---------------------------------------------------------------------- 35 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)35 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 36 36 !! $Id$ 37 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)37 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 38 38 !!---------------------------------------------------------------------- 39 39 … … 55 55 INTEGER, INTENT( in ) :: kt ! ocean time-step index 56 56 !! 57 INTEGER :: ji, jj, jk, jl, ik bot58 REAL(wp) :: zgeolpoc, zfact, zwork, ze3t 57 INTEGER :: ji, jj, jk, jl, ikt 58 REAL(wp) :: zgeolpoc, zfact, zwork, ze3t, zsedpocd 59 59 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrbio 60 60 CHARACTER (len=25) :: charout … … 75 75 IF( l_trdtrc )THEN 76 76 ALLOCATE( ztrbio(jpi,jpj,jpk) ) 77 ztrbio(:,:,:) = tra(:,:,:,jp no3)77 ztrbio(:,:,:) = tra(:,:,:,jp_lob_no3) 78 78 ENDIF 79 79 … … 82 82 DO ji = fs_2, fs_jpim1 83 83 ze3t = 1. / fse3t(ji,jj,jk) 84 tra(ji,jj,jk,jp no3) = tra(ji,jj,jk,jpno3) + ze3t * dmin3(ji,jj,jk) * fbod(ji,jj)84 tra(ji,jj,jk,jp_lob_no3) = tra(ji,jj,jk,jp_lob_no3) + ze3t * dmin3(ji,jj,jk) * fbod(ji,jj) 85 85 END DO 86 86 END DO … … 95 95 DO jj = 2, jpjm1 96 96 DO ji = fs_2, fs_jpim1 97 ik bot = mbathy(ji,jj) - 198 tra(ji,jj,ik bot,jpno3) = tra(ji,jj,ikbot,jpno3) + sedlam * sedpocn(ji,jj) / fse3t(ji,jj,ikbot)97 ikt = mbkt(ji,jj) 98 tra(ji,jj,ikt,jp_lob_no3) = tra(ji,jj,ikt,jp_lob_no3) + sedlam * sedpocn(ji,jj) / fse3t(ji,jj,ikt) 99 99 ! Deposition of organic matter in the sediment 100 zwork = vsed * trn(ji,jj,ik bot,jpdet)100 zwork = vsed * trn(ji,jj,ikt,jp_lob_det) 101 101 sedpoca(ji,jj) = ( zwork + dminl(ji,jj) * fbod(ji,jj) & 102 102 & - sedlam * sedpocn(ji,jj) - sedlostpoc * sedpocn(ji,jj) ) * rdt … … 107 107 DO jj = 2, jpjm1 108 108 DO ji = fs_2, fs_jpim1 109 tra(ji,jj,1,jp no3) = tra(ji,jj,1,jpno3) + zgeolpoc * cmask(ji,jj) / areacot / fse3t(ji,jj,1)109 tra(ji,jj,1,jp_lob_no3) = tra(ji,jj,1,jp_lob_no3) + zgeolpoc * cmask(ji,jj) / areacot / fse3t(ji,jj,1) 110 110 END DO 111 111 END DO … … 114 114 115 115 ! Oa & Ek: diagnostics depending on jpdia2d ! left as example 116 #if defined key_ trc_diaadd116 #if defined key_diatrc 117 117 # if ! defined key_iomput 118 118 trc2d(:,:,jp_lob0_2d + 18) = sedpocn(:,:) … … 122 122 #endif 123 123 124 ! Leap-frog scheme (only in explicit case, otherwise the125 ! ---------------- time stepping is already done in trczdf)126 IF( l_trczdf_exp .AND. (ln_trcadv_cen2 .OR. ln_trcadv_tvd) ) THEN127 zfact = 2. * rdttra(jk) * FLOAT( ndttrc )128 IF( neuler == 0 .AND. kt == nittrc000 ) zfact = rdttra(jk) * FLOAT(ndttrc)129 sedpoca(:,:) = sedpocb(:,:) + zfact * sedpoca(:,:)130 ENDIF131 132 124 133 125 ! Time filter and swap of arrays 134 126 ! ------------------------------ 135 IF( ln_trcadv_cen2 .OR. ln_trcadv_tvd ) THEN ! centred or tvd scheme 136 IF( neuler == 0 .AND. kt == nittrc000 ) THEN 137 DO jj = 1, jpj 138 DO ji = 1, jpi 139 sedpocb(ji,jj) = sedpocn(ji,jj) 140 sedpocn(ji,jj) = sedpoca(ji,jj) 141 sedpoca(ji,jj) = 0.e0 142 END DO 143 END DO 144 ELSE 145 DO jj = 1, jpj 146 DO ji = 1, jpi 147 sedpocb(ji,jj) = atfp * ( sedpocb(ji,jj) + sedpoca(ji,jj) ) & 148 & + atfp1 * sedpocn(ji,jj) 149 sedpocn(ji,jj) = sedpoca(ji,jj) 150 sedpoca(ji,jj) = 0.e0 151 END DO 152 END DO 153 ENDIF 154 ELSE ! case of smolar scheme or muscl 155 sedpocb(:,:) = sedpoca(:,:) 156 sedpocn(:,:) = sedpoca(:,:) 157 sedpoca(:,:) = 0.e0 127 IF( neuler == 0 .AND. kt == nit000 ) THEN ! Euler time-stepping at first time-step 128 ! ! (only swap) 129 sedpocn(:,:) = sedpoca(:,:) 130 ! 131 ELSE 132 ! 133 DO jj = 1, jpj 134 DO ji = 1, jpi 135 zsedpocd = sedpoca(ji,jj) - 2. * sedpocn(ji,jj) + sedpocb(ji,jj) ! time laplacian on tracers 136 sedpocb(ji,jj) = sedpocn(ji,jj) + atfp * zsedpocd ! sedpocb <-- filtered sedpocn 137 sedpocn(ji,jj) = sedpoca(ji,jj) ! sedpocn <-- sedpoca 138 END DO 139 END DO 140 ! 158 141 ENDIF 142 sedpoca(:,:) = 0.e0 159 143 ! 160 144 IF( l_trdtrc ) THEN 161 ztrbio(:,:,:) = tra(:,:,:,jp no3) - ztrbio(:,:,:)145 ztrbio(:,:,:) = tra(:,:,:,jp_lob_no3) - ztrbio(:,:,:) 162 146 jl = jp_lob0_trd + 16 163 147 CALL trd_mod_trc( ztrbio, jl, kt ) ! handle the trend -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcini_lobster.F90
r1800 r2528 20 20 USE oce_trc ! ocean variables 21 21 USE trc 22 USE lbclnk 23 USE lib_mpp 24 USE lib_fortran 22 25 23 26 IMPLICIT NONE … … 28 31 # include "top_substitute.h90" 29 32 !!---------------------------------------------------------------------- 30 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)33 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 31 34 !! $Id$ 32 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 36 !!---------------------------------------------------------------------- 34 37 … … 46 49 !!---------------------------------------------------------------------- 47 50 51 ! Control consitency 52 CALL trc_ctl_lobster 53 54 48 55 IF(lwp) WRITE(numout,*) 49 56 IF(lwp) WRITE(numout,*) ' trc_ini_lobster : LOBSTER biochemical model initialisation' 50 57 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~' 51 52 58 53 59 ! initialization of fields for optical model … … 118 124 ! Coastal mask 119 125 ! ------------ 120 cmask = 0.e0126 cmask(:,:) = 0.e0 121 127 DO ji = 2, jpi-1 122 128 DO jj = 2, jpj-1 … … 128 134 END DO 129 135 130 cmask( 1 ,:) = cmask(jpi-1,:) 131 cmask(jpi,:) = cmask( 2 ,:) 132 133 !!gm BUG !!!!! not valid in mpp and also not valid for north fold !!!!! 136 CALL lbc_lnk( cmask, 'T', 1. ) 134 137 135 138 ! Coastal surface 136 139 ! --------------- 137 areacot = 0.e0 138 DO ji = 2, jpi-1 139 DO jj = 2, jpj-1 140 areacot = areacot + e1t(ji,jj) * e2t(ji,jj) * cmask(ji,jj) 141 END DO 142 END DO 143 ! 140 areacot = glob_sum( e1t(:,:) * e2t(:,:) * cmask(:,:) ) 144 141 145 142 ! Initialization of tracer concentration in case of no restart … … 153 150 154 151 DO jk = 1, 7 155 trn(:,:,jk,jp det) = 0.016 * tmask(:,:,jk)156 trn(:,:,jk,jp zoo) = 0.018 * tmask(:,:,jk)157 trn(:,:,jk,jp phy) = 0.036 * tmask(:,:,jk)158 trn(:,:,jk,jp no3) = 1.e-5 * tmask(:,:,jk)159 trn(:,:,jk,jp nh4) = 5.e-4 * tmask(:,:,jk)160 trn(:,:,jk,jp dom) = 0.017 * tmask(:,:,jk)161 END DO 162 163 trn(:,:, 8,jp det) = 0.020 * tmask(:,:, 8)164 trn(:,:, 8,jp zoo) = 0.027 * tmask(:,:, 8)165 trn(:,:, 8,jp phy) = 0.041 * tmask(:,:, 8)166 trn(:,:, 8,jp no3) = 0.00022 * tmask(:,:, 8)167 trn(:,:, 8,jp nh4) = 0.0033 * tmask(:,:, 8)168 trn(:,:, 8,jp dom) = 0.021 * tmask(:,:, 8)169 170 trn(:,:, 9,jp det) = 0.0556 * tmask(:,:, 9)171 trn(:,:, 9,jp zoo) = 0.123 * tmask(:,:, 9)172 trn(:,:, 9,jp phy) = 0.122 * tmask(:,:, 9)173 trn(:,:, 9,jp no3) = 0.028 * tmask(:,:, 9)174 trn(:,:, 9,jp nh4) = 0.024 * tmask(:,:, 9)175 trn(:,:, 9,jp dom) = 0.06 * tmask(:,:, 9)176 177 trn(:,:,10,jp det) = 0.025 * tmask(:,:,10)178 trn(:,:,10,jp zoo) = 0.016 * tmask(:,:,10)179 trn(:,:,10,jp phy) = 0.029 * tmask(:,:,10)180 trn(:,:,10,jp no3) = 2.462 * tmask(:,:,10)181 trn(:,:,10,jp nh4) = 0.04 * tmask(:,:,10)182 trn(:,:,10,jp dom) = 0.022 * tmask(:,:,10)183 184 trn(:,:,11,jp det) = 0.0057 * tmask(:,:,11)185 trn(:,:,11,jp zoo) = 0.0005 * tmask(:,:,11)186 trn(:,:,11,jp phy) = 0.0006 * tmask(:,:,11)187 trn(:,:,11,jp no3) = 3.336 * tmask(:,:,11)188 trn(:,:,11,jp nh4) = 0.005 * tmask(:,:,11)189 trn(:,:,11,jp dom) = 0.004 * tmask(:,:,11)190 191 trn(:,:,12,jp det) = 0.002 * tmask(:,:,12)192 trn(:,:,12,jp zoo) = 1.e-6 * tmask(:,:,12)193 trn(:,:,12,jp phy) = 5.e-6 * tmask(:,:,12)194 trn(:,:,12,jp no3) = 4.24 * tmask(:,:,12)195 trn(:,:,12,jp nh4) = 0.001 * tmask(:,:,12)196 trn(:,:,12,jp dom) = 3.e-5 * tmask(:,:,12)152 trn(:,:,jk,jp_lob_det) = 0.016 * tmask(:,:,jk) 153 trn(:,:,jk,jp_lob_zoo) = 0.018 * tmask(:,:,jk) 154 trn(:,:,jk,jp_lob_phy) = 0.036 * tmask(:,:,jk) 155 trn(:,:,jk,jp_lob_no3) = 1.e-5 * tmask(:,:,jk) 156 trn(:,:,jk,jp_lob_nh4) = 5.e-4 * tmask(:,:,jk) 157 trn(:,:,jk,jp_lob_dom) = 0.017 * tmask(:,:,jk) 158 END DO 159 160 trn(:,:, 8,jp_lob_det) = 0.020 * tmask(:,:, 8) 161 trn(:,:, 8,jp_lob_zoo) = 0.027 * tmask(:,:, 8) 162 trn(:,:, 8,jp_lob_phy) = 0.041 * tmask(:,:, 8) 163 trn(:,:, 8,jp_lob_no3) = 0.00022 * tmask(:,:, 8) 164 trn(:,:, 8,jp_lob_nh4) = 0.0033 * tmask(:,:, 8) 165 trn(:,:, 8,jp_lob_dom) = 0.021 * tmask(:,:, 8) 166 167 trn(:,:, 9,jp_lob_det) = 0.0556 * tmask(:,:, 9) 168 trn(:,:, 9,jp_lob_zoo) = 0.123 * tmask(:,:, 9) 169 trn(:,:, 9,jp_lob_phy) = 0.122 * tmask(:,:, 9) 170 trn(:,:, 9,jp_lob_no3) = 0.028 * tmask(:,:, 9) 171 trn(:,:, 9,jp_lob_nh4) = 0.024 * tmask(:,:, 9) 172 trn(:,:, 9,jp_lob_dom) = 0.06 * tmask(:,:, 9) 173 174 trn(:,:,10,jp_lob_det) = 0.025 * tmask(:,:,10) 175 trn(:,:,10,jp_lob_zoo) = 0.016 * tmask(:,:,10) 176 trn(:,:,10,jp_lob_phy) = 0.029 * tmask(:,:,10) 177 trn(:,:,10,jp_lob_no3) = 2.462 * tmask(:,:,10) 178 trn(:,:,10,jp_lob_nh4) = 0.04 * tmask(:,:,10) 179 trn(:,:,10,jp_lob_dom) = 0.022 * tmask(:,:,10) 180 181 trn(:,:,11,jp_lob_det) = 0.0057 * tmask(:,:,11) 182 trn(:,:,11,jp_lob_zoo) = 0.0005 * tmask(:,:,11) 183 trn(:,:,11,jp_lob_phy) = 0.0006 * tmask(:,:,11) 184 trn(:,:,11,jp_lob_no3) = 3.336 * tmask(:,:,11) 185 trn(:,:,11,jp_lob_nh4) = 0.005 * tmask(:,:,11) 186 trn(:,:,11,jp_lob_dom) = 0.004 * tmask(:,:,11) 187 188 trn(:,:,12,jp_lob_det) = 0.002 * tmask(:,:,12) 189 trn(:,:,12,jp_lob_zoo) = 1.e-6 * tmask(:,:,12) 190 trn(:,:,12,jp_lob_phy) = 5.e-6 * tmask(:,:,12) 191 trn(:,:,12,jp_lob_no3) = 4.24 * tmask(:,:,12) 192 trn(:,:,12,jp_lob_nh4) = 0.001 * tmask(:,:,12) 193 trn(:,:,12,jp_lob_dom) = 3.e-5 * tmask(:,:,12) 197 194 198 195 DO jk=13,jpk 199 trn(:,:,jk,jp det) = 0.e0200 trn(:,:,jk,jp zoo) = 0.e0201 trn(:,:,jk,jp phy) = 0.e0202 trn(:,:,jk,jp nh4) = 0.e0203 trn(:,:,jk,jp dom) = 0.e0204 END DO 205 206 trn(:,:,13,jp no3) = 5.31 * tmask(:,:,13)207 trn(:,:,14,jp no3) = 6.73 * tmask(:,:,14)208 trn(:,:,15,jp no3) = 8.32 * tmask(:,:,15)209 trn(:,:,16,jp no3) = 10.13 * tmask(:,:,16)210 trn(:,:,17,jp no3) = 11.95 * tmask(:,:,17)211 trn(:,:,18,jp no3) = 13.57 * tmask(:,:,18)212 trn(:,:,19,jp no3) = 15.08 * tmask(:,:,19)213 trn(:,:,20,jp no3) = 16.41 * tmask(:,:,20)214 trn(:,:,21,jp no3) = 17.47 * tmask(:,:,21)215 trn(:,:,22,jp no3) = 18.29 * tmask(:,:,22)216 trn(:,:,23,jp no3) = 18.88 * tmask(:,:,23)217 trn(:,:,24,jp no3) = 19.30 * tmask(:,:,24)218 trn(:,:,25,jp no3) = 19.68 * tmask(:,:,25)219 trn(:,:,26,jp no3) = 19.91 * tmask(:,:,26)220 trn(:,:,27,jp no3) = 19.99 * tmask(:,:,27)221 trn(:,:,28,jp no3) = 20.01 * tmask(:,:,28)222 trn(:,:,29,jp no3) = 20.01 * tmask(:,:,29)223 trn(:,:,30,jp no3) = 20.01 * tmask(:,:,30)196 trn(:,:,jk,jp_lob_det) = 0.e0 197 trn(:,:,jk,jp_lob_zoo) = 0.e0 198 trn(:,:,jk,jp_lob_phy) = 0.e0 199 trn(:,:,jk,jp_lob_nh4) = 0.e0 200 trn(:,:,jk,jp_lob_dom) = 0.e0 201 END DO 202 203 trn(:,:,13,jp_lob_no3) = 5.31 * tmask(:,:,13) 204 trn(:,:,14,jp_lob_no3) = 6.73 * tmask(:,:,14) 205 trn(:,:,15,jp_lob_no3) = 8.32 * tmask(:,:,15) 206 trn(:,:,16,jp_lob_no3) = 10.13 * tmask(:,:,16) 207 trn(:,:,17,jp_lob_no3) = 11.95 * tmask(:,:,17) 208 trn(:,:,18,jp_lob_no3) = 13.57 * tmask(:,:,18) 209 trn(:,:,19,jp_lob_no3) = 15.08 * tmask(:,:,19) 210 trn(:,:,20,jp_lob_no3) = 16.41 * tmask(:,:,20) 211 trn(:,:,21,jp_lob_no3) = 17.47 * tmask(:,:,21) 212 trn(:,:,22,jp_lob_no3) = 18.29 * tmask(:,:,22) 213 trn(:,:,23,jp_lob_no3) = 18.88 * tmask(:,:,23) 214 trn(:,:,24,jp_lob_no3) = 19.30 * tmask(:,:,24) 215 trn(:,:,25,jp_lob_no3) = 19.68 * tmask(:,:,25) 216 trn(:,:,26,jp_lob_no3) = 19.91 * tmask(:,:,26) 217 trn(:,:,27,jp_lob_no3) = 19.99 * tmask(:,:,27) 218 trn(:,:,28,jp_lob_no3) = 20.01 * tmask(:,:,28) 219 trn(:,:,29,jp_lob_no3) = 20.01 * tmask(:,:,29) 220 trn(:,:,30,jp_lob_no3) = 20.01 * tmask(:,:,30) 224 221 225 222 # elif defined key_gyre … … 227 224 ! ---------------------- 228 225 ! here: init NO3=f(density) by asklod AS Kremeur 2005-07 229 trn(:,:,:,jp det) = 0.1 * tmask(:,:,:)230 trn(:,:,:,jp zoo) = 0.1 * tmask(:,:,:)231 trn(:,:,:,jp nh4) = 0.1 * tmask(:,:,:)232 trn(:,:,:,jp phy) = 0.1 * tmask(:,:,:)233 trn(:,:,:,jp dom) = 1.0 * tmask(:,:,:)226 trn(:,:,:,jp_lob_det) = 0.1 * tmask(:,:,:) 227 trn(:,:,:,jp_lob_zoo) = 0.1 * tmask(:,:,:) 228 trn(:,:,:,jp_lob_nh4) = 0.1 * tmask(:,:,:) 229 trn(:,:,:,jp_lob_phy) = 0.1 * tmask(:,:,:) 230 trn(:,:,:,jp_lob_dom) = 1.0 * tmask(:,:,:) 234 231 DO jk = 1, jpk 235 232 DO jj = 1, jpj 236 233 DO ji = 1, jpi 237 234 IF( rhd(ji,jj,jk) <= 24.5e-3 ) THEN 238 trn(ji,jj,jk,jp no3) = 2. * tmask(ji,jj,jk)235 trn(ji,jj,jk,jp_lob_no3) = 2. * tmask(ji,jj,jk) 239 236 ELSE 240 trn(ji,jj,jk,jp no3) = ( 15.55 * ( rhd(ji,jj,jk) * 1000. ) - 380.11 ) * tmask(ji,jj,jk)237 trn(ji,jj,jk,jp_lob_no3) = ( 15.55 * ( rhd(ji,jj,jk) * 1000. ) - 380.11 ) * tmask(ji,jj,jk) 241 238 ENDIF 242 239 END DO … … 259 256 END SUBROUTINE trc_ini_lobster 260 257 258 SUBROUTINE trc_ctl_lobster 259 !!---------------------------------------------------------------------- 260 !! *** ROUTINE trc_ctl_lobster *** 261 !! 262 !! ** Purpose : control the cpp options, namelist and files 263 !!---------------------------------------------------------------------- 264 INTEGER :: jl, jn 265 266 IF(lwp) WRITE(numout,*) 267 IF(lwp) WRITE(numout,*) ' use LOBSTER biological model ' 268 269 ! Check number of tracers 270 ! ----------------------- 271 IF( jp_lobster /= 6 ) CALL ctl_stop( ' LOBSTER has 6 passive tracers. Change jp_lobster in par_lobster.F90' ) 272 273 ! Check tracer names 274 ! ------------------ 275 IF( ctrcnm(jp_lob_det) /= 'DET' .OR. ctrcnm(jp_lob_zoo) /= 'ZOO' .OR. & 276 & ctrcnm(jp_lob_phy) /= 'PHY' .OR. ctrcnm(jp_lob_no3) /= 'NO3' .OR. & 277 & ctrcnm(jp_lob_nh4) /= 'NH4' .OR. ctrcnm(jp_lob_dom) /= 'DOM' .OR. & 278 & ctrcnl(jp_lob_det) /= 'Detritus' .OR. & 279 & ctrcnl(jp_lob_zoo) /= 'Zooplankton concentration' .OR. & 280 & ctrcnl(jp_lob_phy) /= 'Phytoplankton concentration' .OR. & 281 & ctrcnl(jp_lob_no3) /= 'Nitrate concentration' .OR. & 282 & ctrcnl(jp_lob_nh4) /= 'Ammonium concentration' .OR. & 283 & ctrcnl(jp_lob_dom) /= 'Dissolved organic matter' ) THEN 284 ctrcnm(jp_lob_det)='DET' 285 ctrcnl(jp_lob_det)='Detritus' 286 ctrcnm(jp_lob_zoo)='ZOO' 287 ctrcnl(jp_lob_zoo)='Zooplankton concentration' 288 ctrcnm(jp_lob_phy)='PHY' 289 ctrcnl(jp_lob_phy)='Phytoplankton concentration' 290 ctrcnm(jp_lob_no3)='NO3' 291 ctrcnl(jp_lob_no3)='Nitrate concentration' 292 ctrcnm(jp_lob_nh4)='NH4' 293 ctrcnl(jp_lob_nh4)='Ammonium concentration' 294 ctrcnm(jp_lob_dom)='DOM' 295 ctrcnl(jp_lob_dom)='Dissolved organic matter' 296 IF(lwp) THEN 297 CALL ctl_warn( ' We force tracer names ' ) 298 DO jl = 1, jp_lobster 299 jn = jp_lob0 + jl - 1 300 WRITE(numout,*) ' tracer nb: ',jn,' name = ',ctrcnm(jn), ctrcnl(jn) 301 END DO 302 WRITE(numout,*) ' ' 303 ENDIF 304 ENDIF 305 306 ! Check tracer units 307 DO jl = 1, jp_lobster 308 jn = jp_lob0 + jl - 1 309 IF( ctrcun(jn) /= 'mmole-N/m3') THEN 310 ctrcun(jn) = 'mmole-N/m3' 311 IF(lwp) THEN 312 CALL ctl_warn( ' We force tracer units ' ) 313 WRITE(numout,*) ' tracer ',ctrcnm(jn), 'UNIT= ',ctrcun(jn) 314 ENDIF 315 ENDIF 316 END DO 317 318 END SUBROUTINE trc_ctl_lobster 319 261 320 #else 262 321 !!---------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90
r1800 r2528 30 30 # include "top_substitute.h90" 31 31 !!---------------------------------------------------------------------- 32 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)32 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 33 33 !! $Id$ 34 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)34 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 35 35 !!---------------------------------------------------------------------- 36 36 … … 78 78 zparg (:,:,1) = zpar0m(:,:) * 0.5 79 79 80 !!gm optimisation : introduce zcoef and LOG computed once for all81 82 80 ! ! Photosynthetically Available Radiation (PAR) 83 81 zcoef = 12 * redf / rcchl / rpig ! -------------------------------------- … … 85 83 DO jj = 1, jpj 86 84 DO ji = 1, jpi 87 !!gm zpig = MAX( TINY(0.), trn(ji,jj,jk-1,jpphy) ) * zcoef 88 !!gm zkr = xkr0 + xkrp * EXP( xlr * LOG(zpig) ) 89 !!gm zkg = xkg0 + xkgp * EXP( xlg * LOG(zpig) ) 90 zpig = LOG( MAX( TINY(0.), trn(ji,jj,jk-1,jpphy) ) * zcoef ) 85 zpig = LOG( MAX( TINY(0.), trn(ji,jj,jk-1,jp_lob_phy) ) * zcoef ) 91 86 zkr = xkr0 + xkrp * EXP( xlr * zpig ) 92 87 zkg = xkg0 + xkgp * EXP( xlg * zpig ) … … 96 91 END DO 97 92 END DO 98 !!gm optimisation : suppress one division99 93 DO jk = 1, jpkm1 ! mean par at t-levels 100 94 DO jj = 1, jpj 101 95 DO ji = 1, jpi 102 zpig = LOG( MAX( TINY(0.), trn(ji,jj,jk,jp phy) ) * zcoef )96 zpig = LOG( MAX( TINY(0.), trn(ji,jj,jk,jp_lob_phy) ) * zcoef ) 103 97 zkr = xkr0 + xkrp * EXP( xlr * zpig ) 104 98 zkg = xkg0 + xkgp * EXP( xlg * zpig ) 105 !!gm zparr(ji,jj,jk) = zparr(ji,jj,jk) / zkr / fse3t(ji,jj,jk) * ( 1 - EXP( -zkr * fse3t(ji,jj,jk) ) )106 !!gm zparg(ji,jj,jk) = zparg(ji,jj,jk) / zkg / fse3t(ji,jj,jk) * ( 1 - EXP( -zkg * fse3t(ji,jj,jk) ) )107 99 zparr(ji,jj,jk) = zparr(ji,jj,jk) / ( zkr * fse3t(ji,jj,jk) ) * ( 1 - EXP( -zkr * fse3t(ji,jj,jk) ) ) 108 100 zparg(ji,jj,jk) = zparg(ji,jj,jk) / ( zkg * fse3t(ji,jj,jk) ) * ( 1 - EXP( -zkg * fse3t(ji,jj,jk) ) ) -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcrst_lobster.F90
- Property svn:keywords set to Id
r1801 r2528 43 43 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 44 44 45 CALL iom_get( knum, jpdom_autoglo, 'SEDB'//ctrcnm(jp det), sedpocb(:,:) )46 CALL iom_get( knum, jpdom_autoglo, 'SEDN'//ctrcnm(jp det), sedpocn(:,:) )45 CALL iom_get( knum, jpdom_autoglo, 'SEDB'//ctrcnm(jp_lob_det), sedpocb(:,:) ) 46 CALL iom_get( knum, jpdom_autoglo, 'SEDN'//ctrcnm(jp_lob_det), sedpocn(:,:) ) 47 47 48 48 END SUBROUTINE trc_rst_read_lobster … … 64 64 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 65 65 66 CALL iom_rstput( kt, kitrst, knum, 'SEDB'//ctrcnm(jp det), sedpocb(:,:) )67 CALL iom_rstput( kt, kitrst, knum, 'SEDN'//ctrcnm(jp det), sedpocn(:,:) )66 CALL iom_rstput( kt, kitrst, knum, 'SEDB'//ctrcnm(jp_lob_det), sedpocb(:,:) ) 67 CALL iom_rstput( kt, kitrst, knum, 'SEDN'//ctrcnm(jp_lob_det), sedpocn(:,:) ) 68 68 69 69 END SUBROUTINE trc_rst_wri_lobster -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90
r1800 r2528 18 18 USE sms_lobster 19 19 USE lbclnk 20 USE trdm ld_trc21 USE trdm ld_trc_oce20 USE trdmod_oce 21 USE trdmod_trc 22 22 USE iom 23 23 USE prtctl_trc ! Print control for debbuging … … 31 31 # include "top_substitute.h90" 32 32 !!---------------------------------------------------------------------- 33 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)33 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 34 34 !! $Id$ 35 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 36 36 !!---------------------------------------------------------------------- 37 37 … … 53 53 !! tra = tra + dz(trn wn) 54 54 !! 55 !! IF 'key_ trc_diabio' is defined, the now vertical advection55 !! IF 'key_diabio' is defined, the now vertical advection 56 56 !! trend of passive tracers is saved for futher diagnostics. 57 57 !!--------------------------------------------------------------------- … … 61 61 REAL(wp) :: ztra 62 62 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zwork 63 #if defined key_ trc_diaadd&& defined key_iomput63 #if defined key_diatrc && defined key_iomput 64 64 REAL(wp), DIMENSION(jpi,jpj) :: zw2d 65 65 #endif … … 77 77 ! -------------------------------------------- 78 78 79 ! for detritus sedimentation only - jp det79 ! for detritus sedimentation only - jp_lob_det 80 80 zwork(:,:,1 ) = 0.e0 ! surface value set to zero 81 81 zwork(:,:,jpk) = 0.e0 ! bottom value set to zero 82 82 83 #if defined key_ trc_diaadd&& defined key_iomput83 #if defined key_diatrc && defined key_iomput 84 84 zw2d(:,:) = 0. 85 85 # endif … … 87 87 IF( l_trdtrc )THEN 88 88 ALLOCATE( ztrbio(jpi,jpj,jpk) ) 89 ztrbio(:,:,:) = tra(:,:,:,jp det)89 ztrbio(:,:,:) = tra(:,:,:,jp_lob_det) 90 90 ENDIF 91 91 92 92 ! tracer flux at w-point: we use -vsed (downward flux) with simplification : no e1*e2 93 93 DO jk = 2, jpkm1 94 zwork(:,:,jk) = -vsed * trn(:,:,jk-1,jp det)94 zwork(:,:,jk) = -vsed * trn(:,:,jk-1,jp_lob_det) 95 95 END DO 96 96 … … 100 100 DO ji = 1,jpi 101 101 ztra = - ( zwork(ji,jj,jk) - zwork(ji,jj,jk+1) ) / fse3t(ji,jj,jk) 102 tra(ji,jj,jk,jp det) = tra(ji,jj,jk,jpdet) + ztra103 #if defined key_ trc_diabio102 tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + ztra 103 #if defined key_diabio 104 104 trbio(ji,jj,jk,jp_lob0_trd + 7) = ztra 105 105 #endif 106 #if defined key_ trc_diaadd106 #if defined key_diatrc 107 107 # if ! defined key_iomput 108 108 trc2d(ji,jj,jp_lob0_2d + 7) = trc2d(ji,jj,jp_lob0_2d + 7) + ztra * fse3t(ji,jj,jk) * 86400. … … 115 115 END DO 116 116 117 #if defined key_ trc_diabio117 #if defined key_diabio 118 118 jl = jp_lob0_trd + 7 119 119 CALL lbc_lnk (trbio(:,:,1,jl), 'T', 1. ) ! Lateral boundary conditions on trcbio 120 120 #endif 121 #if defined key_ trc_diaadd121 #if defined key_diatrc 122 122 # if ! defined key_iomput 123 123 jl = jp_lob0_2d + 7 … … 131 131 132 132 IF( l_trdtrc ) THEN 133 ztrbio(:,:,:) = tra(:,:,:,jp det) - ztrbio(:,:,:)133 ztrbio(:,:,:) = tra(:,:,:,jp_lob_det) - ztrbio(:,:,:) 134 134 jl = jp_lob0_trd + 7 135 135 CALL trd_mod_trc( ztrbio, jl, kt ) ! handle the trend -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsms_lobster.F90
r1255 r2528 19 19 USE trcsed 20 20 USE trcexp 21 USE trdmld_trc_oce 21 USE trdmod_oce 22 USE trdmod_trc_oce 23 USE trdmod_trc 22 24 USE trdmld_trc 23 25 … … 28 30 29 31 !!---------------------------------------------------------------------- 30 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)32 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 31 33 !! $Id$ 32 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)34 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 35 !!---------------------------------------------------------------------- 34 36 … … 50 52 51 53 CALL trc_opt( kt ) ! optical model 52 53 54 CALL trc_bio( kt ) ! biological model 54 55 55 CALL trc_sed( kt ) ! sedimentation model 56 57 56 CALL trc_exp( kt ) ! export 58 57 … … 60 59 DO jn = jp_lob0, jp_lob1 61 60 ztrlob(:,:,:) = tra(:,:,:,jn) 62 CALL trd_mod_trc( ztrlob, jn, jptr c_trd_sms, kt ) ! save trends61 CALL trd_mod_trc( ztrlob, jn, jptra_trd_sms, kt ) ! save trends 63 62 END DO 64 63 END IF -
trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/par_my_trc.F90
r2047 r2528 6 6 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) revised architecture 7 7 !!---------------------------------------------------------------------- 8 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)8 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 9 9 !! $Id$ 10 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 11 !!---------------------------------------------------------------------- 12 12 USE par_lobster, ONLY : jp_lobster !: number of tracers in LOBSTER -
trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcini_my_trc.F90
r1542 r2528 22 22 23 23 !!---------------------------------------------------------------------- 24 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)24 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 25 25 !! $Id$ 26 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)26 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 27 27 !!---------------------------------------------------------------------- 28 28 … … 37 37 !! ** Method : - Read the namcfc namelist and check the parameter values 38 38 !!---------------------------------------------------------------------- 39 !!---------------------------------------------------------------------- 39 40 ! Control consitency 41 CALL trc_ctl_my_trc 40 42 41 43 IF(lwp) WRITE(numout,*) … … 48 50 END SUBROUTINE trc_ini_my_trc 49 51 52 SUBROUTINE trc_ctl_my_trc 53 !!---------------------------------------------------------------------- 54 !! *** ROUTINE trc_ctl_pisces *** 55 !! 56 !! ** Purpose : control the cpp options, namelist and files 57 !!---------------------------------------------------------------------- 58 59 INTEGER :: jl, jn 60 61 IF(lwp) WRITE(numout,*) 62 IF(lwp) WRITE(numout,*) ' use COLOR tracer ' 63 64 DO jl = 1, jp_my_trc 65 jn = jp_myt0 + jl - 1 66 WRITE(ctrcnm(jn),'(a,i2.2)') 'CLR',jn 67 ctrcnl(jn)='Color concentration' 68 ctrcun(jn)='N/A' 69 END DO 70 71 72 END SUBROUTINE trc_ctl_my_trc 73 50 74 #else 51 75 !!---------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcrst_my_trc.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90
r1255 r2528 15 15 USE oce_trc ! Ocean variables 16 16 USE trc ! TOP variables 17 USE trdm ld_trc_oce18 USE trdm ld_trc17 USE trdmod_oce 18 USE trdmod_trc 19 19 20 20 IMPLICIT NONE … … 24 24 25 25 !!---------------------------------------------------------------------- 26 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)26 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 27 27 !! $Id$ 28 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)28 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 29 29 !!---------------------------------------------------------------------- 30 30 … … 64 64 DO jn = jp_myt0, jp_myt1 65 65 ztrmyt(:,:,:) = tra(:,:,:,jn) 66 CALL trd_mod_trc( ztrmyt, jn, jptr c_trd_sms, kt ) ! save trends66 CALL trd_mod_trc( ztrmyt, jn, jptra_trd_sms, kt ) ! save trends 67 67 END DO 68 68 END IF -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90
- Property svn:executable deleted
r1800 r2528 41 41 # include "top_substitute.h90" 42 42 !!---------------------------------------------------------------------- 43 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)43 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 44 44 !! $Id$ 45 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)45 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 46 46 !!---------------------------------------------------------------------- 47 47 … … 84 84 CALL p4z_sink ( kt, jnt ) ! vertical flux of particulate organic matter 85 85 CALL p4z_opt ( kt, jnt ) ! Optic: PAR in the water column 86 CALL p4z_lim ( kt , jnt) ! co-limitations by the various nutrients86 CALL p4z_lim ( kt ) ! co-limitations by the various nutrients 87 87 CALL p4z_prod ( kt, jnt ) ! phytoplankton growth rate over the global ocean. 88 88 ! ! (for each element : C, Si, Fe, Chl ) 89 CALL p4z_rem ( kt , jnt) ! remineralization terms of organic matter+scavenging of Fe90 CALL p4z_mort ( kt , jnt) ! phytoplankton mortality89 CALL p4z_rem ( kt ) ! remineralization terms of organic matter+scavenging of Fe 90 CALL p4z_mort ( kt ) ! phytoplankton mortality 91 91 ! ! zooplankton sources/sinks routines 92 CALL p4z_micro( kt , jnt) ! microzooplankton92 CALL p4z_micro( kt ) ! microzooplankton 93 93 CALL p4z_meso ( kt, jnt ) ! mesozooplankton 94 94 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90
- Property svn:executable deleted
r1800 r2528 149 149 #include "top_substitute.h90" 150 150 !!---------------------------------------------------------------------- 151 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)151 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 152 152 !! $Id$ 153 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)153 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 154 154 !!---------------------------------------------------------------------- 155 155 … … 181 181 182 182 ! ! SET ABSOLUTE TEMPERATURE 183 ztkel = t n(ji,jj,1) + 273.16183 ztkel = tsn(ji,jj,1,jp_tem) + 273.16 184 184 zqtt = ztkel * 0.01 185 185 zqtt2 = zqtt * zqtt 186 zsal = sn(ji,jj,1) + (1.- tmask(ji,jj,1) ) * 35.186 zsal = tsn(ji,jj,1,jp_sal) + (1.- tmask(ji,jj,1) ) * 35. 187 187 zlqtt = LOG( zqtt ) 188 188 … … 214 214 215 215 ! SET ABSOLUTE TEMPERATURE 216 ztkel = t n(ji,jj,jk) + 273.16216 ztkel = tsn(ji,jj,jk,jp_tem) + 273.16 217 217 zqtt = ztkel * 0.01 218 zsal = sn(ji,jj,jk) + ( 1.-tmask(ji,jj,jk) ) * 35.218 zsal = tsn(ji,jj,jk,jp_sal) + ( 1.-tmask(ji,jj,jk) ) * 35. 219 219 zsqrt = SQRT( zsal ) 220 220 zsal15 = zsqrt * zsal … … 224 224 zis2 = zis * zis 225 225 zisqrt = SQRT( zis ) 226 ztc = t n(ji,jj,jk) + ( 1.- tmask(ji,jj,jk) ) * 20.226 ztc = tsn(ji,jj,jk,jp_tem) + ( 1.- tmask(ji,jj,jk) ) * 20. 227 227 228 228 ! CHLORINITY (WOOSTER ET AL., 1969) … … 249 249 & + ( cb8 + cb9 * zsqrt + cb10 * zsal ) * zlogt + cb11 * zsqrt * ztkel & 250 250 & + LOG( ( 1.+ zst / zcks + zft / zckf ) / ( 1.+ zst / zcks ) ) 251 !!gm zsal**2 to be replaced by a *... 252 zck1 = c10 * ztr + c11 + c12 * zlogt + c13 * zsal + c14 * zsal **2251 252 zck1 = c10 * ztr + c11 + c12 * zlogt + c13 * zsal + c14 * zsal * zsal 253 253 zck2 = c20 * ztr + c21 + c22 * zsal + c23 * zsal**2 254 254 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90
- Property svn:executable deleted
r1836 r2528 28 28 #endif 29 29 USE lib_mpp 30 USE lib_fortran 30 31 31 32 IMPLICIT NONE … … 33 34 34 35 PUBLIC p4z_flx 35 36 REAL(wp) :: & ! pre-industrial atmospheric [co2] (ppm) 37 atcox = 0.20946 , & !: 38 atcco2 = 278. !: 39 40 REAL(wp) :: & 41 xconv = 0.01/3600 !: coefficients for conversion 42 43 INTEGER :: nspyr !: number of timestep per year 44 45 #if defined key_cpl_carbon_cycle 46 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: & 47 oce_co2 !: ocean carbon flux 48 REAL(wp) :: & 49 t_atm_co2_flx, & !: Total atmospheric carbon flux per year 50 t_oce_co2_flx !: Total ocean carbon flux per year 51 #endif 36 PUBLIC p4z_flx_init 37 38 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: oce_co2 !: ocean carbon flux 39 REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: satmco2 !: atmospheric pco2 40 REAL(wp) :: t_oce_co2_flx !: Total ocean carbon flux 41 REAL(wp) :: t_atm_co2_flx !: global mean of atmospheric pco2 42 REAL(wp) :: area !: ocean surface 43 REAL(wp) :: atcco2 = 278. !: pre-industrial atmospheric [co2] (ppm) 44 REAL(wp) :: atcox = 0.20946 !: 45 REAL(wp) :: xconv = 0.01/3600 !: coefficients for conversion 52 46 53 47 !!* Substitution 54 48 # include "top_substitute.h90" 55 49 !!---------------------------------------------------------------------- 56 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)50 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 57 51 !! $Id$ 58 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)52 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 59 53 !!---------------------------------------------------------------------- 60 54 … … 75 69 REAL(wp) :: zph, zah2, zbot, zdic, zalk, zsch_o2, zalka, zsch_co2 76 70 REAL(wp), DIMENSION(jpi,jpj) :: zkgco2, zkgo2, zh2co3 77 #if defined key_ trc_diaadd&& defined key_iomput78 REAL(wp), DIMENSION(jpi,jpj) :: z cflx, zoflx, zkg, zdpco2, zdpo271 #if defined key_diatrc && defined key_iomput 72 REAL(wp), DIMENSION(jpi,jpj) :: zoflx, zkg, zdpco2, zdpo2 79 73 #endif 80 74 CHARACTER (len=25) :: charout 81 75 82 76 !!--------------------------------------------------------------------- 83 84 85 IF( kt == nittrc000 ) CALL p4z_flx_init ! Initialization (first time-step only)86 77 87 78 ! SURFACE CHEMISTRY (PCO2 AND [H+] IN 88 79 ! SURFACE LAYER); THE RESULT OF THIS CALCULATION 89 80 ! IS USED TO COMPUTE AIR-SEA FLUX OF CO2 81 82 #if defined key_cpl_carbon_cycle 83 satmco2(:,:) = atm_co2(:,:) 84 #endif 90 85 91 86 DO jrorr = 1, 10 … … 128 123 !CDIR NOVERRCHK 129 124 DO ji = 1, jpi 130 ztc = MIN( 35., t n(ji,jj,1) )125 ztc = MIN( 35., tsn(ji,jj,1,jp_tem) ) 131 126 ztc2 = ztc * ztc 132 127 ztc3 = ztc * ztc2 … … 138 133 ! Compute the piston velocity for O2 and CO2 139 134 zkgwan = 0.3 * zws + 2.5 * ( 0.5246 + 0.016256 * ztc + 0.00049946 * ztc2 ) 140 # if defined key_ off_degrad135 # if defined key_degrad 141 136 zkgwan = zkgwan * xconv * ( 1.- fr_i(ji,jj) ) * tmask(ji,jj,1) * facvol(ji,jj,1) 142 137 #else … … 152 147 DO ji = 1, jpi 153 148 ! Compute CO2 flux for the sea and air 154 #if ! defined key_cpl_carbon_cycle 155 zfld = atcco2 * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj) 149 zfld = satmco2(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj) 156 150 zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj) 157 #else158 zfld = atm_co2(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj)159 zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj)160 ! compute flux of carbon161 151 oce_co2(ji,jj) = ( zfld - zflu ) * rfact & 162 152 & * e1t(ji,jj) * e2t(ji,jj) * tmask(ji,jj,1) * 1000. 163 #endif 153 ! compute the trend 164 154 tra(ji,jj,1,jpdic) = tra(ji,jj,1,jpdic) + ( zfld - zflu ) / fse3t(ji,jj,1) 165 155 … … 169 159 tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy) + ( zfld16 - zflu16 ) / fse3t(ji,jj,1) 170 160 171 #if defined key_ trc_diaadd161 #if defined key_diatrc 172 162 ! Save diagnostics 173 163 # if ! defined key_iomput 174 trc2d(ji,jj,jp_pcs0_2d ) = ( zfld - zflu ) * 1000. * tmask(ji,jj,1) 164 zfact = 1. / ( e1t(ji,jj) * e2t(ji,jj) ) / rfact 165 trc2d(ji,jj,jp_pcs0_2d ) = oce_co2(ji,jj) * zfact 175 166 trc2d(ji,jj,jp_pcs0_2d + 1) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1) 176 167 trc2d(ji,jj,jp_pcs0_2d + 2) = zkgco2(ji,jj) * tmask(ji,jj,1) 177 trc2d(ji,jj,jp_pcs0_2d + 3) = ( atcco2- zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) &168 trc2d(ji,jj,jp_pcs0_2d + 3) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) & 178 169 & * tmask(ji,jj,1) 179 170 # else 180 zcflx(ji,jj) = ( zfld - zflu ) * 1000. * tmask(ji,jj,1)181 171 zoflx(ji,jj) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1) 182 172 zkg (ji,jj) = zkgco2(ji,jj) * tmask(ji,jj,1) 183 zdpco2(ji,jj) = ( atcco2 - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) & 184 & * tmask(ji,jj,1) 185 zdpo2 (ji,jj) = ( atcox - trn(ji,jj,1,jpoxy) / ( chemc(ji,jj,2) + rtrn ) ) & 186 & * tmask(ji,jj,1) 173 zdpco2(ji,jj) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1) 174 zdpo2 (ji,jj) = ( atcox - trn(ji,jj,1,jpoxy) / ( chemc(ji,jj,2) + rtrn ) ) * tmask(ji,jj,1) 187 175 # endif 188 176 #endif … … 190 178 END DO 191 179 192 #if defined key_cpl_carbon_cycle 193 ! Total Flux of Carbon 194 DO jj = 1, jpj 195 DO ji = 1, jpi 196 t_atm_co2_flx = t_atm_co2_flx + atm_co2(ji,jj) * tmask_i(ji,jj) 197 t_oce_co2_flx = t_oce_co2_flx + oce_co2(ji,jj) * tmask_i(ji,jj) 198 END DO 199 END DO 200 201 IF( MOD( kt, nspyr ) == 0 ) THEN 202 IF( lk_mpp ) THEN 203 CALL mpp_sum( t_atm_co2_flx ) ! sum over the global domain 204 CALL mpp_sum( t_oce_co2_flx ) ! sum over the global domain 205 ENDIF 206 ! Conversion in GtC/yr ; negative for outgoing from ocean 207 t_oce_co2_flx = (-1.) * t_oce_co2_flx * 12. / 1.e15 208 ! 209 WRITE(numout,*) ' Atmospheric pCO2 :' 210 WRITE(numout,*) '-------------------- : ',kt,' ',t_atm_co2_flx 211 WRITE(numout,*) '(ppm)' 212 WRITE(numout,*) 'Total Flux of Carbon out of the ocean :' 213 WRITE(numout,*) '-------------------- : ',t_oce_co2_flx 214 WRITE(numout,*) '(GtC/yr)' 215 t_atm_co2_flx = 0. 216 t_oce_co2_flx = 0. 217 # if defined key_iomput 218 CALL iom_put( "tatpco2" , t_atm_co2_flx ) 219 CALL iom_put( "tco2flx" , t_oce_co2_flx ) 220 #endif 180 t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) ) ! Cumulative Total Flux of Carbon 181 IF( kt == nitend ) THEN 182 t_atm_co2_flx = glob_sum( satmco2(:,:) * e1t(:,:) * e2t(:,:) ) ! Total atmospheric pCO2 183 ! 184 t_oce_co2_flx = (-1.) * t_oce_co2_flx * 12. / 1.e15 ! Conversion in PgC ; negative for out of the ocean 185 t_atm_co2_flx = t_atm_co2_flx / area ! global mean of atmospheric pCO2 186 ! 187 IF( lwp) THEN 188 WRITE(numout,*) 189 WRITE(numout,*) ' Global mean of atmospheric pCO2 (ppm) at it= ', kt, ' date= ', ndastp 190 WRITE(numout,*) '------------------------------------------------------- : ',t_atm_co2_flx 191 WRITE(numout,*) 192 WRITE(numout,*) ' Cumulative total Flux of Carbon out of the ocean (PgC) :' 193 WRITE(numout,*) '------------------------------------------------------- ',t_oce_co2_flx 194 ENDIF 195 ! 221 196 ENDIF 222 #endif223 197 224 198 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 228 202 ENDIF 229 203 230 # if defined key_ trc_diaadd&& defined key_iomput231 CALL iom_put( "Cflx" , zcflx)204 # if defined key_diatrc && defined key_iomput 205 CALL iom_put( "Cflx" , oce_co2(:,:) / ( e1t(:,:) * e2t(:,:) ) / rfact ) 232 206 CALL iom_put( "Oflx" , zoflx ) 233 207 CALL iom_put( "Kg" , zkg ) … … 246 220 !! 247 221 !! ** Method : Read the nampisext namelist and check the parameters 248 !! called at the first timestep (nit trc000)222 !! called at the first timestep (nit000) 249 223 !! ** input : Namelist nampisext 250 224 !! … … 263 237 ENDIF 264 238 265 ! number of time step per year 266 nspyr = INT( nyear_len(1) * rday / rdt ) 267 268 #if defined key_cpl_carbon_cycle 239 ! interior global domain surface 240 area = glob_sum( e1t(:,:) * e2t(:,:) ) 241 269 242 ! Initialization of Flux of Carbon 270 oce_co2(:,:) = 0. 271 t_atm_co2_flx = 0. 272 t_oce_co2_flx = 0. 273 #endif 243 oce_co2(:,:) = 0._wp 244 t_atm_co2_flx = 0._wp 245 ! Initialisation of atmospheric pco2 246 satmco2(:,:) = atcco2 247 t_oce_co2_flx = 0._wp 274 248 275 249 END SUBROUTINE p4z_flx_init -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90
- Property svn:executable deleted
r1753 r2528 32 32 33 33 !!---------------------------------------------------------------------- 34 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)34 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 35 35 !! $Id$ 36 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)36 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 37 37 !!---------------------------------------------------------------------- 38 38 … … 55 55 ! ------------------------------------------- 56 56 57 tgfunc (:,:,:) = EXP( 0.063913 * t n(:,:,:) )58 tgfunc2(:,:,:) = EXP( 0.07608 * t n(:,:,:) )57 tgfunc (:,:,:) = EXP( 0.063913 * tsn(:,:,:,jp_tem) ) 58 tgfunc2(:,:,:) = EXP( 0.07608 * tsn(:,:,:,jp_tem) ) 59 59 60 60 ! Computation of the silicon dependant half saturation … … 69 69 END DO 70 70 71 IF( nday_year == 365) THEN71 IF( nday_year == nyear_len(1) ) THEN 72 72 xksi = xksimax 73 73 xksimax = 0.e0 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlim.F90
r1800 r2528 23 23 24 24 PUBLIC p4z_lim 25 PUBLIC p4z_lim_init 25 26 26 27 !! * Shared module variables … … 43 44 # include "top_substitute.h90" 44 45 !!---------------------------------------------------------------------- 45 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)46 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 46 47 !! $Id$ 47 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)48 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 48 49 !!---------------------------------------------------------------------- 49 50 50 51 CONTAINS 51 52 52 SUBROUTINE p4z_lim( kt , jnt)53 SUBROUTINE p4z_lim( kt ) 53 54 !!--------------------------------------------------------------------- 54 55 !! *** ROUTINE p4z_lim *** … … 59 60 !! ** Method : - ??? 60 61 !!--------------------------------------------------------------------- 61 INTEGER, INTENT(in) :: kt, jnt ! ocean time step62 INTEGER, INTENT(in) :: kt 62 63 INTEGER :: ji, jj, jk 63 64 REAL(wp) :: zlim1, zlim2, zlim3, zlim4, zno3, zferlim … … 67 68 68 69 69 IF( ( kt * jnt ) == nittrc000 ) CALL p4z_lim_init ! Initialization (first time-step only) 70 71 72 ! Tuning of the iron concentration to a minimum 73 ! level that is set to the detection limit 74 ! ------------------------------------- 70 ! Tuning of the iron concentration to a minimum 71 ! level that is set to the detection limit 72 ! ------------------------------------- 75 73 76 74 DO jk = 1, jpkm1 … … 85 83 END DO 86 84 87 ! Computation of a variable Ks for iron on diatoms 88 ! taking into account that increasing biomass is 89 ! made of generally bigger cells 90 ! ------------------------------------------------ 85 ! Computation of a variable Ks for iron on diatoms taking into account 86 ! that increasing biomass is made of generally bigger cells 87 ! ------------------------------------------------ 91 88 92 89 DO jk = 1, jpkm1 … … 107 104 END DO 108 105 109 DO jk = 1, jpkm1 110 DO jj = 1, jpj 111 DO ji = 1, jpi 112 113 ! Michaelis-Menten Limitation term for nutrients 114 ! Small flagellates 115 ! ----------------------------------------------- 106 ! Michaelis-Menten Limitation term for nutrients Small flagellates 107 ! ----------------------------------------------- 108 DO jk = 1, jpkm1 109 DO jj = 1, jpj 110 DO ji = 1, jpi 116 111 zdenom = 1. / & 117 112 & ( conc0 * concnnh4 + concnnh4 * trn(ji,jj,jk,jpno3) + conc0 * trn(ji,jj,jk,jpnh4) ) … … 132 127 END DO 133 128 134 DO jk = 1, jpkm1 135 DO jj = 1, jpj 136 DO ji = 1, jpi 137 138 ! Michaelis-Menten Limitation term for nutrients Diatoms 139 ! ---------------------------------------------- 129 ! Michaelis-Menten Limitation term for nutrients Diatoms 130 ! ---------------------------------------------- 131 DO jk = 1, jpkm1 132 DO jj = 1, jpj 133 DO ji = 1, jpi 140 134 zdenom = 1. / & 141 135 & ( conc1 * concdnh4 + concdnh4 * trn(ji,jj,jk,jpno3) + conc1 * trn(ji,jj,jk,jpnh4) ) … … 161 155 DO jj = 1, jpj 162 156 DO ji = 1, jpi 163 ztemp = MAX( 0., t n(ji,jj,jk) )157 ztemp = MAX( 0., tsn(ji,jj,jk,jp_tem) ) 164 158 xfracal(ji,jj,jk) = caco3r * xlimphy(ji,jj,jk) & 165 159 & * MAX( 0.0001, ztemp / ( 2.+ ztemp ) ) & … … 181 175 !! 182 176 !! ** Method : Read the nampislim namelist and check the parameters 183 !! called at the first timestep (nit trc000)177 !! called at the first timestep (nit000) 184 178 !! 185 179 !! ** input : Namelist nampislim -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90
- Property svn:executable deleted
r1836 r2528 27 27 PRIVATE 28 28 29 PUBLIC p4z_lys ! called in p4zprg.F90 29 PUBLIC p4z_lys ! called in trcsms_pisces.F90 30 PUBLIC p4z_lys_init ! called in trcsms_pisces.F90 30 31 31 32 !! * Shared module variables … … 42 43 43 44 !!---------------------------------------------------------------------- 44 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)45 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 45 46 !! $Id$ 46 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)47 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 47 48 !!---------------------------------------------------------------------- 48 49 … … 65 66 REAL(wp) :: zomegaca, zexcess, zexcess0 66 67 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zco3 67 #if defined key_ trc_dia3d&& defined key_iomput68 #if defined key_diatrc && defined key_iomput 68 69 REAL(wp) :: zrfact2 69 70 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zcaldiss … … 72 73 !!--------------------------------------------------------------------- 73 74 74 IF( kt == nittrc000 ) CALL p4z_lys_init ! Initialization (first time-step only)75 76 75 zco3(:,:,:) = 0. 77 76 78 # if defined key_ trc_dia3d&& defined key_iomput77 # if defined key_diatrc && defined key_iomput 79 78 zcaldiss(:,:,:) = 0. 80 79 # endif … … 146 145 ! (ACCORDING TO THIS FORMULATION ALSO SOME PARTICULATE 147 146 ! CACO3 GETS DISSOLVED EVEN IN THE CASE OF OVERSATURATION) 148 # if defined key_ off_degrad147 # if defined key_degrad 149 148 zdispot = kdca * zexcess * trn(ji,jj,jk,jpcal) * facvol(ji,jj,jk) 150 149 # else … … 160 159 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zremco3 161 160 162 # if defined key_ trc_dia3d&& defined key_iomput161 # if defined key_diatrc && defined key_iomput 163 162 zcaldiss(ji,jj,jk) = zremco3 ! calcite dissolution 164 163 # endif … … 167 166 END DO 168 167 169 # if defined key_ trc_diaadd && defined key_trc_dia3d168 # if defined key_diatrc 170 169 # if ! defined key_iomput 171 170 trc3d(:,:,:,jp_pcs0_3d ) = hi (:,:,:) * tmask(:,:,:) … … 197 196 !! 198 197 !! ** Method : Read the nampiscal namelist and check the parameters 199 !! called at the first timestep (nit trc000)198 !! called at the first timestep (nit000) 200 199 !! 201 200 !! ** input : Namelist nampiscal -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmeso.F90
- Property svn:executable deleted
r1836 r2528 26 26 PRIVATE 27 27 28 PUBLIC p4z_meso ! called in p4zbio.F90 28 PUBLIC p4z_meso ! called in p4zbio.F90 29 PUBLIC p4z_meso_init ! called in trcsms_pisces.F90 29 30 30 31 !! * Shared module variables … … 47 48 # include "top_substitute.h90" 48 49 !!---------------------------------------------------------------------- 49 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)50 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 50 51 !! $Id$ 51 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)52 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 52 53 !!---------------------------------------------------------------------- 53 54 54 55 CONTAINS 55 56 56 SUBROUTINE p4z_meso( kt, jnt )57 SUBROUTINE p4z_meso( kt, jnt ) 57 58 !!--------------------------------------------------------------------- 58 59 !! *** ROUTINE p4z_meso *** … … 65 66 INTEGER :: ji, jj, jk 66 67 REAL(wp) :: zcompadi, zcompaph, zcompapoc, zcompaz 67 REAL(wp) :: zfact, z step, zcompam, zdenom, zgraze268 REAL(wp) :: zfact, zcompam, zdenom, zgraze2, zstep 68 69 REAL(wp) :: zgrarem2, zgrafer2, zgrapoc2, zprcaca, zmortz2 69 70 #if defined key_kriest 70 71 REAL znumpoc 71 72 #endif 72 REAL(wp) ,DIMENSION(jpi,jpj,jpk):: zrespz2,ztortz2,zgrazd,zgrazz,zgrazpof73 REAL(wp) ,DIMENSION(jpi,jpj,jpk):: zgrazn,zgrazpoc,zgraznf,zgrazf74 REAL(wp) ,DIMENSION(jpi,jpj,jpk):: zgrazfff,zgrazffe73 REAL(wp) :: zrespz2,ztortz2,zgrazd,zgrazz,zgrazpof 74 REAL(wp) :: zgrazn,zgrazpoc,zgraznf,zgrazf 75 REAL(wp) :: zgrazfff,zgrazffe 75 76 CHARACTER (len=25) :: charout 76 #if defined key_ trc_diaadd && defined key_trc_dia3d&& defined key_iomput77 #if defined key_diatrc && defined key_iomput 77 78 REAL(wp) :: zrfact2 78 79 #endif 79 80 80 81 !!--------------------------------------------------------------------- 81 82 83 IF( ( kt * jnt ) == nittrc000 ) CALL p4z_meso_init ! Initialization (first time-step only)84 85 zrespz2 (:,:,:) = 0.86 ztortz2 (:,:,:) = 0.87 zgrazd (:,:,:) = 0.88 zgrazz (:,:,:) = 0.89 zgrazpof(:,:,:) = 0.90 zgrazn (:,:,:) = 0.91 zgrazpoc(:,:,:) = 0.92 zgraznf (:,:,:) = 0.93 zgrazf (:,:,:) = 0.94 zgrazfff(:,:,:) = 0.95 zgrazffe(:,:,:) = 0.96 97 zstep = rfact2 / rday ! Time step duration for biology98 82 99 83 DO jk = 1, jpkm1 … … 102 86 103 87 zcompam = MAX( ( trn(ji,jj,jk,jpmes) - 1.e-9 ), 0.e0 ) 104 # if defined key_ off_degrad105 z fact = zstep * tgfunc(ji,jj,jk) * zcompam* facvol(ji,jj,jk)88 # if defined key_degrad 89 zstep = xstep * facvol(ji,jj,jk) 106 90 # else 91 zstep = xstep 92 # endif 107 93 zfact = zstep * tgfunc(ji,jj,jk) * zcompam 108 # endif 109 110 ! Respiration rates of both zooplankton 111 ! ------------------------------------- 112 zrespz2(ji,jj,jk) = resrat2 * zfact * ( 1. + 3. * nitrfac(ji,jj,jk) ) & 94 95 ! Respiration rates of both zooplankton 96 ! ------------------------------------- 97 zrespz2 = resrat2 * zfact * ( 1. + 3. * nitrfac(ji,jj,jk) ) & 113 98 & * trn(ji,jj,jk,jpmes) / ( xkmort + trn(ji,jj,jk,jpmes) ) 114 99 115 ! Zooplankton mortality. A square function has been selected with 116 ! no real reason except that it seems to be more stable and may 117 ! mimic predation. 118 ! --------------------------------------------------------------- 119 ztortz2(ji,jj,jk) = mzrat2 * 1.e6 * zfact * trn(ji,jj,jk,jpmes) 100 ! Zooplankton mortality. A square function has been selected with 101 ! no real reason except that it seems to be more stable and may mimic predation 102 ! --------------------------------------------------------------- 103 ztortz2 = mzrat2 * 1.e6 * zfact * trn(ji,jj,jk,jpmes) 120 104 ! 121 END DO 122 END DO 123 END DO 124 125 126 DO jk = 1,jpkm1 127 DO jj = 1,jpj 128 DO ji = 1,jpi 105 129 106 zcompadi = MAX( ( trn(ji,jj,jk,jpdia) - 1.e-8 ), 0.e0 ) 130 107 zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-8 ), 0.e0 ) … … 132 109 zcompapoc = MAX( ( trn(ji,jj,jk,jppoc) - 1.e-8 ), 0.e0 ) 133 110 134 !Microzooplankton grazing135 ! ------------------------111 ! Microzooplankton grazing 112 ! ------------------------ 136 113 zdenom = 1. / ( xkgraz2 + xprefc * trn(ji,jj,jk,jpdia) & 137 114 & + xprefz * trn(ji,jj,jk,jpzoo) & … … 139 116 & + xprefpoc * trn(ji,jj,jk,jppoc) ) 140 117 141 zgraze2 = grazrat2 * zstep * Tgfunc2(ji,jj,jk) * zdenom & 142 # if defined key_off_degrad 143 & * facvol(ji,jj,jk) & 118 zgraze2 = grazrat2 * zstep * Tgfunc2(ji,jj,jk) * zdenom * trn(ji,jj,jk,jpmes) 119 120 zgrazd = zgraze2 * xprefc * zcompadi 121 zgrazz = zgraze2 * xprefz * zcompaz 122 zgrazn = zgraze2 * xprefp * zcompaph 123 zgrazpoc = zgraze2 * xprefpoc * zcompapoc 124 125 zgraznf = zgrazn * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn) 126 zgrazf = zgrazd * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn) 127 zgrazpof = zgrazpoc * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 128 129 ! Mesozooplankton flux feeding on GOC 130 ! ---------------------------------- 131 # if ! defined key_kriest 132 zgrazffe = grazflux * zstep * wsbio4(ji,jj,jk) & 133 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes) 134 zgrazfff = zgrazffe * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn) 135 # else 136 !!--------------------------- KRIEST3 ------------------------------------------- 137 !! zgrazffe = 0.5 * 1.3e-2 / 5.5e-7 * 0.3 * zstep * wsbio3(ji,jj,jk) & 138 !! & * tgfunc(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) & 139 !! # if defined key_degrad 140 !! & * facvol(ji,jj,jk) & 141 !! # endif 142 !! & / (trn(ji,jj,jk,jppoc) * 1.e7 + 0.1) 143 !!--------------------------- KRIEST3 ------------------------------------------- 144 145 zgrazffe = grazflux * zstep * wsbio3(ji,jj,jk) & 146 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) 147 zgrazfff = zgrazffe * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 144 148 # endif 145 & * trn(ji,jj,jk,jpmes)146 147 zgrazd(ji,jj,jk) = zgraze2 * xprefc * zcompadi148 zgrazz(ji,jj,jk) = zgraze2 * xprefz * zcompaz149 zgrazn(ji,jj,jk) = zgraze2 * xprefp * zcompaph150 zgrazpoc(ji,jj,jk) = zgraze2 * xprefpoc * zcompapoc151 152 zgraznf(ji,jj,jk) = zgrazn(ji,jj,jk) * trn(ji,jj,jk,jpnfe) &153 & / (trn(ji,jj,jk,jpphy) + rtrn)154 zgrazf(ji,jj,jk) = zgrazd(ji,jj,jk) * trn(ji,jj,jk,jpdfe) &155 & / (trn(ji,jj,jk,jpdia) + rtrn)156 zgrazpof(ji,jj,jk) = zgrazpoc(ji,jj,jk) * trn(ji,jj,jk,jpsfe) &157 & / (trn(ji,jj,jk,jppoc) + rtrn)158 END DO159 END DO160 END DO161 149 162 163 DO jk = 1,jpkm1 164 DO jj = 1,jpj 165 DO ji = 1,jpi 166 167 ! Mesozooplankton flux feeding on GOC 168 ! ---------------------------------- 169 # if ! defined key_kriest 170 # if ! defined key_off_degrad 171 zgrazffe(ji,jj,jk) = grazflux * zstep * wsbio4(ji,jj,jk) & 172 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes) 173 # else 174 zgrazffe(ji,jj,jk) = grazflux * zstep * wsbio4(ji,jj,jk) * facvol(ji,jj,jk) & 175 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes) 176 # endif 177 zgrazfff(ji,jj,jk) = zgrazffe(ji,jj,jk) & 178 & * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn) 179 # else 180 !!--------------------------- KRIEST3 ------------------------------------------- 181 !! zgrazffe(ji,jj,jk) = 0.5 * 1.3e-2 / 5.5e-7 * 0.3 * zstep * wsbio3(ji,jj,jk) & 182 !! & * tgfunc(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) & 183 # if defined key_off_degrad 184 !! & * facvol(ji,jj,jk) & 185 # endif 186 !! & / (trn(ji,jj,jk,jppoc) * 1.e7 + 0.1) 187 !!--------------------------- KRIEST3 ------------------------------------------- 188 189 # if ! defined key_off_degrad 190 zgrazffe(ji,jj,jk) = grazflux * zstep * wsbio3(ji,jj,jk) & 191 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) 192 # else 193 zgrazffe(ji,jj,jk) = grazflux * zstep * wsbio3(ji,jj,jk) * facvol(ji,jj,jk) & 194 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) 195 # endif 196 197 zgrazfff(ji,jj,jk) = zgrazffe(ji,jj,jk) & 198 & * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 199 # endif 200 END DO 201 END DO 202 END DO 203 204 #if defined key_trc_dia3d 205 ! Total grazing ( grazing by microzoo is already computed in p4zmicro ) 206 grazing(:,:,:) = grazing(:,:,:) + ( zgrazd (:,:,:) + zgrazz (:,:,:) + zgrazn(:,:,:) & 207 & + zgrazpoc(:,:,:) + zgrazffe(:,:,:) ) 208 #endif 209 210 211 DO jk = 1,jpkm1 212 DO jj = 1,jpj 213 DO ji = 1,jpi 214 215 ! Mesozooplankton efficiency 216 ! -------------------------- 217 zgrarem2 = ( zgrazd(ji,jj,jk) + zgrazz(ji,jj,jk) + zgrazn(ji,jj,jk) & 218 & + zgrazpoc(ji,jj,jk) + zgrazffe(ji,jj,jk) ) & 219 & * ( 1. - epsher2 - unass2 ) 150 #if defined key_diatrc 151 ! Total grazing ( grazing by microzoo is already computed in p4zmicro ) 152 grazing(ji,jj,jk) = grazing(ji,jj,jk) + ( zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe ) 153 #endif 154 155 ! Mesozooplankton efficiency 156 ! -------------------------- 157 zgrarem2 = ( zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe ) * ( 1. - epsher2 - unass2 ) 220 158 #if ! defined key_kriest 221 zgrafer2 = (zgrazf(ji,jj,jk) + zgraznf(ji,jj,jk) + zgrazz(ji,jj,jk) & 222 & * ferat3 + zgrazpof(ji,jj,jk) + zgrazfff (ji,jj,jk))*(1.-epsher2-unass2) & 223 & + epsher2 * ( & 224 & zgrazd(ji,jj,jk) * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)-ferat3),0.) & 225 & + zgrazn(ji,jj,jk) * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)-ferat3),0.) & 226 & + zgrazpoc(ji,jj,jk) * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) & 227 & + zgrazffe(ji,jj,jk) * MAX((trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)-ferat3),0.) ) 159 zgrafer2 = ( zgrazf + zgraznf + zgrazz * ferat3 + zgrazpof + zgrazfff ) * ( 1.- epsher2 - unass2 ) & 160 & + epsher2 * ( zgrazd * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)-ferat3),0.) & 161 & + zgrazn * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)-ferat3),0.) & 162 & + zgrazpoc * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) & 163 & + zgrazffe * MAX((trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)-ferat3),0.) ) 228 164 #else 229 zgrafer2 = (zgrazf(ji,jj,jk) + zgraznf(ji,jj,jk) + zgrazz(ji,jj,jk) & 230 & * ferat3 + zgrazpof(ji,jj,jk) + zgrazfff(ji,jj,jk) )*(1.-epsher2-unass2) & 231 & + epsher2 * ( & 232 & zgrazd(ji,jj,jk) * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)-ferat3),0.) & 233 & + zgrazn(ji,jj,jk) * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)-ferat3),0.) & 234 & + zgrazpoc(ji,jj,jk) * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) & 235 & + zgrazffe(ji,jj,jk) * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) ) 236 237 #endif 238 zgrapoc2 = (zgrazd(ji,jj,jk) + zgrazz(ji,jj,jk) + zgrazn(ji,jj,jk) & 239 & + zgrazpoc(ji,jj,jk) + zgrazffe(ji,jj,jk)) * unass2 165 zgrafer2 = ( zgrazf + zgraznf + zgrazz * ferat3 + zgrazpof + zgrazfff ) * ( 1. - epsher2 - unass2 ) & 166 & + epsher2 * ( zgrazd * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)-ferat3),0.) & 167 & + zgrazn * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)-ferat3),0.) & 168 & + zgrazpoc * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) & 169 & + zgrazffe * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) ) 170 171 #endif 172 ! Update the arrays TRA which contain the biological sources and sinks 173 174 zgrapoc2 = zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe 240 175 241 176 tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrarem2 * sigma2 242 177 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrarem2 * sigma2 243 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem2 * ( 1.-sigma2)178 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem2 * ( 1. - sigma2 ) 244 179 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarem2 * sigma2 245 180 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zgrafer2 … … 247 182 248 183 #if defined key_kriest 249 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc2 250 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc2 * xkr_dmeso184 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc2 * unass2 185 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc2 * unass2 * xkr_dmeso 251 186 #else 252 tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zgrapoc2 253 #endif 254 END DO 255 END DO 256 END DO 257 258 DO jk = 1, jpkm1 259 DO jj = 1, jpj 260 DO ji = 1, jpi 261 ! 262 ! Update the arrays TRA which contain the biological sources and sinks 263 ! -------------------------------------------------------------------- 264 zmortz2 = ztortz2(ji,jj,jk) + zrespz2(ji,jj,jk) 265 tra(ji,jj,jk,jpmes) = tra(ji,jj,jk,jpmes) - zmortz2 & 266 & + epsher2 * ( zgrazd(ji,jj,jk) + zgrazz(ji,jj,jk) + zgrazn(ji,jj,jk) & 267 & + zgrazpoc(ji,jj,jk) + zgrazffe(ji,jj,jk) ) 268 tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazd(ji,jj,jk) 269 tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zgrazz(ji,jj,jk) 270 tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) - zgrazn(ji,jj,jk) 271 tra(ji,jj,jk,jpnch) = tra(ji,jj,jk,jpnch) - zgrazn(ji,jj,jk) * trn(ji,jj,jk,jpnch) & 272 & / ( trn(ji,jj,jk,jpphy) + rtrn ) 273 tra(ji,jj,jk,jpdch) = tra(ji,jj,jk,jpdch) - zgrazd(ji,jj,jk) * trn(ji,jj,jk,jpdch) & 274 & / ( trn(ji,jj,jk,jpdia) + rtrn ) 275 tra(ji,jj,jk,jpbsi) = tra(ji,jj,jk,jpbsi) - zgrazd(ji,jj,jk) * trn(ji,jj,jk,jpbsi) & 276 & / ( trn(ji,jj,jk,jpdia) + rtrn ) 277 tra(ji,jj,jk,jpdsi) = tra(ji,jj,jk,jpdsi) + zgrazd(ji,jj,jk) * trn(ji,jj,jk,jpbsi) & 278 & / ( trn(ji,jj,jk,jpdia) + rtrn ) 279 tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) - zgraznf(ji,jj,jk) 280 tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) - zgrazf(ji,jj,jk) 281 282 zprcaca = xfracal(ji,jj,jk) * unass2 * zgrazn(ji,jj,jk) 283 #if defined key_trc_dia3d 187 tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zgrapoc2 * unass2 188 #endif 189 zmortz2 = ztortz2 + zrespz2 190 tra(ji,jj,jk,jpmes) = tra(ji,jj,jk,jpmes) - zmortz2 + epsher2 * zgrapoc2 191 tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazd 192 tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zgrazz 193 tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) - zgrazn 194 tra(ji,jj,jk,jpnch) = tra(ji,jj,jk,jpnch) - zgrazn * trn(ji,jj,jk,jpnch) / ( trn(ji,jj,jk,jpphy) + rtrn ) 195 tra(ji,jj,jk,jpdch) = tra(ji,jj,jk,jpdch) - zgrazd * trn(ji,jj,jk,jpdch) / ( trn(ji,jj,jk,jpdia) + rtrn ) 196 tra(ji,jj,jk,jpbsi) = tra(ji,jj,jk,jpbsi) - zgrazd * trn(ji,jj,jk,jpbsi) / ( trn(ji,jj,jk,jpdia) + rtrn ) 197 tra(ji,jj,jk,jpdsi) = tra(ji,jj,jk,jpdsi) + zgrazd * trn(ji,jj,jk,jpbsi) / ( trn(ji,jj,jk,jpdia) + rtrn ) 198 tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) - zgraznf 199 tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) - zgrazf 200 201 zprcaca = xfracal(ji,jj,jk) * unass2 * zgrazn 202 #if defined key_diatrc 284 203 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 285 204 #endif … … 290 209 #if defined key_kriest 291 210 znumpoc = trn(ji,jj,jk,jpnum) / ( trn(ji,jj,jk,jppoc) + rtrn ) 292 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortz2 & 293 & - zgrazpoc(ji,jj,jk) - zgrazffe(ji,jj,jk) 294 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zgrazpoc(ji,jj,jk) * znumpoc & 295 & + zmortz2 * xkr_dmeso & 296 & - zgrazffe(ji,jj,jk) * znumpoc * wsbio4(ji,jj,jk) & 297 & / ( wsbio3(ji,jj,jk) + rtrn ) 211 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortz2 - zgrazpoc - zgrazffe 212 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zgrazpoc * znumpoc & 213 & + zmortz2 * xkr_dmeso - zgrazffe * znumpoc * wsbio4(ji,jj,jk) / ( wsbio3(ji,jj,jk) + rtrn ) 298 214 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 & 299 & + unass2 * ( ferat3 * zgrazz(ji,jj,jk) + zgraznf(ji,jj,jk) & 300 & + zgrazf(ji,jj,jk) + zgrazpof(ji,jj,jk) + zgrazfff(ji,jj,jk) ) & 301 & - zgrazfff(ji,jj,jk) - zgrazpof(ji,jj,jk) 215 & + unass2 * ( ferat3 * zgrazz + zgraznf + zgrazf + zgrazpof + zgrazfff ) - zgrazfff - zgrazpof 302 216 #else 303 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zgrazpoc (ji,jj,jk)304 tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zmortz2 - zgrazffe (ji,jj,jk)305 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zgrazpof (ji,jj,jk)217 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zgrazpoc 218 tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zmortz2 - zgrazffe 219 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zgrazpof 306 220 tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortz2 & 307 & + unass2 * ( ferat3 * zgrazz(ji,jj,jk) + zgraznf(ji,jj,jk) & 308 & + zgrazf(ji,jj,jk) + zgrazpof(ji,jj,jk) + zgrazfff(ji,jj,jk) ) & 309 & - zgrazfff(ji,jj,jk) 221 & + unass2 * ( ferat3 * zgrazz + zgraznf + zgrazf + zgrazpof + zgrazfff ) - zgrazfff 310 222 #endif 311 223 … … 314 226 END DO 315 227 ! 316 #if defined key_ trc_diaadd && defined key_trc_dia3d&& defined key_iomput228 #if defined key_diatrc && defined key_iomput 317 229 zrfact2 = 1.e3 * rfact2r 318 230 ! Total grazing of phyto by zoo … … 342 254 !! 343 255 !! ** Method : Read the nampismes namelist and check the parameters 344 !! called at the first timestep (nit trc000)256 !! called at the first timestep (nit000) 345 257 !! 346 258 !! ** input : Namelist nampismes … … 373 285 ENDIF 374 286 287 375 288 END SUBROUTINE p4z_meso_init 376 289 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmicro.F90
- Property svn:executable deleted
r1836 r2528 26 26 PRIVATE 27 27 28 PUBLIC p4z_micro ! called in p4zbio.F90 28 PUBLIC p4z_micro ! called in p4zbio.F90 29 PUBLIC p4z_micro_init ! called in trcsms_pisces.F90 29 30 30 31 !! * Shared module variables … … 45 46 # include "top_substitute.h90" 46 47 !!---------------------------------------------------------------------- 47 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)48 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 48 49 !! $Id$ 49 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)50 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 50 51 !!---------------------------------------------------------------------- 51 52 52 53 CONTAINS 53 54 54 SUBROUTINE p4z_micro( kt ,jnt)55 SUBROUTINE p4z_micro( kt ) 55 56 !!--------------------------------------------------------------------- 56 57 !! *** ROUTINE p4z_micro *** … … 60 61 !! ** Method : - ??? 61 62 !!--------------------------------------------------------------------- 62 INTEGER, INTENT(in) :: kt , jnt! ocean time step63 INTEGER, INTENT(in) :: kt ! ocean time step 63 64 INTEGER :: ji, jj, jk 64 65 REAL(wp) :: zcompadi, zcompadi2, zcompaz , zcompaph, zcompapoc 65 REAL(wp) :: zgraze , zdenom , zdenom2 66 REAL(wp) :: zfact , z step , zinano , zidiat, zipoc66 REAL(wp) :: zgraze , zdenom , zdenom2, zstep 67 REAL(wp) :: zfact , zinano , zidiat, zipoc 67 68 REAL(wp) :: zgrarem, zgrafer, zgrapoc, zprcaca, zmortz 68 REAL(wp) , DIMENSION(jpi,jpj,jpk) :: zrespz,ztortz69 REAL(wp) , DIMENSION(jpi,jpj,jpk):: zgrazp, zgrazm, zgrazsd70 REAL(wp) , DIMENSION(jpi,jpj,jpk):: zgrazmf, zgrazsf, zgrazpf69 REAL(wp) :: zrespz, ztortz 70 REAL(wp) :: zgrazp, zgrazm, zgrazsd 71 REAL(wp) :: zgrazmf, zgrazsf, zgrazpf 71 72 CHARACTER (len=25) :: charout 72 73 73 74 !!--------------------------------------------------------------------- 74 75 75 IF( ( kt * jnt ) == nittrc000 ) CALL p4z_micro_init ! Initialization (first time-step only) 76 77 zrespz (:,:,:) = 0. 78 ztortz (:,:,:) = 0. 79 zgrazp (:,:,:) = 0. 80 zgrazm (:,:,:) = 0. 81 zgrazsd(:,:,:) = 0. 82 zgrazmf(:,:,:) = 0. 83 zgrazsf(:,:,:) = 0. 84 zgrazpf(:,:,:) = 0. 85 86 #if defined key_trc_dia3d 76 77 #if defined key_diatrc 87 78 grazing(:,:,:) = 0. !: Initialisation of grazing 88 79 #endif … … 93 84 DO jj = 1, jpj 94 85 DO ji = 1, jpi 95 96 86 zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-9 ), 0.e0 ) 97 # if defined key_ off_degrad98 z fact = zstep * tgfunc(ji,jj,jk) * zcompaz *facvol(ji,jj,jk)87 # if defined key_degrad 88 zstep = xstep * facvol(ji,jj,jk) 99 89 # else 90 zstep = xstep 91 # endif 100 92 zfact = zstep * tgfunc(ji,jj,jk) * zcompaz 101 # endif 102 103 ! Respiration rates of both zooplankton 104 ! ------------------------------------- 105 106 zrespz(ji,jj,jk) = resrat * zfact * ( 1.+ 3.* nitrfac(ji,jj,jk) ) & 93 94 ! Respiration rates of both zooplankton 95 ! ------------------------------------- 96 zrespz = resrat * zfact * ( 1.+ 3.* nitrfac(ji,jj,jk) ) & 107 97 & * trn(ji,jj,jk,jpzoo) / ( xkmort + trn(ji,jj,jk,jpzoo) ) 108 98 109 ! Zooplankton mortality. A square function has been selected with 110 ! no real reason except that it seems to be more stable and may 111 ! mimic predation. 112 ! --------------------------------------------------------------- 113 ztortz(ji,jj,jk) = mzrat * 1.e6 * zfact * trn(ji,jj,jk,jpzoo) 114 115 END DO 116 END DO 117 END DO 118 119 120 121 DO jk = 1,jpkm1 122 DO jj = 1,jpj 123 DO ji = 1,jpi 99 ! Zooplankton mortality. A square function has been selected with 100 ! no real reason except that it seems to be more stable and may mimic predation. 101 ! --------------------------------------------------------------- 102 ztortz = mzrat * 1.e6 * zfact * trn(ji,jj,jk,jpzoo) 103 124 104 zcompadi = MAX( ( trn(ji,jj,jk,jpdia) - 1.e-8 ), 0.e0 ) 125 105 zcompadi2 = MIN( zcompadi, 5.e-7 ) … … 131 111 zdenom2 = 1./ ( xpref2p * zcompaph + xpref2c * zcompapoc + xpref2d * zcompadi2 + rtrn ) 132 112 133 zgraze = grazrat * zstep * tgfunc(ji,jj,jk) & 134 # if defined key_off_degrad 135 & * facvol(ji,jj,jk) & 136 # endif 137 & * trn(ji,jj,jk,jpzoo) 113 zgraze = grazrat * zstep * tgfunc(ji,jj,jk) * trn(ji,jj,jk,jpzoo) 138 114 139 115 zinano = xpref2p * zcompaph * zdenom2 … … 143 119 zdenom = 1./ ( xkgraz + zinano * zcompaph + zipoc * zcompapoc + zidiat * zcompadi2 ) 144 120 145 zgrazp(ji,jj,jk) = zgraze * zinano * zcompaph * zdenom 146 zgrazm(ji,jj,jk) = zgraze * zipoc * zcompapoc * zdenom 147 zgrazsd(ji,jj,jk) = zgraze * zidiat * zcompadi2 * zdenom 148 149 zgrazpf (ji,jj,jk) = zgrazp(ji,jj,jk) * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn) 150 zgrazmf(ji,jj,jk) = zgrazm(ji,jj,jk) * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 151 zgrazsf(ji,jj,jk) = zgrazsd(ji,jj,jk) * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn) 152 153 END DO 154 END DO 155 END DO 156 157 #if defined key_trc_dia3d 158 ! Grazing by microzooplankton 159 grazing(:,:,:) = grazing(:,:,:) + zgrazp(:,:,:) + zgrazm(:,:,:) + zgrazsd(:,:,:) 160 #endif 161 162 DO jk = 1,jpkm1 163 DO jj = 1,jpj 164 DO ji = 1,jpi 165 ! Various remineralization and excretion terms 166 ! -------------------------------------------- 167 168 zgrarem = ( zgrazp(ji,jj,jk) + zgrazm(ji,jj,jk) + zgrazsd(ji,jj,jk) ) & 169 & * ( 1.- epsher - unass ) 170 zgrafer = ( zgrazpf(ji,jj,jk) + zgrazsf(ji,jj,jk) + zgrazmf(ji,jj,jk) ) & 171 & * ( 1.- epsher - unass ) + epsher * & 172 & ( zgrazm(ji,jj,jk) * MAX((trn(ji,jj,jk,jpsfe) /(trn(ji,jj,jk,jppoc)+ rtrn)-ferat3),0.e0) & 173 & + zgrazp(ji,jj,jk) * MAX((trn(ji,jj,jk,jpnfe)/(trn(ji,jj,jk,jpphy)+ rtrn)-ferat3),0.e0) & 174 & + zgrazsd(ji,jj,jk) * MAX((trn(ji,jj,jk,jpdfe)/(trn(ji,jj,jk,jpdia)+ rtrn)-ferat3),0.e0 ) ) 175 zgrapoc = ( zgrazp(ji,jj,jk) + zgrazm(ji,jj,jk) + zgrazsd(ji,jj,jk) ) * unass 121 zgrazp = zgraze * zinano * zcompaph * zdenom 122 zgrazm = zgraze * zipoc * zcompapoc * zdenom 123 zgrazsd = zgraze * zidiat * zcompadi2 * zdenom 124 125 zgrazpf = zgrazp * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn) 126 zgrazmf = zgrazm * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 127 zgrazsf = zgrazsd * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn) 128 #if defined key_diatrc 129 ! Grazing by microzooplankton 130 grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgrazp + zgrazm + zgrazsd 131 #endif 132 133 ! Various remineralization and excretion terms 134 ! -------------------------------------------- 135 zgrarem = ( zgrazp + zgrazm + zgrazsd ) * ( 1.- epsher - unass ) 136 zgrafer = ( zgrazpf + zgrazsf + zgrazmf ) * ( 1.- epsher - unass ) & 137 & + epsher * ( zgrazm * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc)+ rtrn)-ferat3),0.e0) & 138 & + zgrazp * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy)+ rtrn)-ferat3),0.e0) & 139 & + zgrazsd * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia)+ rtrn)-ferat3),0.e0 ) ) 140 141 zgrapoc = ( zgrazp + zgrazm + zgrazsd ) 176 142 177 143 ! Update of the TRA arrays … … 183 149 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarem * sigma1 184 150 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zgrafer 185 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc 151 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc * unass 186 152 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarem * sigma1 187 153 #if defined key_kriest 188 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc * xkr_ddiat 189 #endif 190 END DO 191 END DO 192 END DO 193 194 ! 195 ! Update the arrays TRA which contain the biological sources and sinks 196 ! -------------------------------------------------------------------- 197 198 DO jk = 1, jpkm1 199 DO jj = 1, jpj 200 DO ji = 1, jpi 201 202 zmortz = ztortz(ji,jj,jk) + zrespz(ji,jj,jk) 203 tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zmortz & 204 & + epsher * ( zgrazp(ji,jj,jk) + zgrazm(ji,jj,jk) + zgrazsd(ji,jj,jk)) 205 tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) - zgrazp(ji,jj,jk) 206 tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazsd(ji,jj,jk) 207 tra(ji,jj,jk,jpnch) = tra(ji,jj,jk,jpnch) - zgrazp(ji,jj,jk) & 208 & * trn(ji,jj,jk,jpnch)/(trn(ji,jj,jk,jpphy)+rtrn) 209 tra(ji,jj,jk,jpdch) = tra(ji,jj,jk,jpdch) - zgrazsd(ji,jj,jk) & 210 & * trn(ji,jj,jk,jpdch)/(trn(ji,jj,jk,jpdia)+rtrn) 211 tra(ji,jj,jk,jpbsi) = tra(ji,jj,jk,jpbsi) - zgrazsd(ji,jj,jk) & 212 & * trn(ji,jj,jk,jpbsi)/(trn(ji,jj,jk,jpdia)+rtrn) 213 tra(ji,jj,jk,jpdsi) = tra(ji,jj,jk,jpdsi) + zgrazsd(ji,jj,jk) & 214 & * trn(ji,jj,jk,jpbsi)/(trn(ji,jj,jk,jpdia)+rtrn) 215 tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) - zgrazpf(ji,jj,jk) 216 tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) - zgrazsf(ji,jj,jk) 217 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortz - zgrazm(ji,jj,jk) 218 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz & 219 & + unass * ( zgrazpf(ji,jj,jk) + zgrazsf (ji,jj,jk)) & 220 & - (1.-unass) * zgrazmf(ji,jj,jk) 221 zprcaca = xfracal(ji,jj,jk) * unass * zgrazp(ji,jj,jk) 222 #if defined key_trc_dia3d 154 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc * unass * xkr_ddiat 155 #endif 156 157 ! 158 ! Update the arrays TRA which contain the biological sources and sinks 159 ! -------------------------------------------------------------------- 160 161 zmortz = ztortz + zrespz 162 tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zmortz + epsher * zgrapoc 163 tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) - zgrazp 164 tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazsd 165 tra(ji,jj,jk,jpnch) = tra(ji,jj,jk,jpnch) - zgrazp * trn(ji,jj,jk,jpnch)/(trn(ji,jj,jk,jpphy)+rtrn) 166 tra(ji,jj,jk,jpdch) = tra(ji,jj,jk,jpdch) - zgrazsd * trn(ji,jj,jk,jpdch)/(trn(ji,jj,jk,jpdia)+rtrn) 167 tra(ji,jj,jk,jpbsi) = tra(ji,jj,jk,jpbsi) - zgrazsd * trn(ji,jj,jk,jpbsi)/(trn(ji,jj,jk,jpdia)+rtrn) 168 tra(ji,jj,jk,jpdsi) = tra(ji,jj,jk,jpdsi) + zgrazsd * trn(ji,jj,jk,jpbsi)/(trn(ji,jj,jk,jpdia)+rtrn) 169 tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) - zgrazpf 170 tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) - zgrazsf 171 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortz - zgrazm 172 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz + unass * ( zgrazpf + zgrazsf ) - (1.-unass) * zgrazmf 173 zprcaca = xfracal(ji,jj,jk) * unass * zgrazp 174 #if defined key_diatrc 223 175 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 224 176 #endif … … 228 180 tra(ji,jj,jk,jpcal) = tra(ji,jj,jk,jpcal) + zprcaca 229 181 #if defined key_kriest 230 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + ( zmortz - zgrazm (ji,jj,jk)) * xkr_ddiat182 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + ( zmortz - zgrazm ) * xkr_ddiat 231 183 #endif 232 184 END DO … … 251 203 !! 252 204 !! ** Method : Read the nampiszoo namelist and check the parameters 253 !! called at the first timestep (nit trc000)205 !! called at the first timestep (nit000) 254 206 !! 255 207 !! ** input : Namelist nampiszoo -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmort.F90
- Property svn:executable deleted
r1800 r2528 25 25 26 26 PUBLIC p4z_mort 27 PUBLIC p4z_mort_init 27 28 28 29 … … 35 36 mpratm = 0.01_wp !: 36 37 37 !! * Module variables38 REAL(wp) :: zstep39 40 41 38 42 39 !!* Substitution 43 40 # include "top_substitute.h90" 44 41 !!---------------------------------------------------------------------- 45 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)42 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 46 43 !! $Id$ 47 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)44 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 48 45 !!---------------------------------------------------------------------- 49 46 50 47 CONTAINS 51 48 52 SUBROUTINE p4z_mort( kt , jnt)49 SUBROUTINE p4z_mort( kt ) 53 50 !!--------------------------------------------------------------------- 54 51 !! *** ROUTINE p4z_mort *** … … 59 56 !! ** Method : - ??? 60 57 !!--------------------------------------------------------------------- 61 INTEGER, INTENT(in) :: kt, jnt ! ocean time step 62 !!--------------------------------------------------------------------- 63 64 IF( ( kt * jnt ) == nittrc000 ) CALL p4z_mort_init ! Initialization (first time-step only) 65 66 zstep = rfact2 / rday ! Time step duration for biology 58 INTEGER, INTENT(in) :: kt ! ocean time step 59 !!--------------------------------------------------------------------- 67 60 68 61 CALL p4z_nano ! nanophytoplankton … … 83 76 INTEGER :: ji, jj, jk 84 77 REAL(wp) :: zcompaph 85 REAL(wp) :: zfactfe, zfactch,zprcaca,zfracal86 REAL(wp) :: ztortp ,zrespp,zmortp78 REAL(wp) :: zfactfe, zfactch, zprcaca, zfracal 79 REAL(wp) :: ztortp , zrespp , zmortp , zstep 87 80 CHARACTER (len=25) :: charout 88 81 !!--------------------------------------------------------------------- 89 82 90 83 91 #if defined key_ trc_dia3d84 #if defined key_diatrc 92 85 prodcal(:,:,:) = 0. !: Initialisation of calcite production variable 93 86 #endif … … 99 92 zcompaph = MAX( ( trn(ji,jj,jk,jpphy) - 1e-8 ), 0.e0 ) 100 93 101 ! Squared mortality of Phyto similar to a sedimentation term during 102 ! blooms (Doney et al. 1996) 103 ! ----------------------------------------------------------------- 104 zrespp = wchl * 1.e6 * zstep * xdiss(ji,jj,jk) & 105 # if defined key_off_degrad 106 & * facvol(ji,jj,jk) & 94 # if defined key_degrad 95 zstep = xstep * facvol(ji,jj,jk) 96 # else 97 zstep = xstep 107 98 # endif 108 & * zcompaph * trn(ji,jj,jk,jpphy) 109 110 ! Phytoplankton mortality. This mortality loss is slightly 111 ! increased when nutrients are limiting phytoplankton growth 112 ! as observed for instance in case of iron limitation. 113 ! ---------------------------------------------------------- 114 ztortp = mprat * zstep * trn(ji,jj,jk,jpphy) & 115 # if defined key_off_degrad 116 & * facvol(ji,jj,jk) & 117 # endif 118 & / ( xkmort + trn(ji,jj,jk,jpphy) ) * zcompaph 119 99 ! Squared mortality of Phyto similar to a sedimentation term during 100 ! blooms (Doney et al. 1996) 101 zrespp = wchl * 1.e6 * zstep * xdiss(ji,jj,jk) * zcompaph * trn(ji,jj,jk,jpphy) 102 103 ! Phytoplankton mortality. This mortality loss is slightly 104 ! increased when nutrients are limiting phytoplankton growth 105 ! as observed for instance in case of iron limitation. 106 ztortp = mprat * xstep * trn(ji,jj,jk,jpphy) / ( xkmort + trn(ji,jj,jk,jpphy) ) * zcompaph 120 107 121 108 zmortp = zrespp + ztortp … … 130 117 tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) - zmortp * zfactfe 131 118 zprcaca = xfracal(ji,jj,jk) * zmortp 132 #if defined key_ trc_dia3d119 #if defined key_diatrc 133 120 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 134 121 #endif … … 169 156 INTEGER :: ji, jj, jk 170 157 REAL(wp) :: zfactfe,zfactsi,zfactch, zcompadi 171 REAL(wp) :: zrespp2, ztortp2, zmortp2 158 REAL(wp) :: zrespp2, ztortp2, zmortp2, zstep 172 159 CHARACTER (len=25) :: charout 173 160 … … 175 162 176 163 177 ! Aggregation term for diatoms is increased in case of nutrient178 ! stress as observed in reality. The stressed cells become more179 ! sticky and coagulate to sink quickly out of the euphotic zone180 ! ------------------------------------------------------------164 ! Aggregation term for diatoms is increased in case of nutrient 165 ! stress as observed in reality. The stressed cells become more 166 ! sticky and coagulate to sink quickly out of the euphotic zone 167 ! ------------------------------------------------------------ 181 168 182 169 DO jk = 1, jpkm1 … … 186 173 zcompadi = MAX( ( trn(ji,jj,jk,jpdia) - 1e-8), 0. ) 187 174 188 ! Aggregation term for diatoms is increased in case of nutrient 189 ! stress as observed in reality. The stressed cells become more 190 ! sticky and coagulate to sink quickly out of the euphotic zone 191 ! ------------------------------------------------------------ 192 175 ! Aggregation term for diatoms is increased in case of nutrient 176 ! stress as observed in reality. The stressed cells become more 177 ! sticky and coagulate to sink quickly out of the euphotic zone 178 ! ------------------------------------------------------------ 179 180 # if defined key_degrad 181 zstep = xstep * facvol(ji,jj,jk) 182 # else 183 zstep = xstep 184 # endif 185 ! Phytoplankton respiration 186 ! ------------------------ 193 187 zrespp2 = 1.e6 * zstep * ( wchl + wchld * ( 1.- xlimdia(ji,jj,jk) ) ) & 194 # if defined key_off_degrad195 & * facvol(ji,jj,jk) &196 # endif197 188 & * xdiss(ji,jj,jk) * zcompadi * trn(ji,jj,jk,jpdia) 198 199 200 ! Phytoplankton mortality. 201 ! ------------------------ 202 ztortp2 = mprat2 * zstep * trn(ji,jj,jk,jpdia) & 203 # if defined key_off_degrad 204 & * facvol(ji,jj,jk) & 205 # endif 206 & / ( xkmort + trn(ji,jj,jk,jpdia) ) * zcompadi 207 208 zmortp2 = zrespp2 + ztortp2 209 210 ! Update the arrays tra which contains the biological sources and sinks 211 ! --------------------------------------------------------------------- 189 190 ! Phytoplankton mortality. 191 ! ------------------------ 192 ztortp2 = mprat2 * zstep * trn(ji,jj,jk,jpdia) / ( xkmort + trn(ji,jj,jk,jpdia) ) * zcompadi 193 194 zmortp2 = zrespp2 + ztortp2 195 196 ! Update the arrays tra which contains the biological sources and sinks 197 ! --------------------------------------------------------------------- 212 198 zfactch = trn(ji,jj,jk,jpdch) / ( trn(ji,jj,jk,jpdia) + rtrn ) 213 199 zfactfe = trn(ji,jj,jk,jpdfe) / ( trn(ji,jj,jk,jpdia) + rtrn ) … … 249 235 !! 250 236 !! ** Method : Read the nampismort namelist and check the parameters 251 !! called at the first timestep (nittrc000)237 !! called at the first timestep 252 238 !! 253 239 !! ** input : Namelist nampismort -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90
- Property svn:executable deleted
r1836 r2528 16 16 USE trc ! tracer variables 17 17 USE oce_trc ! tracer-ocean share variables 18 USE trc_oce ! ocean-tracer share variables19 18 USE sms_pisces ! Source Minus Sink of PISCES 20 19 USE iom … … 23 22 PRIVATE 24 23 25 PUBLIC p4z_opt ! called in p4zbio.F90 module 24 PUBLIC p4z_opt ! called in p4zbio.F90 module 25 PUBLIC p4z_opt_init ! called in trcsms_pisces.F90 module 26 26 27 27 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: etot, enano, ediat !: PAR for phyto, nano and diat 28 28 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: emoy !: averaged PAR in the mixed layer 29 29 30 INTEGER :: nksrp ! levels below which the light cannot penetrate ( depth larger than 391 m) 31 REAL(wp) :: & 32 parlux = 0.43 / 3.e0 30 INTEGER :: nksrp ! levels below which the light cannot penetrate ( depth larger than 391 m) 31 REAL(wp) :: parlux = 0.43 / 3.e0 33 32 34 33 REAL(wp), DIMENSION(3,61), PUBLIC :: xkrgb !: tabulated attenuation coefficients for RGB absorption … … 37 36 # include "top_substitute.h90" 38 37 !!---------------------------------------------------------------------- 39 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)38 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 40 39 !! $Id$ 41 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)40 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 42 41 !!---------------------------------------------------------------------- 43 42 44 43 CONTAINS 45 44 46 SUBROUTINE p4z_opt( kt, jnt)45 SUBROUTINE p4z_opt( kt, jnt ) 47 46 !!--------------------------------------------------------------------- 48 47 !! *** ROUTINE p4z_opt *** … … 54 53 !!--------------------------------------------------------------------- 55 54 INTEGER, INTENT(in) :: kt, jnt ! ocean time step 56 INTEGER :: ji, jj, jk , jc55 INTEGER :: ji, jj, jk 57 56 INTEGER :: irgb 58 57 REAL(wp) :: zchl, zxsi0r … … 64 63 65 64 66 ! !* tabulated attenuation coef. 67 IF( kt * jnt == nittrc000 ) THEN 68 ! ! level of light extinction 69 nksrp = trc_oce_ext_lev( rn_si2, 0.33e2 ) 70 IF(lwp) THEN 71 WRITE(numout,*) 72 WRITE(numout,*) ' level max of computation of qsr = ', nksrp, ' ref depth = ', gdepw_0(nksrp+1), ' m' 73 ENDIF 74 !! CALL trc_oce_rgb( xkrgb ) ! tabulated attenuation coefficients 75 CALL trc_oce_rgb_read( xkrgb ) ! tabulated attenuation coefficients 76 etot (:,:,:) = 0.e0 77 enano(:,:,:) = 0.e0 78 ediat(:,:,:) = 0.e0 79 IF( ln_qsr_bio ) etot3(:,:,:) = 0.e0 80 ENDIF 81 82 83 ! Initialisation of variables used to compute PAR 84 ! ----------------------------------------------- 65 ! Initialisation of variables used to compute PAR 66 ! ----------------------------------------------- 85 67 ze1 (:,:,jpk) = 0.e0 86 68 ze2 (:,:,jpk) = 0.e0 … … 227 209 END DO 228 210 229 #if defined key_ trc_diaadd211 #if defined key_diatrc 230 212 # if ! defined key_iomput 231 213 ! save for outputs … … 243 225 END SUBROUTINE p4z_opt 244 226 227 SUBROUTINE p4z_opt_init 228 !!---------------------------------------------------------------------- 229 !! *** ROUTINE p4z_opt_init *** 230 !! 231 !! ** Purpose : Initialization of tabulated attenuation coef 232 !! 233 !! 234 !!---------------------------------------------------------------------- 235 236 CALL trc_oce_rgb( xkrgb ) ! tabulated attenuation coefficients 237 !! CALL trc_oce_rgb_read( xkrgb ) ! tabulated attenuation coefficients 238 nksrp = trc_oce_ext_lev( r_si2, 0.33e2 ) ! max level of light extinction (Blue Chl=0.01) 239 IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksrp, ' ref depth = ', gdepw_0(nksrp+1), ' m' 240 ! 241 etot (:,:,:) = 0.e0 242 enano(:,:,:) = 0.e0 243 ediat(:,:,:) = 0.e0 244 IF( ln_qsr_bio ) etot3(:,:,:) = 0.e0 245 ! 246 END SUBROUTINE p4z_opt_init 245 247 #else 246 248 !!---------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90
- Property svn:executable deleted
r1836 r2528 23 23 24 24 USE lib_mpp 25 USE lib_fortran 25 26 26 27 IMPLICIT NONE 27 28 PRIVATE 28 29 29 PUBLIC p4z_prod ! called in p4zbio.F90 30 PUBLIC p4z_prod ! called in p4zbio.F90 31 PUBLIC p4z_prod_init ! called in trcsms_pisces.F90 30 32 31 33 !! * Shared module variables … … 41 43 grosip = 0.151_wp 42 44 43 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: & 44 & prmax 45 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: prmax 45 46 46 47 REAL(wp) :: & 48 rday1 , & !: 0.6 / rday 47 49 texcret , & !: 1 - excret 48 50 texcret2 , & !: 1 - excret2 49 rpis180 , & !: rpi / 18050 51 tpp !: Total primary production 51 52 INTEGER :: nspyr !: number of timesteps per year53 52 54 53 !!* Substitution 55 54 # include "top_substitute.h90" 56 55 !!---------------------------------------------------------------------- 57 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)56 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 58 57 !! $Id$ 59 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)58 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 60 59 !!---------------------------------------------------------------------- 61 60 … … 78 77 REAL(wp) :: zmxltst, zmxlday, zlim1 79 78 REAL(wp) :: zpislopen , zpislope2n 80 REAL(wp) :: zrum, zcodel, zargu, zv ol81 #if defined key_ trc_diaadd && defined key_trc_dia3d79 REAL(wp) :: zrum, zcodel, zargu, zval, zvol 80 #if defined key_diatrc 82 81 REAL(wp) :: zrfact2 83 82 #endif … … 90 89 CHARACTER (len=25) :: charout 91 90 !!--------------------------------------------------------------------- 92 93 94 IF( ( kt * jnt ) == nittrc000 ) CALL p4z_prod_init ! Initialization (first time-step only)95 96 91 97 92 zprorca (:,:,:) = 0.0 … … 109 104 ! Computation of the optimal production 110 105 111 # if defined key_ off_degrad112 prmax(:,:,:) = 0.6 / rday* tgfunc(:,:,:) * facvol(:,:,:)106 # if defined key_degrad 107 prmax(:,:,:) = rday1 * tgfunc(:,:,:) * facvol(:,:,:) 113 108 # else 114 prmax(:,:,:) = 0.6 / rday* tgfunc(:,:,:)109 prmax(:,:,:) = rday1 * tgfunc(:,:,:) 115 110 # endif 116 111 117 112 ! compute the day length depending on latitude and the day 118 IF(lwp) write(numout,*) 119 IF(lwp) write(numout,*) 'p4zday : - Julian day ', nday_year 120 IF(lwp) write(numout,*) '~~~~~~' 121 122 IF( nleapy == 1 .AND. MOD( nyear, 4 ) == 0 ) THEN 123 zrum = FLOAT( nday_year - 80 ) / 366. 124 ELSE 125 zrum = FLOAT( nday_year - 80 ) / 365. 126 ENDIF 127 zcodel = ASIN( SIN( zrum * rpi * 2. ) * SIN( rpis180 * 23.5 ) ) 113 zrum = FLOAT( nday_year - 80 ) / REAL(nyear_len(1), wp) 114 zcodel = ASIN( SIN( zrum * rpi * 2. ) * SIN( rad * 23.5 ) ) 128 115 129 116 ! day length in hours … … 131 118 DO jj = 1, jpj 132 119 DO ji = 1, jpi 133 zargu = TAN( zcodel ) * TAN( gphit(ji,jj) * r pis180)120 zargu = TAN( zcodel ) * TAN( gphit(ji,jj) * rad ) 134 121 zargu = MAX( -1., MIN( 1., zargu ) ) 135 zstrn(ji,jj) = MAX( 0.0, 24. - 2. * ACOS( zargu ) / rpis180 / 15. ) 122 zval = MAX( 0.0, 24. - 2. * ACOS( zargu ) / rad / 15. ) 123 IF( zval < 1.e0 ) zval = 24. 124 zstrn(ji,jj) = 24. / zval 136 125 END DO 137 126 END DO … … 147 136 ! Computation of the P-I slope for nanos and diatoms 148 137 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 149 ztn = MAX( 0., t n(ji,jj,jk) - 15. )138 ztn = MAX( 0., tsn(ji,jj,jk,jp_tem) - 15. ) 150 139 zadap = 0.+ 1.* ztn / ( 2.+ ztn ) 151 140 zadap2 = 0.e0 … … 227 216 END DO 228 217 229 230 WHERE( zstrn(:,:) < 1.e0 ) zstrn(:,:) = 24.231 zstrn(:,:) = 24. / zstrn(:,:)232 218 233 219 !CDIR NOVERRCHK … … 331 317 332 318 ! Total primary production per year 333 DO jk = 1, jpkm1 334 DO jj = 1, jpj 335 DO ji = 1, jpi 336 zvol = cvol(ji,jj,jk) 337 #if defined key_off_degrad 338 zvol = zvol * facvol(ji,jj,jk) 319 320 #if defined key_degrad 321 tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) * facvol(:,:,:) ) 322 #else 323 tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) ) 339 324 #endif 340 tpp = tpp + ( zprorca(ji,jj,jk) + zprorcad(ji,jj,jk) ) & 341 * zvol * tmask(ji,jj,jk) * tmask_i(ji,jj) 342 END DO 343 END DO 344 END DO 345 346 347 IF( MOD( kt, nspyr ) == 0 .AND. jnt == nrdttrc ) THEN 348 IF( lk_mpp ) CALL mpp_sum( tpp ) 349 WRITE(numout,*) 'Total PP :' 325 326 IF( kt == nitend .AND. jnt == nrdttrc ) THEN 327 WRITE(numout,*) 'Total PP (Gtc) :' 350 328 WRITE(numout,*) '-------------------- : ',tpp * 12. / 1.E12 351 WRITE(numout,*) '(GtC/yr)' 352 tpp = 0. 329 WRITE(numout,*) 353 330 ENDIF 354 331 355 #if defined key_ trc_diaadd && defined key_trc_dia3d&& ! defined key_iomput332 #if defined key_diatrc && ! defined key_iomput 356 333 ! Supplementary diagnostics 357 334 zrfact2 = 1.e3 * rfact2r … … 367 344 #endif 368 345 369 #if defined key_ trc_diaadd && defined key_trc_dia3d&& defined key_iomput346 #if defined key_diatrc && defined key_iomput 370 347 zrfact2 = 1.e3 * rfact2r 371 348 IF ( jnt == nrdttrc ) then … … 396 373 !! 397 374 !! ** Method : Read the nampisprod namelist and check the parameters 398 !! called at the first timestep (nit trc000)375 !! called at the first timestep (nit000) 399 376 !! 400 377 !! ** input : Namelist nampisprod … … 423 400 ENDIF 424 401 425 ! number of timesteps per year 426 nspyr = INT( nyear_len(1) * rday / rdt ) 427 428 rpis180 = rpi / 180. 402 rday1 = 0.6 / rday 429 403 texcret = 1.0 - excret 430 404 texcret2 = 1.0 - excret2 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90
- Property svn:executable deleted
r1800 r2528 27 27 PRIVATE 28 28 29 PUBLIC p4z_rem ! called in p4zbio.F90 29 PUBLIC p4z_rem ! called in p4zbio.F90 30 PUBLIC p4z_rem_init ! called in trcsms_pisces.F90 30 31 31 32 !! * Shared module variables … … 41 42 & denitr !: denitrification array 42 43 43 REAL(wp) :: &44 xstep !: Time step duration for biology45 44 46 45 !!* Substitution 47 46 # include "top_substitute.h90" 48 47 !!---------------------------------------------------------------------- 49 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)48 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 50 49 !! $Id$ 51 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)50 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 52 51 !!---------------------------------------------------------------------- 53 52 54 53 CONTAINS 55 54 56 SUBROUTINE p4z_rem( kt, jnt)55 SUBROUTINE p4z_rem( kt ) 57 56 !!--------------------------------------------------------------------- 58 57 !! *** ROUTINE p4z_rem *** … … 62 61 !! ** Method : - ??? 63 62 !!--------------------------------------------------------------------- 64 INTEGER, INTENT(in) :: kt , jnt! ocean time step63 INTEGER, INTENT(in) :: kt ! ocean time step 65 64 INTEGER :: ji, jj, jk 66 65 REAL(wp) :: zremip, zremik , zlam1b … … 72 71 REAL(wp) :: zofer2, zdenom, zdenom2 73 72 #endif 74 REAL(wp) :: zlamfac, zonitr 73 REAL(wp) :: zlamfac, zonitr, zstep 75 74 REAL(wp), DIMENSION(jpi,jpj) :: ztempbac 76 75 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zdepbac, zfesatur, zolimi … … 78 77 79 78 !!--------------------------------------------------------------------- 80 81 82 IF( ( kt * jnt ) == nittrc000 ) THEN83 CALL p4z_rem_init ! Initialization (first time-step only)84 xstep = rfact2 / rday ! Time step duration for the biology85 nitrfac(:,:,:) = 0.086 denitr (:,:,:) = 0.087 ENDIF88 79 89 80 … … 94 85 ztempbac(:,:) = 0.0 95 86 96 !Computation of the mean phytoplankton concentration as97 !a crude estimate of the bacterial biomass98 !--------------------------------------------------87 ! Computation of the mean phytoplankton concentration as 88 ! a crude estimate of the bacterial biomass 89 ! -------------------------------------------------- 99 90 100 91 DO jk = 1, jpkm1 … … 114 105 DO jj = 1, jpj 115 106 DO ji = 1, jpi 116 117 ! DENITRIFICATION FACTOR COMPUTED FROM O2 LEVELS 118 ! ---------------------------------------------- 119 107 ! denitrification factor computed from O2 levels 120 108 nitrfac(ji,jj,jk) = MAX( 0.e0, 0.4 * ( 6.e-6 - trn(ji,jj,jk,jpoxy) ) & 121 109 & / ( oxymin + trn(ji,jj,jk,jpoxy) ) ) 122 END DO 123 END DO 124 END DO 125 126 nitrfac(:,:,:) = MIN( 1., nitrfac(:,:,:) ) 127 128 129 DO jk = 1, jpkm1 130 DO jj = 1, jpj 131 DO ji = 1, jpi 132 133 ! DOC ammonification. Depends on depth, phytoplankton biomass 134 ! and a limitation term which is supposed to be a parameterization 135 ! of the bacterial activity. 136 ! ---------------------------------------------------------------- 137 zremik = xremik * xstep / 1.e-6 * xlimbac(ji,jj,jk) & 138 # if defined key_off_degrad 139 & * facvol(ji,jj,jk) & 110 nitrfac(ji,jj,jk) = MIN( 1., nitrfac(ji,jj,jk) ) 111 END DO 112 END DO 113 END DO 114 115 DO jk = 1, jpkm1 116 DO jj = 1, jpj 117 DO ji = 1, jpi 118 # if defined key_degrad 119 zstep = xstep * facvol(ji,jj,jk) 120 # else 121 zstep = xstep 140 122 # endif 141 & * zdepbac(ji,jj,jk) 123 ! DOC ammonification. Depends on depth, phytoplankton biomass 124 ! and a limitation term which is supposed to be a parameterization 125 ! of the bacterial activity. 126 zremik = xremik * zstep / 1.e-6 * xlimbac(ji,jj,jk) * zdepbac(ji,jj,jk) 142 127 zremik = MAX( zremik, 5.5e-4 * xstep ) 143 128 144 ! Ammonification in oxic waters with oxygen consumption145 ! -----------------------------------------------------129 ! Ammonification in oxic waters with oxygen consumption 130 ! ----------------------------------------------------- 146 131 zolimi(ji,jj,jk) = MIN( ( trn(ji,jj,jk,jpoxy) - rtrn ) / o2ut, & 147 132 & zremik * ( 1.- nitrfac(ji,jj,jk) ) * trn(ji,jj,jk,jpdoc) ) 148 133 149 ! Ammonification in suboxic waters with denitrification150 ! -------------------------------------------------------134 ! Ammonification in suboxic waters with denitrification 135 ! ------------------------------------------------------- 151 136 denitr(ji,jj,jk) = MIN( ( trn(ji,jj,jk,jpno3) - rtrn ) / rdenit, & 152 137 & zremik * nitrfac(ji,jj,jk) * trn(ji,jj,jk,jpdoc) ) … … 167 152 DO jj = 1, jpj 168 153 DO ji = 1, jpi 169 170 ! NH4 nitrification to NO3. Ceased for oxygen concentrations 171 ! below 2 umol/L. Inhibited at strong light 172 ! ---------------------------------------------------------- 173 zonitr = nitrif * xstep * trn(ji,jj,jk,jpnh4) / ( 1.+ emoy(ji,jj,jk) ) & 174 # if defined key_off_degrad 175 & * facvol(ji,jj,jk) & 154 # if defined key_degrad 155 zstep = xstep * facvol(ji,jj,jk) 156 # else 157 zstep = xstep 176 158 # endif 177 & * ( 1.- nitrfac(ji,jj,jk) ) 178 179 ! 180 ! Update of the tracers trends 181 ! ---------------------------- 182 183 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zonitr 184 tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr 185 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2nit * zonitr 186 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - rno3 * zonitr 159 ! NH4 nitrification to NO3. Ceased for oxygen concentrations 160 ! below 2 umol/L. Inhibited at strong light 161 ! ---------------------------------------------------------- 162 zonitr = nitrif * zstep * trn(ji,jj,jk,jpnh4) / ( 1.+ emoy(ji,jj,jk) ) * ( 1.- nitrfac(ji,jj,jk) ) 163 164 ! Update of the tracers trends 165 ! ---------------------------- 166 167 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zonitr 168 tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr 169 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2nit * zonitr 170 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - rno3 * zonitr 187 171 188 172 END DO … … 200 184 DO ji = 1, jpi 201 185 202 ! Bacterial uptake of iron. No iron is available in DOC. So 203 ! Bacteries are obliged to take up iron from the water. Some 204 ! studies (especially at Papa) have shown this uptake to be 205 ! significant 206 ! ---------------------------------------------------------- 186 ! Bacterial uptake of iron. No iron is available in DOC. So 187 ! Bacteries are obliged to take up iron from the water. Some 188 ! studies (especially at Papa) have shown this uptake to be significant 189 ! ---------------------------------------------------------- 207 190 zbactfer = 15.e-6 * rfact2 * 4.* 0.4 * prmax(ji,jj,jk) & 208 & * ( xlimphy(ji,jj,jk) * zdepbac(ji,jj,jk))**2 & 191 & * ( xlimphy(ji,jj,jk) * zdepbac(ji,jj,jk)) & 192 & * ( xlimphy(ji,jj,jk) * zdepbac(ji,jj,jk)) & 209 193 & / ( xkgraz2 + zdepbac(ji,jj,jk) ) & 210 194 & * ( 0.5 + SIGN( 0.5, trn(ji,jj,jk,jpfer) -2.e-11 ) ) … … 216 200 tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zbactfer 217 201 #endif 218 219 202 END DO 220 203 END DO … … 230 213 DO jj = 1, jpj 231 214 DO ji = 1, jpi 232 233 ! POC disaggregation by turbulence and bacterial activity. 234 ! ------------------------------------------------------------- 235 zremip = xremip * xstep * tgfunc(ji,jj,jk) & 236 # if defined key_off_degrad 237 & * facvol(ji,jj,jk) & 215 # if defined key_degrad 216 zstep = xstep * facvol(ji,jj,jk) 217 # else 218 zstep = xstep 238 219 # endif 239 & * ( 1.- 0.5 * nitrfac(ji,jj,jk) ) 240 241 ! POC disaggregation rate is reduced in anoxic zone as shown by 242 ! sediment traps data. In oxic area, the exponent of the martin s 243 ! law is around -0.87. In anoxic zone, it is around -0.35. This 244 ! means a disaggregation constant about 0.5 the value in oxic zones 245 ! ----------------------------------------------------------------- 220 ! POC disaggregation by turbulence and bacterial activity. 221 ! ------------------------------------------------------------- 222 zremip = xremip * zstep * tgfunc(ji,jj,jk) * ( 1.- 0.5 * nitrfac(ji,jj,jk) ) 223 224 ! POC disaggregation rate is reduced in anoxic zone as shown by 225 ! sediment traps data. In oxic area, the exponent of the martin s 226 ! law is around -0.87. In anoxic zone, it is around -0.35. This 227 ! means a disaggregation constant about 0.5 the value in oxic zones 228 ! ----------------------------------------------------------------- 246 229 zorem = zremip * trn(ji,jj,jk,jppoc) 247 230 zofer = zremip * trn(ji,jj,jk,jpsfe) … … 253 236 #endif 254 237 255 ! Update the appropriate tracers trends256 ! -------------------------------------238 ! Update the appropriate tracers trends 239 ! ------------------------------------- 257 240 258 241 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zorem … … 282 265 DO jj = 1, jpj 283 266 DO ji = 1, jpi 284 285 ! Remineralization rate of BSi depedant on T and saturation 286 ! --------------------------------------------------------- 267 # if defined key_degrad 268 zstep = xstep * facvol(ji,jj,jk) 269 # else 270 zstep = xstep 271 # endif 272 ! Remineralization rate of BSi depedant on T and saturation 273 ! --------------------------------------------------------- 287 274 zsatur = ( sio3eq(ji,jj,jk) - trn(ji,jj,jk,jpsil) ) / ( sio3eq(ji,jj,jk) + rtrn ) 288 275 zsatur = MAX( rtrn, zsatur ) 289 276 zsatur2 = zsatur * ( 1. + tn(ji,jj,jk) / 400.)**4 290 277 znusil = 0.225 * ( 1. + tn(ji,jj,jk) / 15.) * zsatur + 0.775 * zsatur2**9 291 # if defined key_off_degrad 292 zsiremin = xsirem * xstep * znusil * facvol(ji,jj,jk) 293 # else 294 zsiremin = xsirem * xstep * znusil 295 # endif 278 zsiremin = xsirem * zstep * znusil 296 279 zosil = zsiremin * trn(ji,jj,jk,jpdsi) 297 280 298 281 tra(ji,jj,jk,jpdsi) = tra(ji,jj,jk,jpdsi) - zosil 299 282 tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) + zosil 300 301 283 ! 302 284 END DO … … 317 299 !CDIR NOVERRCHK 318 300 DO ji = 1, jpi 319 ! 320 ! Compute de different ratios for scavenging of iron 321 ! -------------------------------------------------- 301 # if defined key_degrad 302 zstep = xstep * facvol(ji,jj,jk) 303 # else 304 zstep = xstep 305 # endif 306 ! Compute de different ratios for scavenging of iron 307 ! -------------------------------------------------- 322 308 323 309 #if defined key_kriest 324 310 zdenom1 = trn(ji,jj,jk,jppoc) / & 325 311 & ( trn(ji,jj,jk,jppoc) + trn(ji,jj,jk,jpdsi) + trn(ji,jj,jk,jpcal) + rtrn ) 326 312 #else 327 313 zdenom = 1. / ( trn(ji,jj,jk,jppoc) + trn(ji,jj,jk,jpgoc) & 328 314 & + trn(ji,jj,jk,jpdsi) + trn(ji,jj,jk,jpcal) + rtrn ) 329 315 330 zdenom1 = trn(ji,jj,jk,jppoc) * zdenom 331 zdenom2 = trn(ji,jj,jk,jpgoc) * zdenom 332 #endif 333 334 335 ! scavenging rate of iron. this scavenging rate depends on the 336 ! load in particles on which they are adsorbed. The 337 ! parameterization has been taken from studies on Th 338 ! ------------------------------------------------------------ 316 zdenom1 = trn(ji,jj,jk,jppoc) * zdenom 317 zdenom2 = trn(ji,jj,jk,jpgoc) * zdenom 318 #endif 319 ! scavenging rate of iron. this scavenging rate depends on the load in particles 320 ! on which they are adsorbed. The parameterization has been taken from studies on Th 321 ! ------------------------------------------------------------ 339 322 zkeq = fekeq(ji,jj,jk) 340 323 zfeequi = ( -( 1. + zfesatur(ji,jj,jk) * zkeq - zkeq * trn(ji,jj,jk,jpfer) ) & … … 349 332 & + trn(ji,jj,jk,jpcal) + trn(ji,jj,jk,jpdsi) ) * 1.e6 350 333 #endif 351 352 # if defined key_off_degrad 353 zscave = zfeequi * zlam1b * xstep * facvol(ji,jj,jk) 354 # else 355 zscave = zfeequi * zlam1b * xstep 356 # endif 357 358 ! Increased scavenging for very high iron concentrations 359 ! found near the coasts due to increased lithogenic particles 360 ! and let s say it unknown processes (precipitation, ...) 361 ! ----------------------------------------------------------- 334 zscave = zfeequi * zlam1b * zstep 335 336 ! Increased scavenging for very high iron concentrations 337 ! found near the coasts due to increased lithogenic particles 338 ! and let s say it unknown processes (precipitation, ...) 339 ! ----------------------------------------------------------- 362 340 zlamfac = MAX( 0.e0, ( gphit(ji,jj) + 55.) / 30. ) 363 341 zlamfac = MIN( 1. , zlamfac ) … … 374 352 #endif 375 353 376 # if defined key_off_degrad 377 zaggdfe = zlam1b * xstep * 0.5 * ( trn(ji,jj,jk,jpfer) - zfeequi ) * facvol(ji,jj,jk) 378 # else 379 zaggdfe = zlam1b * xstep * 0.5 * ( trn(ji,jj,jk,jpfer) - zfeequi ) 380 # endif 354 zaggdfe = zlam1b * zstep * 0.5 * ( trn(ji,jj,jk,jpfer) - zfeequi ) 381 355 382 356 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zscave - zaggdfe … … 400 374 ENDIF 401 375 402 ! Update the arrays TRA which contain the biological sources and sinks403 ! --------------------------------------------------------------------376 ! Update the arrays TRA which contain the biological sources and sinks 377 ! -------------------------------------------------------------------- 404 378 405 379 DO jk = 1, jpkm1 … … 429 403 !! 430 404 !! ** Method : Read the nampisrem namelist and check the parameters 431 !! called at the first timestep (nittrc000)405 !! called at the first timestep 432 406 !! 433 407 !! ** input : Namelist nampisrem … … 452 426 ENDIF 453 427 428 nitrfac(:,:,:) = 0.0 429 denitr (:,:,:) = 0.0 430 454 431 END SUBROUTINE p4z_rem_init 455 456 457 458 459 432 460 433 #else -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90
- Property svn:executable deleted
r1836 r2528 19 19 USE sms_pisces 20 20 USE lib_mpp 21 USE lib_fortran 21 22 USE prtctl_trc 22 23 USE p4zbio … … 34 35 35 36 PUBLIC p4z_sed 37 PUBLIC p4z_sed_init 36 38 37 39 !! * Shared module variables … … 47 49 48 50 !! * Module variables 49 INTEGER :: & 50 ryyss, & !: number of seconds per year 51 rmtss !: number of seconds per month 52 51 REAL(wp) :: ryyss !: number of seconds per year 52 REAL(wp) :: ryyss1 !: inverse of ryyss 53 REAL(wp) :: rmtss !: number of seconds per month 54 REAL(wp) :: rday1 !: inverse of rday 55 56 INTEGER , PARAMETER :: & 57 jpmth = 12, jpyr = 1 53 58 INTEGER :: & 54 59 numdust, & !: logical unit for surface fluxes data 55 60 nflx1 , nflx2, & !: first and second record used 56 61 nflx11, nflx12 ! ??? 57 REAL(wp), DIMENSION(jpi,jpj,2) :: & !: 58 dustmo !: 2 consecutive set of dust fields 59 REAL(wp), DIMENSION(jpi,jpj) :: & 60 rivinp, cotdep, nitdep, dust 61 REAL(wp), DIMENSION(jpi,jpj,jpk) :: & 62 ironsed 62 REAL(wp), DIMENSION(jpi,jpj,jpmth) :: dustmo !: set of dust fields 63 REAL(wp), DIMENSION(jpi,jpj) :: rivinp, cotdep, nitdep, dust 64 REAL(wp), DIMENSION(jpi,jpj) :: e1e2t 65 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ironsed 63 66 REAL(wp) :: sumdepsi, rivalkinput, rivpo4input, nitdepinput 64 67 … … 66 69 # include "top_substitute.h90" 67 70 !!---------------------------------------------------------------------- 68 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)71 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 69 72 !! $Header:$ 70 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)73 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 71 74 !!---------------------------------------------------------------------- 72 75 73 76 CONTAINS 74 77 75 SUBROUTINE p4z_sed( kt, jnt)78 SUBROUTINE p4z_sed( kt, jnt ) 76 79 !!--------------------------------------------------------------------- 77 80 !! *** ROUTINE p4z_sed *** … … 84 87 !!--------------------------------------------------------------------- 85 88 INTEGER, INTENT(in) :: kt, jnt ! ocean time step 86 INTEGER :: ji, jj, jk 87 INTEGER :: ikt 89 INTEGER :: ji, jj, jk, ikt 88 90 #if ! defined key_sed 89 91 REAL(wp) :: zsumsedsi, zsumsedpo4, zsumsedcal 92 REAL(wp) :: zrivalk, zrivsil, zrivpo4 90 93 #endif 91 REAL(wp) :: z conctmp , zdenitot , znitrpottot92 REAL(wp) :: z lim, zconctmp2, zstep, zfact94 REAL(wp) :: zdenitot, znitrpottot, zlim, zfact 95 REAL(wp) :: zwsbio3, zwsbio4, zwscal 93 96 REAL(wp), DIMENSION(jpi,jpj) :: zsidep 97 REAL(wp), DIMENSION(jpi,jpj) :: zwork, zwork1 94 98 REAL(wp), DIMENSION(jpi,jpj,jpk) :: znitrpot, zirondep 95 #if defined key_diaadd || defined key_trc_dia3d96 REAL(wp) :: zrfact297 # if defined key_iomput98 REAL(wp), DIMENSION(jpi,jpj) :: zw2d99 # endif100 #endif101 99 CHARACTER (len=25) :: charout 102 100 !!--------------------------------------------------------------------- 103 101 104 105 IF( ( kt * jnt ) == nittrc000 ) CALL p4z_sed_init ! Initialization (first time-step only) 106 IF( (jnt == 1) .and. ( ln_dustfer ) ) CALL p4z_sbc( kt ) 107 108 zstep = rfact2 / rday ! Time step duration for the biology 109 110 zirondep(:,:,:) = 0.e0 ! Initialisation of variables used to compute deposition 111 zsidep (:,:) = 0.e0 102 IF( jnt == 1 .AND. ln_dustfer ) CALL p4z_sbc( kt ) 112 103 113 104 ! Iron and Si deposition at the surface … … 116 107 DO jj = 1, jpj 117 108 DO ji = 1, jpi 118 zirondep(ji,jj,1) = ( dustsolub * dust(ji,jj) / ( 55.85 * rmtss ) + 3.e-10 / ryyss) &109 zirondep(ji,jj,1) = ( dustsolub * dust(ji,jj) / ( 55.85 * rmtss ) + 3.e-10 * ryyss1 ) & 119 110 & * rfact2 / fse3t(ji,jj,1) 120 111 zsidep (ji,jj) = 8.8 * 0.075 * dust(ji,jj) * rfact2 / ( fse3t(ji,jj,1) * 28.1 * rmtss ) … … 150 141 151 142 #if ! defined key_sed 152 ! Initialisation of variables used to compute Sinking Speed153 zsumsedsi = 0.e0154 zsumsedpo4 = 0.e0155 zsumsedcal = 0.e0156 157 143 ! Loss of biogenic silicon, Caco3 organic carbon in the sediments. 158 144 ! First, the total loss is computed. … … 161 147 DO jj = 1, jpj 162 148 DO ji = 1, jpi 163 ikt = MAX( mbathy(ji,jj)-1, 1 ) 164 zfact = e1t(ji,jj) * e2t(ji,jj) / rday * tmask_i(ji,jj) 149 ikt = mbkt(ji,jj) 165 150 # if defined key_kriest 166 z sumsedsi = zsumsedsi + zfact *trn(ji,jj,ikt,jpdsi) * wscal (ji,jj,ikt)167 z sumsedpo4 = zsumsedpo4 + zfact *trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt)151 zwork (ji,jj) = trn(ji,jj,ikt,jpdsi) * wscal (ji,jj,ikt) 152 zwork1(ji,jj) = trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt) 168 153 # else 169 zsumsedsi = zsumsedsi + zfact * trn(ji,jj,ikt,jpdsi) * wsbio4(ji,jj,ikt) 170 zsumsedpo4 = zsumsedpo4 + zfact *( trn(ji,jj,ikt,jpgoc) * wsbio4(ji,jj,ikt) & 171 & + trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt) ) 154 zwork (ji,jj) = trn(ji,jj,ikt,jpdsi) * wsbio4(ji,jj,ikt) 155 zwork1(ji,jj) = trn(ji,jj,ikt,jpgoc) * wsbio4(ji,jj,ikt) + trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt) 172 156 # endif 173 zsumsedcal = zsumsedcal + zfact * trn(ji,jj,ikt,jpcal) * wscal (ji,jj,ikt) * 2.e0 174 END DO 175 END DO 176 177 IF( lk_mpp ) THEN 178 CALL mpp_sum( zsumsedsi ) ! sums over the global domain 179 CALL mpp_sum( zsumsedcal ) ! sums over the global domain 180 CALL mpp_sum( zsumsedpo4 ) ! sums over the global domain 181 ENDIF 182 157 END DO 158 END DO 159 zsumsedsi = glob_sum( zwork (:,:) * e1e2t(:,:) ) * rday1 160 zsumsedpo4 = glob_sum( zwork1(:,:) * e1e2t(:,:) ) * rday1 161 DO jj = 1, jpj 162 DO ji = 1, jpi 163 ikt = mbkt(ji,jj) 164 zwork (ji,jj) = trn(ji,jj,ikt,jpcal) * wscal (ji,jj,ikt) 165 END DO 166 END DO 167 zsumsedcal = glob_sum( zwork (:,:) * e1e2t(:,:) ) * 2.0 * rday1 183 168 #endif 184 169 … … 191 176 DO jj = 1, jpj 192 177 DO ji = 1, jpi 193 ikt = MAX( mbathy(ji,jj) - 1, 1 ) 194 zconctmp = trn(ji,jj,ikt,jpdsi) * zstep / fse3t(ji,jj,ikt) & 195 # if ! defined key_kriest 196 & * wscal (ji,jj,ikt) 178 ikt = mbkt(ji,jj) 179 zfact = xstep / fse3t(ji,jj,ikt) 180 zwsbio3 = 1._wp - zfact * wsbio3(ji,jj,ikt) 181 zwsbio4 = 1._wp - zfact * wsbio4(ji,jj,ikt) 182 zwscal = 1._wp - zfact * wscal (ji,jj,ikt) 183 ! 184 # if defined key_kriest 185 trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) * zwsbio4 186 trn(ji,jj,ikt,jpnum) = trn(ji,jj,ikt,jpnum) * zwsbio4 187 trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) * zwsbio3 188 trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) * zwsbio3 197 189 # else 198 & * wsbio4(ji,jj,ikt) 190 trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) * zwscal 191 trn(ji,jj,ikt,jpgoc) = trn(ji,jj,ikt,jpgoc) * zwsbio4 192 trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) * zwsbio3 193 trn(ji,jj,ikt,jpbfe) = trn(ji,jj,ikt,jpbfe) * zwsbio4 194 trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) * zwsbio3 199 195 # endif 200 trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) - zconctmp 196 trn(ji,jj,ikt,jpcal) = trn(ji,jj,ikt,jpcal) * zwscal 197 END DO 198 END DO 201 199 202 200 #if ! defined key_sed 203 trn(ji,jj,ikt,jpsil) = trn(ji,jj,ikt,jpsil) + zconctmp & 204 & * ( 1.- ( sumdepsi + rivalkinput / ryyss / 6. ) / zsumsedsi ) 205 #endif 206 END DO 207 END DO 208 201 zrivsil = 1._wp - ( sumdepsi + rivalkinput * ryyss1 / 6. ) / zsumsedsi 202 zrivalk = 1._wp - ( rivalkinput * ryyss1 ) / zsumsedcal 203 zrivpo4 = 1._wp - ( rivpo4input * ryyss1 ) / zsumsedpo4 209 204 DO jj = 1, jpj 210 205 DO ji = 1, jpi 211 ikt = MAX( mbathy(ji,jj) - 1, 1 ) 212 zconctmp = trn(ji,jj,ikt,jpcal) * wscal(ji,jj,ikt) * zstep / fse3t(ji,jj,ikt) 213 trn(ji,jj,ikt,jpcal) = trn(ji,jj,ikt,jpcal) - zconctmp 214 215 #if ! defined key_sed 216 trn(ji,jj,ikt,jptal) = trn(ji,jj,ikt,jptal) + zconctmp & 217 & * ( 1.- ( rivalkinput / ryyss ) / zsumsedcal ) * 2.e0 218 trn(ji,jj,ikt,jpdic) = trn(ji,jj,ikt,jpdic) + zconctmp & 219 & * ( 1.- ( rivalkinput / ryyss ) / zsumsedcal ) 220 #endif 221 END DO 222 END DO 223 224 DO jj = 1, jpj 225 DO ji = 1, jpi 226 ikt = MAX( mbathy(ji,jj) - 1, 1 ) 227 zfact = zstep / fse3t(ji,jj,ikt) 228 # if ! defined key_kriest 229 zconctmp = trn(ji,jj,ikt,jpgoc) 230 zconctmp2 = trn(ji,jj,ikt,jppoc) 231 trn(ji,jj,ikt,jpgoc) = trn(ji,jj,ikt,jpgoc) - zconctmp * wsbio4(ji,jj,ikt) * zfact 232 trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) - zconctmp2 * wsbio3(ji,jj,ikt) * zfact 233 #if ! defined key_sed 234 trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) & 235 & + ( zconctmp * wsbio4(ji,jj,ikt) + zconctmp2 * wsbio3(ji,jj,ikt) ) * zfact & 236 & * ( 1.- rivpo4input / (ryyss * zsumsedpo4 ) ) 237 #endif 238 trn(ji,jj,ikt,jpbfe) = trn(ji,jj,ikt,jpbfe) - trn(ji,jj,ikt,jpbfe) * wsbio4(ji,jj,ikt) * zfact 239 trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) - trn(ji,jj,ikt,jpsfe) * wsbio3(ji,jj,ikt) * zfact 240 206 ikt = mbkt(ji,jj) 207 zfact = xstep / fse3t(ji,jj,ikt) 208 zwsbio3 = zfact * wsbio3(ji,jj,ikt) 209 zwsbio4 = zfact * wsbio4(ji,jj,ikt) 210 zwscal = zfact * wscal (ji,jj,ikt) 211 trn(ji,jj,ikt,jptal) = trn(ji,jj,ikt,jptal) + trn(ji,jj,ikt,jpcal) * zwscal * zrivalk * 2.0 212 trn(ji,jj,ikt,jpdic) = trn(ji,jj,ikt,jpdic) + trn(ji,jj,ikt,jpcal) * zwscal * zrivalk 213 # if defined key_kriest 214 trn(ji,jj,ikt,jpsil) = trn(ji,jj,ikt,jpsil) + trn(ji,jj,ikt,jpdsi) * zwsbio4 * zrivsil 215 trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) + trn(ji,jj,ikt,jppoc) * zwsbio3 * zrivpo4 241 216 # else 242 zconctmp = trn(ji,jj,ikt,jpnum) 243 zconctmp2 = trn(ji,jj,ikt,jppoc) 244 trn(ji,jj,ikt,jpnum) = trn(ji,jj,ikt,jpnum) & 245 & - zconctmp * wsbio4(ji,jj,ikt) * zfact 246 trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) & 247 & - zconctmp2 * wsbio3(ji,jj,ikt) * zfact 248 #if ! defined key_sed 249 trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) & 250 & + ( zconctmp2 * wsbio3(ji,jj,ikt) ) & 251 & * zfact * ( 1.- rivpo4input / ( ryyss * zsumsedpo4 ) ) 252 #endif 253 trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) & 254 & - trn(ji,jj,ikt,jpsfe) * wsbio3(ji,jj,ikt) * zfact 255 217 trn(ji,jj,ikt,jpsil) = trn(ji,jj,ikt,jpsil) + trn(ji,jj,ikt,jpdsi) * zwscal * zrivsil 218 trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) & 219 & + ( trn(ji,jj,ikt,jppoc) * zwsbio3 + trn(ji,jj,ikt,jpgoc) * zwsbio4 ) * zrivpo4 256 220 # endif 257 221 END DO 258 222 END DO 223 # endif 259 224 260 225 ! Nitrogen fixation (simple parameterization). The total gain … … 263 228 ! ------------------------------------------------------------- 264 229 265 zdenitot = 0.e0 266 DO jk = 1, jpkm1 267 DO jj = 1,jpj 268 DO ji = 1,jpi 269 zdenitot = zdenitot + denitr(ji,jj,jk) * rdenit * cvol(ji,jj,jk) * xnegtr(ji,jj,jk) 270 END DO 271 END DO 272 END DO 273 274 IF( lk_mpp ) CALL mpp_sum( zdenitot ) ! sum over the global domain 230 zdenitot = glob_sum( denitr(:,:,:) * cvol(:,:,:) * xnegtr(:,:,:) ) * rdenit 275 231 276 232 ! Potential nitrogen fixation dependant on temperature and iron … … 285 241 zlim = ( 1.- xnanono3(ji,jj,jk) - xnanonh4(ji,jj,jk) ) 286 242 IF( zlim <= 0.2 ) zlim = 0.01 287 znitrpot(ji,jj,jk) = MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) / rday) &288 # if defined key_ off_degrad243 znitrpot(ji,jj,jk) = MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) * rday1 ) & 244 # if defined key_degrad 289 245 & * facvol(ji,jj,jk) & 290 246 # endif … … 295 251 END DO 296 252 297 znitrpottot = 0.e0 298 DO jk = 1, jpkm1 299 DO jj = 1, jpj 300 DO ji = 1, jpi 301 znitrpottot = znitrpottot + znitrpot(ji,jj,jk) * cvol(ji,jj,jk) 302 END DO 303 END DO 304 END DO 305 306 IF( lk_mpp ) CALL mpp_sum( znitrpottot ) ! sum over the global domain 253 znitrpottot = glob_sum( znitrpot(:,:,:) * cvol(:,:,:) ) 307 254 308 255 ! Nitrogen change due to nitrogen fixation … … 312 259 DO jj = 1, jpj 313 260 DO ji = 1, jpi 314 # if ! defined key_c1d && ( defined key_orca_r4 || defined key_orca_r2 || defined key_orca_r05 || defined key_orca_r025 )315 !! zfact = znitrpot(ji,jj,jk) * zdenitot / znitrpottot316 261 zfact = znitrpot(ji,jj,jk) * 1.e-7 317 # else318 zfact = znitrpot(ji,jj,jk) * 1.e-7319 # endif320 262 trn(ji,jj,jk,jpnh4) = trn(ji,jj,jk,jpnh4) + zfact 321 263 trn(ji,jj,jk,jpoxy) = trn(ji,jj,jk,jpoxy) + zfact * o2nit … … 325 267 END DO 326 268 327 #if defined key_ trc_diaadd || defined key_trc_dia3d328 z rfact2= 1.e+3 * rfact2r269 #if defined key_diatrc 270 zfact = 1.e+3 * rfact2r 329 271 # if ! defined key_iomput 330 trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * z rfact2* fse3t(:,:,1) * tmask(:,:,1)331 trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * 1.e-7 * z rfact2* fse3t(:,:,1) * tmask(:,:,1)332 # else333 ! surface downward net flux of iron334 zw 2d(:,:) = ( zirondep(:,:,1) + ironsed(:,:,1) * rfact2 ) * zrfact2 * fse3t(:,:,1) * tmask(:,:,1)335 IF( jnt == nrdttrc ) CALL iom_put( "Irondep", zw2d )336 ! nitrogen fixation at surface337 zw2d(:,:) = znitrpot(:,:,1) * 1.e-7 * zrfact2 * fse3t(:,:,1) * tmask(:,:,1)338 IF( jnt == nrdttrc ) CALL iom_put( "Nfix" , zw2d )339 # endif340 # 272 trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * zfact * fse3t(:,:,1) * tmask(:,:,1) 273 trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1) 274 # else 275 zwork (:,:) = ( zirondep(:,:,1) + ironsed(:,:,1) * rfact2 ) * zfact * fse3t(:,:,1) * tmask(:,:,1) 276 zwork1(:,:) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1) 277 IF( jnt == nrdttrc ) THEN 278 CALL iom_put( "Irondep", zwork ) ! surface downward net flux of iron 279 CALL iom_put( "Nfix" , zwork1 ) ! nitrogen fixation at surface 280 ENDIF 281 # endif 282 #endif 341 283 ! 342 284 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 348 290 END SUBROUTINE p4z_sed 349 291 350 SUBROUTINE p4z_sbc( kt)292 SUBROUTINE p4z_sbc( kt ) 351 293 352 294 !!---------------------------------------------------------------------- … … 365 307 366 308 !! * Local declarations 367 INTEGER :: & 368 imois, imois2, & ! temporary integers 369 i15 , iman ! " " 370 REAL(wp) :: & 371 zxy ! " " 372 309 INTEGER :: imois, i15, iman 310 REAL(wp) :: zxy 373 311 374 312 !!--------------------------------------------------------------------- … … 381 319 imois = nmonth + i15 - 1 382 320 IF( imois == 0 ) imois = iman 383 imois2 = nmonth 384 385 ! 1. first call kt=nit000 386 ! ----------------------- 387 388 IF( kt == nit000 ) THEN 389 ! initializations 390 nflx1 = 0 391 nflx11 = 0 392 ! open the file 393 IF(lwp) THEN 394 WRITE(numout,*) ' ' 395 WRITE(numout,*) ' **** Routine p4z_sbc' 396 ENDIF 397 CALL iom_open ( 'dust.orca.nc', numdust ) 398 ENDIF 399 400 401 ! Read monthly file 402 ! ---------------- 403 321 322 ! Calendar computation 404 323 IF( kt == nit000 .OR. imois /= nflx1 ) THEN 405 324 406 ! Calendar computation325 IF( kt == nit000 ) nflx1 = 0 407 326 408 327 ! nflx1 number of the first file record used in the simulation … … 410 329 411 330 nflx1 = imois 412 nflx2 = nflx1 +1331 nflx2 = nflx1 + 1 413 332 nflx1 = MOD( nflx1, iman ) 414 333 nflx2 = MOD( nflx2, iman ) 415 334 IF( nflx1 == 0 ) nflx1 = iman 416 335 IF( nflx2 == 0 ) nflx2 = iman 417 IF(lwp) WRITE(numout,*) 'first record file used nflx1 ',nflx1 418 IF(lwp) WRITE(numout,*) 'last record file used nflx2 ',nflx2 419 420 ! Read monthly fluxes data 421 422 ! humidity 423 CALL iom_get ( numdust, jpdom_data, 'dust', dustmo(:,:,1), nflx1 ) 424 CALL iom_get ( numdust, jpdom_data, 'dust', dustmo(:,:,2), nflx2 ) 425 426 IF(lwp .AND. nitend-nit000 <= 100 ) THEN 427 WRITE(numout,*) 428 WRITE(numout,*) ' read clio flx ok' 429 WRITE(numout,*) 430 WRITE(numout,*) 431 WRITE(numout,*) 'Clio month: ',nflx1,' field: dust' 432 CALL prihre( dustmo(:,:,1),jpi,jpj,1,jpi,20,1,jpj,10,1e9,numout ) 433 ENDIF 336 IF(lwp) WRITE(numout,*) 337 IF(lwp) WRITE(numout,*) ' p4z_sbc : first record file used nflx1 ',nflx1 338 IF(lwp) WRITE(numout,*) ' p4z_sbc : last record file used nflx2 ',nflx2 434 339 435 340 ENDIF 436 341 437 ! 3. at every time step interpolation of fluxes342 ! 3. at every time step interpolation of fluxes 438 343 ! --------------------------------------------- 439 344 440 345 zxy = FLOAT( nday + 15 - 30 * i15 ) / 30 441 dust(:,:) = ( (1.-zxy) * dustmo(:,:,1) + zxy * dustmo(:,:,2) ) 442 443 IF( kt == nitend ) CALL iom_close (numdust) 346 dust(:,:) = ( (1.-zxy) * dustmo(:,:,nflx1) + zxy * dustmo(:,:,nflx2) ) 444 347 445 348 END SUBROUTINE p4z_sbc … … 454 357 !! 455 358 !! ** Method : Read the files and compute the budget 456 !! called at the first timestep (nit trc000)359 !! called at the first timestep (nit000) 457 360 !! 458 361 !! ** input : external netcdf files … … 460 363 !!---------------------------------------------------------------------- 461 364 462 INTEGER :: ji, jj, jk, jm 463 INTEGER , PARAMETER :: jpmois = 12, jpan = 1 365 INTEGER :: ji, jj, jk, jm 464 366 INTEGER :: numriv, numbath, numdep 465 367 … … 469 371 REAL(wp) , DIMENSION (jpi,jpj) :: riverdoc, river, ndepo 470 372 REAL(wp) , DIMENSION (jpi,jpj,jpk) :: cmask 471 REAL(wp) , DIMENSION(jpi,jpj,12) :: zdustmo472 373 473 374 NAMELIST/nampissed/ ln_dustfer, ln_river, ln_ndepo, ln_sedinput, sedfeinput, dustsolub … … 495 396 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' 496 397 CALL iom_open ( 'dust.orca.nc', numdust ) 497 DO jm = 1, jpm ois498 CALL iom_get( numdust, jpdom_data, 'dust', zdustmo(:,:,jm), jm )398 DO jm = 1, jpmth 399 CALL iom_get( numdust, jpdom_data, 'dust', dustmo(:,:,jm), jm ) 499 400 END DO 500 401 CALL iom_close( numdust ) 501 402 ELSE 502 zdustmo(:,:,:) = 0.e0403 dustmo(:,:,:) = 0.e0 503 404 dust(:,:) = 0.0 504 405 ENDIF … … 510 411 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 511 412 CALL iom_open ( 'river.orca.nc', numriv ) 512 CALL iom_get ( numriv, jpdom_data, 'riverdic', river (:,:), jp an)513 CALL iom_get ( numriv, jpdom_data, 'riverdoc', riverdoc(:,:), jp an)413 CALL iom_get ( numriv, jpdom_data, 'riverdic', river (:,:), jpyr ) 414 CALL iom_get ( numriv, jpdom_data, 'riverdoc', riverdoc(:,:), jpyr ) 514 415 CALL iom_close( numriv ) 515 416 ELSE … … 524 425 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 525 426 CALL iom_open ( 'ndeposition.orca.nc', numdep ) 526 CALL iom_get ( numdep, jpdom_data, 'ndep', ndepo(:,:), jp an)427 CALL iom_get ( numdep, jpdom_data, 'ndep', ndepo(:,:), jpyr ) 527 428 CALL iom_close( numdep ) 528 429 ELSE … … 537 438 IF(lwp) WRITE(numout,*) ' from bathy.orca.nc file ' 538 439 CALL iom_open ( 'bathy.orca.nc', numbath ) 539 CALL iom_get ( numbath, jpdom_data, 'bathy', cmask(:,:,:), jp an)440 CALL iom_get ( numbath, jpdom_data, 'bathy', cmask(:,:,:), jpyr ) 540 441 CALL iom_close( numbath ) 541 442 ! … … 546 447 zmaskt = tmask(ji+1,jj,jk) * tmask(ji-1,jj,jk) * tmask(ji,jj+1,jk) & 547 448 & * tmask(ji,jj-1,jk) * tmask(ji,jj,jk+1) 548 IF( zmaskt == 0. ) cmask(ji,jj,jk ) = 0.1449 IF( zmaskt == 0. ) cmask(ji,jj,jk ) = MAX( 0.1, cmask(ji,jj,jk) ) 549 450 ENDIF 550 451 END DO … … 567 468 568 469 569 ! Number of seconds per year and per month 570 ryyss = nyear_len(1) * rday 571 rmtss = ryyss / raamo 470 ! ! Number of seconds per year and per month 471 ryyss = nyear_len(1) * rday 472 rmtss = ryyss / raamo 473 rday1 = 1. / rday 474 ryyss1 = 1. / ryyss 475 ! ! ocean surface cell 476 e1e2t(:,:) = e1t(:,:) * e2t(:,:) 572 477 573 478 ! total atmospheric supply of Si 574 479 ! ------------------------------ 575 480 sumdepsi = 0.e0 576 DO jm = 1, jpmois 577 DO jj = 2, jpjm1 578 DO ji = fs_2, fs_jpim1 579 sumdepsi = sumdepsi + zdustmo(ji,jj,jm) / (12.*rmtss) * 8.8 & 580 & * 0.075/28.1 * e1t(ji,jj) * e2t(ji,jj) * tmask(ji,jj,1) * tmask_i(ji,jj) 581 END DO 582 END DO 583 END DO 584 IF( lk_mpp ) CALL mpp_sum( sumdepsi ) ! sum over the global domain 481 DO jm = 1, jpmth 482 zcoef = 1. / ( 12. * rmtss ) * 8.8 * 0.075 / 28.1 483 sumdepsi = sumdepsi + glob_sum( dustmo(:,:,jm) * e1e2t(:,:) ) * zcoef 484 ENDDO 585 485 586 486 ! N/P and Si releases due to coastal rivers … … 588 488 DO jj = 1, jpj 589 489 DO ji = 1, jpi 590 zcoef = ryyss * e1 t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,1) * tmask(ji,jj,1) * tmask_i(ji,jj)490 zcoef = ryyss * e1e2t(ji,jj) * fse3t(ji,jj,1) * tmask(ji,jj,1) 591 491 cotdep(ji,jj) = river(ji,jj) *1E9 / ( 12. * zcoef + rtrn ) 592 492 rivinp(ji,jj) = (river(ji,jj)+riverdoc(ji,jj)) *1E9 / ( 31.6* zcoef + rtrn ) … … 597 497 CALL lbc_lnk( cotdep , 'T', 1. ) ; CALL lbc_lnk( rivinp , 'T', 1. ) ; CALL lbc_lnk( nitdep , 'T', 1. ) 598 498 599 rivpo4input = 0.e0 600 rivalkinput = 0.e0 601 nitdepinput = 0.e0 602 DO jj = 2 , jpjm1 603 DO ji = fs_2, fs_jpim1 604 zcoef = cvol(ji,jj,1) * ryyss 605 rivpo4input = rivpo4input + rivinp(ji,jj) * zcoef 606 rivalkinput = rivalkinput + cotdep(ji,jj) * zcoef 607 nitdepinput = nitdepinput + nitdep(ji,jj) * zcoef 608 END DO 609 END DO 610 IF( lk_mpp ) THEN 611 CALL mpp_sum( rivpo4input ) ! sum over the global domain 612 CALL mpp_sum( rivalkinput ) ! sum over the global domain 613 CALL mpp_sum( nitdepinput ) ! sum over the global domain 614 ENDIF 499 rivpo4input = glob_sum( rivinp(:,:) * cvol(:,:,1) ) * ryyss 500 rivalkinput = glob_sum( cotdep(:,:) * cvol(:,:,1) ) * ryyss 501 nitdepinput = glob_sum( nitdep(:,:) * cvol(:,:,1) ) * ryyss 615 502 616 503 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90
- Property svn:executable deleted
r1836 r2528 19 19 PRIVATE 20 20 21 PUBLIC p4z_sink ! called in p4zbio.F90 21 PUBLIC p4z_sink ! called in p4zbio.F90 22 PUBLIC p4z_sink_init ! called in trcsms_pisces.F90 22 23 23 24 !! * Shared module variables … … 31 32 sinkcal, sinksil, & !: CaCO3 and BSi sinking fluxes 32 33 sinkfer !: Small BFe sinking flux 33 34 REAL(wp) :: &35 xstep , xstep2 !: Time step duration for biology36 34 37 35 INTEGER :: & … … 71 69 # include "top_substitute.h90" 72 70 !!---------------------------------------------------------------------- 73 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)71 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 74 72 !! $Id$ 75 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)73 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 76 74 !!---------------------------------------------------------------------- 77 75 … … 97 95 REAL(wp) :: zdiv , zdiv1, zdiv2, zdiv3, zdiv4, zdiv5 98 96 REAL(wp) :: zval1, zval2, zval3, zval4 99 #if defined key_ trc_diaadd97 #if defined key_diatrc 100 98 REAL(wp) :: zrfact2 101 99 INTEGER :: ik1 … … 106 104 !!--------------------------------------------------------------------- 107 105 108 IF( ( kt * jnt ) == nittrc000 ) THEN 109 CALL p4z_sink_init ! Initialization (first time-step only) 110 xstep = rfact2 / rday ! Time step duration for biology 111 xstep2 = rfact2 / 2. 112 ENDIF 113 114 ! Initialisation of variables used to compute Sinking Speed 115 ! --------------------------------------------------------- 106 ! Initialisation of variables used to compute Sinking Speed 107 ! --------------------------------------------------------- 116 108 117 109 znum3d(:,:,:) = 0.e0 … … 120 112 zval3 = 1. + xkr_eta 121 113 122 ! Computation of the vertical sinking speed : Kriest et Evans, 2000123 ! -----------------------------------------------------------------114 ! Computation of the vertical sinking speed : Kriest et Evans, 2000 115 ! ----------------------------------------------------------------- 124 116 125 117 DO jk = 1, jpkm1 … … 128 120 IF( tmask(ji,jj,jk) /= 0.e0 ) THEN 129 121 znum = trn(ji,jj,jk,jppoc) / ( trn(ji,jj,jk,jpnum) + rtrn ) / xkr_massp 130 ! -------------- To avoid sinking speed over 50 m/day -------122 ! -------------- To avoid sinking speed over 50 m/day ------- 131 123 znum = MIN( xnumm(jk), znum ) 132 124 znum = MAX( 1.1 , znum ) 133 125 znum3d(ji,jj,jk) = znum 134 !------------------------------------------------------------126 !------------------------------------------------------------ 135 127 zeps = ( zval1 * znum - 1. )/ ( znum - 1. ) 136 128 zfm = xkr_frac**( 1. - zeps ) … … 150 142 wscal(:,:,:) = MAX( wsbio3(:,:,:), 50. ) 151 143 152 153 ! INITIALIZE TO ZERO ALL THE SINKING ARRAYS 154 ! ----------------------------------------- 144 ! INITIALIZE TO ZERO ALL THE SINKING ARRAYS 145 ! ----------------------------------------- 155 146 156 147 sinking (:,:,:) = 0.e0 … … 160 151 sinksil (:,:,:) = 0.e0 161 152 162 ! Compute the sedimentation term using p4zsink2 for all 163 ! the sinking particles 164 ! ----------------------------------------------------- 153 ! Compute the sedimentation term using p4zsink2 for all the sinking particles 154 ! ----------------------------------------------------- 165 155 166 156 CALL p4z_sink2( wsbio3, sinking , jppoc ) … … 170 160 CALL p4z_sink2( wscal , sinkcal , jpcal ) 171 161 172 ! Exchange between organic matter compartments due to 173 ! coagulation/disaggregation 174 ! --------------------------------------------------- 162 ! Exchange between organic matter compartments due to coagulation/disaggregation 163 ! --------------------------------------------------- 175 164 176 165 zval1 = 1. + xkr_zeta … … 185 174 186 175 znum = trn(ji,jj,jk,jppoc)/(trn(ji,jj,jk,jpnum)+rtrn) / xkr_massp 187 !-------------- To avoid sinking speed over 50 m/day -------176 !-------------- To avoid sinking speed over 50 m/day ------- 188 177 znum = min(xnumm(jk),znum) 189 178 znum = MAX( 1.1,znum) 190 !------------------------------------------------------------179 !------------------------------------------------------------ 191 180 zeps = ( zval1 * znum - 1.) / ( znum - 1.) 192 181 zdiv = MAX( 1.e-4, ABS( zeps - zval3) ) * SIGN( 1., zeps - zval3 ) … … 199 188 zsm = xkr_frac**xkr_eta 200 189 201 ! Part I : Coagulation dependant on turbulence202 ! ----------------------------------------------190 ! Part I : Coagulation dependant on turbulence 191 ! ---------------------------------------------- 203 192 204 193 zagg1 = ( 0.163 * trn(ji,jj,jk,jpnum)**2 & … … 207 196 & * (zfm*xkr_mass_max**2-xkr_mass_min**2) & 208 197 & * (zeps-1.)**2/(zdiv2*zdiv3)) & 209 # if defined key_ off_degrad198 # if defined key_degrad 210 199 & *facvol(ji,jj,jk) & 211 200 # endif … … 219 208 & -zfm*xkr_mass_max**3*(1.+3.*((zeps-1.)/ & 220 209 & (zeps-2.)+(zeps-1.)/zdiv3)+(zeps-1.)/zdiv1)) & 221 # if defined key_ off_degrad210 # if defined key_degrad 222 211 & *facvol(ji,jj,jk) & 223 212 # endif … … 225 214 226 215 zagg3 = ( 0.163*trn(ji,jj,jk,jpnum)**2*zfm**2*8. * xkr_mass_max**3 & 227 # if defined key_ off_degrad216 # if defined key_degrad 228 217 & *facvol(ji,jj,jk) & 229 218 # endif … … 232 221 zaggsh = ( zagg1 + zagg2 + zagg3 ) * rfact2 * xdiss(ji,jj,jk) / 1000. 233 222 234 ! Aggregation of small into large particles235 ! Part II : Differential settling236 ! ----------------------------------------------223 ! Aggregation of small into large particles 224 ! Part II : Differential settling 225 ! ---------------------------------------------- 237 226 238 227 zagg4 = ( 2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2* & … … 242 231 & ((zfm*zfm*xkr_mass_max**2*zsm-xkr_mass_min**2) & 243 232 & *xkr_eta)/(zdiv*zdiv3*zdiv5) ) & 244 # if defined key_ off_degrad233 # if defined key_degrad 245 234 & *facvol(ji,jj,jk) & 246 235 # endif … … 252 241 & /zdiv3-(xkr_mass_min**2-zfm*zsm*xkr_mass_max**2) & 253 242 & /zdiv) & 254 # if defined key_ off_degrad243 # if defined key_degrad 255 244 & *facvol(ji,jj,jk) & 256 245 # endif … … 261 250 zagg = 0.5 * xkr_stick * ( zaggsh + zaggsi ) 262 251 263 ! Aggregation of DOC to small particles264 ! --------------------------------------252 ! Aggregation of DOC to small particles 253 ! -------------------------------------- 265 254 266 255 zaggdoc = ( 0.4 * trn(ji,jj,jk,jpdoc) & 267 256 & + 1018. * trn(ji,jj,jk,jppoc) ) * xstep & 268 # if defined key_ off_degrad257 # if defined key_degrad 269 258 & * facvol(ji,jj,jk) & 270 259 # endif … … 281 270 END DO 282 271 283 #if defined key_ trc_diaadd272 #if defined key_diatrc 284 273 zrfact2 = 1.e3 * rfact2r 285 274 ik1 = iksed + 1 … … 332 321 !! 333 322 !! ** Method : Read the nampiskrs namelist and check the parameters 334 !! called at the first timestep (nittrc000)323 !! called at the first timestep 335 324 !! 336 325 !! ** input : Namelist nampiskrs … … 473 462 REAL(wp) :: zagg1, zagg2, zagg3, zagg4 474 463 REAL(wp) :: zagg , zaggfe, zaggdoc, zaggdoc2 475 REAL(wp) :: zfact, zwsmax 476 #if defined key_ trc_dia3d464 REAL(wp) :: zfact, zwsmax, zstep 465 #if defined key_diatrc 477 466 REAL(wp) :: zrfact2 478 467 INTEGER :: ik1 … … 481 470 !!--------------------------------------------------------------------- 482 471 483 IF( ( kt * jnt ) == nittrc000 ) THEN 484 xstep = rfact2 / rday ! Timestep duration for biology 485 xstep2 = rfact2 / 2. 486 ENDIF 487 488 ! Sinking speeds of detritus is increased with depth as shown 489 ! by data and from the coagulation theory 490 ! ----------------------------------------------------------- 472 ! Sinking speeds of detritus is increased with depth as shown 473 ! by data and from the coagulation theory 474 ! ----------------------------------------------------------- 491 475 DO jk = 1, jpkm1 492 476 DO jj = 1, jpj 493 477 DO ji=1,jpi 494 zfact = MAX( 0., fsdepw(ji,jj,jk+1) -hmld(ji,jj) ) / 4000.478 zfact = MAX( 0., fsdepw(ji,jj,jk+1) - hmld(ji,jj) ) / 4000. 495 479 wsbio4(ji,jj,jk) = wsbio2 + ( 200.- wsbio2 ) * zfact 496 480 END DO … … 498 482 END DO 499 483 500 ! LIMIT THE VALUES OF THE SINKING SPEEDS 501 ! TO AVOID NUMERICAL INSTABILITIES 502 484 ! limit the values of the sinking speeds to avoid numerical instabilities 503 485 wsbio3(:,:,:) = wsbio 504 !505 ! OA Below, this is garbage. the ideal would be to find a time-splitting 506 ! OA algorithm that does not increase the computing cost by too much507 ! OA In ROMS, I have included a time-splitting procedure. But it is508 ! OA too expensive as the loop is computed globally. Thus, a small e3t509 ! OA at one place determines the number of subtimesteps globally510 ! OA AWFULLY EXPENSIVE !! Not able to find a better approach. Damned !!486 ! 487 ! OA Below, this is garbage. the ideal would be to find a time-splitting 488 ! OA algorithm that does not increase the computing cost by too much 489 ! OA In ROMS, I have included a time-splitting procedure. But it is 490 ! OA too expensive as the loop is computed globally. Thus, a small e3t 491 ! OA at one place determines the number of subtimesteps globally 492 ! OA AWFULLY EXPENSIVE !! Not able to find a better approach. Damned !! 511 493 512 494 DO jk = 1,jpkm1 … … 522 504 wscal(:,:,:) = wsbio4(:,:,:) 523 505 524 ! INITIALIZE TO ZERO ALL THE SINKING ARRAYS 525 ! -----------------------------------------506 ! Initializa to zero all the sinking arrays 507 ! ----------------------------------------- 526 508 527 509 sinking (:,:,:) = 0.e0 … … 532 514 sinkfer2(:,:,:) = 0.e0 533 515 534 ! Compute the sedimentation term using p4zsink2 for all 535 ! the sinking particles 536 ! ----------------------------------------------------- 516 ! Compute the sedimentation term using p4zsink2 for all the sinking particles 517 ! ----------------------------------------------------- 537 518 538 519 CALL p4z_sink2( wsbio3, sinking , jppoc ) … … 543 524 CALL p4z_sink2( wscal , sinkcal , jpcal ) 544 525 545 ! Exchange between organic matter compartments due to 546 ! coagulation/disaggregation 547 ! --------------------------------------------------- 526 ! Exchange between organic matter compartments due to coagulation/disaggregation 527 ! --------------------------------------------------- 548 528 549 529 DO jk = 1, jpkm1 550 530 DO jj = 1, jpj 551 531 DO ji = 1, jpi 552 zfact = xstep * xdiss(ji,jj,jk) 532 # if defined key_degrad 533 zstep = xstep * facvol(ji,jj,jk) 534 # else 535 zstep = xstep 536 # endif 537 zfact = zstep * xdiss(ji,jj,jk) 553 538 ! Part I : Coagulation dependent on turbulence 554 # if defined key_off_degrad555 zagg1 = 940.* zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc) * facvol(ji,jj,jk)556 zagg2 = 1.054e4 * zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc) * facvol(ji,jj,jk)557 # else558 539 zagg1 = 940.* zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc) 559 540 zagg2 = 1.054e4 * zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc) 560 # endif561 541 562 542 ! Part II : Differential settling 563 543 564 544 ! Aggregation of small into large particles 565 # if defined key_off_degrad 566 zagg3 = 0.66 * xstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc) * facvol(ji,jj,jk) 567 zagg4 = 0.e0 * xstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc) * facvol(ji,jj,jk) 568 # else 569 zagg3 = 0.66 * xstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc) 570 zagg4 = 0.e0 * xstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc) 571 # endif 545 zagg3 = 0.66 * zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc) 546 zagg4 = 0.e0 * zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc) 547 572 548 zagg = zagg1 + zagg2 + zagg3 + zagg4 573 549 zaggfe = zagg * trn(ji,jj,jk,jpsfe) / ( trn(ji,jj,jk,jppoc) + rtrn ) 574 550 575 551 ! Aggregation of DOC to small particles 576 #if defined key_off_degrad 577 zaggdoc = ( 80.* trn(ji,jj,jk,jpdoc) + 698. * trn(ji,jj,jk,jppoc) ) & 578 & * facvol(ji,jj,jk) * zfact * trn(ji,jj,jk,jpdoc) 579 zaggdoc2 = 1.05e4 * zfact * trn(ji,jj,jk,jpgoc) & 580 & * facvol(ji,jj,jk) * trn(ji,jj,jk,jpdoc) 581 #else 582 zaggdoc = ( 80.* trn(ji,jj,jk,jpdoc) + 698. * trn(ji,jj,jk,jppoc) ) & 583 & * zfact * trn(ji,jj,jk,jpdoc) 552 zaggdoc = ( 80.* trn(ji,jj,jk,jpdoc) + 698. * trn(ji,jj,jk,jppoc) ) * zfact * trn(ji,jj,jk,jpdoc) 584 553 zaggdoc2 = 1.05e4 * zfact * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpdoc) 585 #endif 554 586 555 ! Update the trends 587 556 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zagg + zaggdoc … … 595 564 END DO 596 565 597 #if defined key_ trc_diaadd566 #if defined key_diatrc 598 567 zrfact2 = 1.e3 * rfact2r 599 568 ik1 = iksed + 1 … … 623 592 END SUBROUTINE p4z_sink 624 593 594 SUBROUTINE p4z_sink_init 595 !!---------------------------------------------------------------------- 596 !! *** ROUTINE p4z_sink_init *** 597 !!---------------------------------------------------------------------- 598 END SUBROUTINE p4z_sink_init 599 625 600 #endif 626 601 … … 641 616 !! 642 617 INTEGER :: ji, jj, jk, jn 643 REAL(wp) :: zigma,zew,zign, zflx 618 REAL(wp) :: zigma,zew,zign, zflx, zstep 644 619 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztraz, zakz 645 620 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zwsink2 … … 647 622 648 623 624 zstep = rfact2 / 2. 625 649 626 ztraz(:,:,:) = 0.e0 650 627 zakz (:,:,:) = 0.e0 651 628 652 629 DO jk = 1, jpkm1 653 # if defined key_ off_degrad630 # if defined key_degrad 654 631 zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rday * tmask(:,:,jk+1) * facvol(:,:,jk) 655 632 # else … … 693 670 DO jj = 1, jpj 694 671 DO ji = 1, jpi 695 zigma = zwsink2(ji,jj,jk+1) * xstep2/ fse3w(ji,jj,jk+1)672 zigma = zwsink2(ji,jj,jk+1) * zstep / fse3w(ji,jj,jk+1) 696 673 zew = zwsink2(ji,jj,jk+1) 697 psinkflx(ji,jj,jk+1) = -zew * ( trn(ji,jj,jk,jp_tra) - 0.5 * ( 1 + zigma ) * zakz(ji,jj,jk) ) * xstep2674 psinkflx(ji,jj,jk+1) = -zew * ( trn(ji,jj,jk,jp_tra) - 0.5 * ( 1 + zigma ) * zakz(ji,jj,jk) ) * zstep 698 675 END DO 699 676 END DO -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/par_pisces.F90
r2049 r2528 6 6 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) revised architecture 7 7 !!---------------------------------------------------------------------- 8 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)8 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 9 9 !! $Id$ 10 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)10 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 11 11 !!---------------------------------------------------------------------- 12 12 USE par_lobster, ONLY : jp_lobster !: number of tracers in LOBSTER … … 17 17 IMPLICIT NONE 18 18 19 INTEGER, P ARAMETER :: jp_lp = jp_lobster !: cumulative number of already defined TRC20 INTEGER, P ARAMETER :: jp_lp_2d = jp_lobster_2d !:21 INTEGER, P ARAMETER :: jp_lp_3d = jp_lobster_3d !:22 INTEGER, P ARAMETER :: jp_lp_trd = jp_lobster_trd !:19 INTEGER, PUBLIC, PARAMETER :: jp_lp = jp_lobster !: cumulative number of already defined TRC 20 INTEGER, PUBLIC, PARAMETER :: jp_lp_2d = jp_lobster_2d !: 21 INTEGER, PUBLIC, PARAMETER :: jp_lp_3d = jp_lobster_3d !: 22 INTEGER, PUBLIC, PARAMETER :: jp_lp_trd = jp_lobster_trd !: 23 23 24 24 #if defined key_pisces && defined key_kriest … … 29 29 LOGICAL, PUBLIC, PARAMETER :: lk_kriest = .TRUE. !: Kriest flag 30 30 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 23 !: number of passive tracers 31 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output ('key_ trc_diaadd')32 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 18 !: additional 3d output ('key_ trc_diaadd')31 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output ('key_diatrc') 32 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 18 !: additional 3d output ('key_diatrc') 33 33 INTEGER, PUBLIC, PARAMETER :: jp_pisces_trd = 1 !: number of sms trends for PISCES 34 34 … … 67 67 LOGICAL, PUBLIC, PARAMETER :: lk_kriest = .FALSE. !: Kriest flag 68 68 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 24 !: number of PISCES passive tracers 69 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output ('key_ trc_diaadd')70 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 11 !: additional 3d output ('key_ trc_diaadd')69 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output ('key_diatrc') 70 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 11 !: additional 3d output ('key_diatrc') 71 71 INTEGER, PUBLIC, PARAMETER :: jp_pisces_trd = 1 !: number of sms trends for PISCES 72 72 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
r1836 r2528 23 23 REAL(wp) :: rfact , rfactr !: ??? 24 24 REAL(wp) :: rfact2, rfact2r !: ??? 25 REAL(wp) :: xstep !: Time step duration for biology 25 26 26 27 !!* Biological parameters … … 62 63 REAL(wp), DIMENSION(jpi,jpj,jpk) :: xlimbac !: ?? 63 64 REAL(wp), DIMENSION(jpi,jpj,jpk) :: xdiss !: ?? 64 #if defined key_ trc_dia3d65 #if defined key_diatrc 65 66 REAL(wp), DIMENSION(jpi,jpj,jpk) :: prodcal !: Calcite production 66 67 REAL(wp), DIMENSION(jpi,jpj,jpk) :: grazing !: Total zooplankton grazing … … 91 92 92 93 !!---------------------------------------------------------------------- 93 !! NEMO/TOP 3. 2 , LOCEAN-IPSL (2009)94 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 94 95 !! $Id$ 95 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)96 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 96 97 !!====================================================================== 97 98 END MODULE sms_pisces -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
r1800 r2528 40 40 # include "top_substitute.h90" 41 41 !!---------------------------------------------------------------------- 42 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)42 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 43 43 !! $Id$ 44 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)44 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 45 45 !!---------------------------------------------------------------------- 46 46 … … 55 55 56 56 57 ! Control consitency 58 CALL trc_ctl_pisces 59 60 57 61 IF(lwp) WRITE(numout,*) 58 62 IF(lwp) WRITE(numout,*) ' trc_ini_pisces : PISCES biochemical model initialisation' 59 63 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 60 64 61 62 65 ! ! Time-step 63 rfact = rdttr a(1) * float(ndttrc)! ---------66 rfact = rdttrc(1) ! --------- 64 67 rfactr = 1. / rfact 65 rfact2 = rfact / float(nrdttrc)68 rfact2 = rfact / FLOAT( nrdttrc ) 66 69 rfact2r = 1. / rfact2 67 70 68 IF(lwp) WRITE(numout,*) ' Tracer time step rfact = ', rfact, ' rdt = ', rdt69 IF(lwp) write(numout,*) ' Biology time step rfact2 = ', rfact271 IF(lwp) WRITE(numout,*) ' Passive Tracer time step rfact = ', rfact, ' rdt = ', rdttra(1) 72 IF(lwp) write(numout,*) ' PISCES Biology time step rfact2 = ', rfact2 70 73 71 74 … … 80 83 81 84 CALL p4z_che ! initialize the chemical constants 82 83 ndayflxtr = 0 ! Initialize a counter for the computation of chemistry84 85 85 86 ! Initialization of tracer concentration in case of no restart … … 128 129 ! 129 130 END SUBROUTINE trc_ini_pisces 130 131 132 SUBROUTINE trc_ctl_pisces 133 !!---------------------------------------------------------------------- 134 !! *** ROUTINE trc_ctl_pisces *** 135 !! 136 !! ** Purpose : control the cpp options, namelist and files 137 !!---------------------------------------------------------------------- 138 139 IF(lwp) WRITE(numout,*) 140 IF(lwp) WRITE(numout,*) ' use PISCES biological model ' 141 142 ! Check number of tracers 143 ! ----------------------- 144 #if defined key_kriest 145 IF( jp_pisces /= 23) CALL ctl_stop( ' PISCES must have 23 passive tracers. Change jp_pisces in par_pisces.F90' ) 146 #else 147 IF( jp_pisces /= 24) CALL ctl_stop( ' PISCES must have 24 passive tracers. Change jp_pisces in par_pisces.F90' ) 148 #endif 149 150 END SUBROUTINE trc_ctl_pisces 151 131 152 #else 132 153 !!---------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90
- Property svn:keywords set to Id
r1836 r2528 21 21 USE iom 22 22 USE trcdta 23 USE lib_mpp 24 USE lib_fortran 23 25 24 26 IMPLICIT NONE … … 118 120 IF(lwp) WRITE(numout,*) 119 121 120 IF( cp_cfg == "orca" .AND. .NOT. lk_ trc_c1d ) THEN ! ORCA condiguration (not 1D) !122 IF( cp_cfg == "orca" .AND. .NOT. lk_c1d ) THEN ! ORCA condiguration (not 1D) ! 121 123 ! ! --------------------------- ! 122 124 ! set total alkalinity, phosphate, nitrate & silicate 123 125 124 zalksum = 0.e0125 zpo4sum = 0.e0126 zno3sum = 0.e0127 zsilsum = 0.e0128 DO jk = 1, jpk129 DO jj = 1, jpj130 DO ji = 1, jpi131 zvol = cvol(ji,jj,jk)132 # if defined key_off_degrad133 zvol = zvol * facvol(ji,jj,jk)134 # endif135 zalksum = zalksum + trn(ji,jj,jk,jptal) * zvol136 zpo4sum = zpo4sum + trn(ji,jj,jk,jppo4) * zvol137 zno3sum = zno3sum + trn(ji,jj,jk,jpno3) * zvol138 zsilsum = zsilsum + trn(ji,jj,jk,jpsil) * zvol139 END DO140 END DO141 END DO142 IF( lk_mpp ) CALL mpp_sum( zalksum ) ! sum over the global domain143 IF( lk_mpp ) CALL mpp_sum( zpo4sum ) ! sum over the global domain144 IF( lk_mpp ) CALL mpp_sum( zno3sum ) ! sum over the global domain145 IF( lk_mpp ) CALL mpp_sum( zsilsum ) ! sum over the global domain146 126 zarea = 1. / areatot * 1.e6 147 zalksum = zalksum * zarea 148 zpo4sum = zpo4sum * zarea / 122. 149 zno3sum = zno3sum * zarea / 7.6 150 zsilsum = zsilsum * zarea 127 # if defined key_degrad 128 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) * facvol(:,:,:) ) * zarea 129 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 122. 130 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 7.6 131 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) * facvol(:,:,:) ) * zarea 132 # else 133 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) ) * zarea 134 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) ) * zarea / 122. 135 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) ) * zarea / 7.6 136 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) ) * zarea 137 # endif 151 138 152 139 IF(lwp) WRITE(numout,*) ' TALK mean : ', zalksum … … 263 250 #if defined key_dtatrc 264 251 ! Restore close seas values to initial data 265 CALL trc_dta( nit trc000 )252 CALL trc_dta( nit000 ) 266 253 DO jn = 1, jptra 267 254 IF( lutini(jn) ) THEN -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
- Property svn:executable deleted
r1753 r2528 22 22 USE p4zche ! 23 23 USE p4zbio ! 24 USE p4zsink ! 25 USE p4zopt ! 26 USE p4zlim ! 27 USE p4zprod ! 28 USE p4zmort ! 29 USE p4zmicro ! 30 USE p4zmeso ! 31 USE p4zrem ! 24 32 USE p4zsed ! 25 33 USE p4zlys ! 26 34 USE p4zflx ! 27 35 28 USE trdmld_trc_oce 29 USE trdmld_trc 36 USE prtctl_trc 37 38 USE trdmod_oce 39 USE trdmod_trc 30 40 31 41 USE sedmodel … … 37 47 38 48 !!---------------------------------------------------------------------- 39 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)49 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 40 50 !! $Id$ 41 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)51 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 42 52 !!---------------------------------------------------------------------- 43 53 … … 59 69 INTEGER :: jnt, jn 60 70 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztrpis ! used for pisces sms trends 71 CHARACTER (len=25) :: charout 61 72 !!--------------------------------------------------------------------- 62 73 63 IF( kt == nit trc000 .AND. .NOT. ln_rsttr) CALL trc_sms_pisces_init ! Initialization (first time-step only)74 IF( kt == nit000 ) CALL trc_sms_pisces_init ! Initialization (first time-step only) 64 75 65 IF( ndayflxtr /= nday ) THEN ! New days76 IF( ndayflxtr /= nday_year ) THEN ! New days 66 77 ! 67 ndayflxtr = nday 78 ndayflxtr = nday_year 79 80 IF(lwp) write(numout,*) 81 IF(lwp) write(numout,*) ' New chemical constants and various rates for biogeochemistry at new day : ', nday_year 82 IF(lwp) write(numout,*) '~~~~~~' 68 83 69 84 CALL p4z_che ! computation of chemical constants … … 71 86 ! 72 87 ENDIF 73 74 88 75 89 DO jnt = 1, nrdttrc ! Potential time splitting if requested … … 91 105 END DO 92 106 107 93 108 IF( l_trdtrc ) THEN 94 109 DO jn = jp_pcs0, jp_pcs1 95 110 ztrpis(:,:,:) = tra(:,:,:,jn) 96 CALL trd_mod_trc( ztrpis, jn, jptr c_trd_sms, kt ) ! save trends111 CALL trd_mod_trc( ztrpis, jn, jptra_trd_sms, kt ) ! save trends 97 112 END DO 98 113 END IF … … 121 136 REAL(wp) :: ztmas, ztmas1 122 137 123 ! Initialization of chemical variables of the carbon cycle 124 ! -------------------------------------------------------- 125 DO jk = 1, jpk 126 DO jj = 1, jpj 127 DO ji = 1, jpi 128 ztmas = tmask(ji,jj,jk) 129 ztmas1 = 1. - tmask(ji,jj,jk) 130 zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / ( 1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) ) ) 131 zco3 = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 132 zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 133 hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 138 IF( .NOT. ln_rsttr ) THEN 139 ! Initialization of chemical variables of the carbon cycle 140 ! -------------------------------------------------------- 141 DO jk = 1, jpk 142 DO jj = 1, jpj 143 DO ji = 1, jpi 144 ztmas = tmask(ji,jj,jk) 145 ztmas1 = 1. - tmask(ji,jj,jk) 146 zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / ( 1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) ) ) 147 zco3 = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 148 zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 149 hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 150 END DO 134 151 END DO 135 152 END DO 136 END DO 153 ! 154 END IF 155 156 ! Time step duration for biology 157 xstep = rfact2 / rday 158 159 CALL p4z_sink_init ! vertical flux of particulate organic matter 160 CALL p4z_opt_init ! Optic: PAR in the water column 161 CALL p4z_lim_init ! co-limitations by the various nutrients 162 CALL p4z_prod_init ! phytoplankton growth rate over the global ocean. 163 CALL p4z_rem_init ! remineralisation 164 CALL p4z_mort_init ! phytoplankton mortality 165 CALL p4z_micro_init ! microzooplankton 166 CALL p4z_meso_init ! mesozooplankton 167 CALL p4z_sed_init ! sedimentation 168 CALL p4z_lys_init ! calcite saturation 169 CALL p4z_flx_init ! gas exchange 170 171 ndayflxtr = 0 137 172 138 173 END SUBROUTINE trc_sms_pisces_init -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/par_sed.F90
- Property svn:keywords set to Id
r1250 r2528 16 16 jpjm1 => jpjm1 , & !: jpj - 1 17 17 jpij => jpij !: jpi x jpj 18 jp_tem => jp_tem !: indice of temperature 19 jp_sal => jp_sal !: indice of salintity 18 20 19 21 #if ! defined key_sed_off -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sed.F90
- Property svn:keywords set to Id
r1715 r2528 17 17 gphit => gphit , & !: latitude of t-point (degre) 18 18 e3t_0 => e3t_0 , & !: reference depth of t-points (m) 19 mb athy => mbathy , & !: bathymetry19 mbkt => mbkt , & !: vertical index of the bottom last T- ocean level 20 20 tmask => tmask , & !: land/ocean mask at t-points 21 21 rdt => rdt !: time step for the dynamics … … 34 34 35 35 USE oce , ONLY : & 36 tn => tn , & !: pot. temperature (celsius) 37 sn => sn !: salinity (psu) 36 tsn => tsn & !: pot. temperature (celsius) and salinity (psu) 38 37 39 38 USE trc, ONLY : & 40 39 trn , & !: tracer 41 nittrc000 , & !: 1st time step of tracer model42 40 nwritetrc !: outputs frequency of tracer model 43 41 … … 215 213 INTEGER, PUBLIC :: & 216 214 numsed = 27 217 218 215 #else 219 216 !!====================================================================== -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedadv.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedarr.F90
- Property svn:keywords set to Id
r1250 r2528 28 28 29 29 !!---------------------------------------------------------------------- 30 !! LIM 2.0, UCL-LOCEAN-IPSL (2005)30 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 31 31 !! $Header: /home/opalod/NEMOCVSROOT/NEMO/LIM_SRC/limtab.F90,v 1.2 2005/03/27 18:34:42 opalod Exp $ 32 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt32 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 33 !!---------------------------------------------------------------------- 34 34 CONTAINS -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedbtb.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedchem.F90
- Property svn:keywords set to Id
r1250 r2528 216 216 DO jj = 1,jpj 217 217 DO ji = 1, jpi 218 ikt = MAX( mbathy(ji,jj)-1, 1 )218 ikt = mbkt(ji,jj) 219 219 IF ( tmask(ji,jj,ikt) == 1 ) THEN 220 220 zchem_data(ji,jj,1) = ak13 (ji,jj,ikt) -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedco3.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/seddsr.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/seddta.F90
- Property svn:keywords set to Id
r1264 r2528 118 118 DO jj = 1,jpj 119 119 DO ji = 1, jpi 120 ikt = MAX( mbathy(ji,jj)-1, 1)120 ikt = mbkt(ji,jj) 121 121 IF ( tmask(ji,jj,ikt) == 1 ) THEN 122 122 trc_data(ji,jj,1) = trn (ji,jj,ikt,jptal) … … 131 131 trc_data(ji,jj,9 ) = sinking2(ji,jj,ikt) 132 132 trc_data(ji,jj,10) = sinkcal (ji,jj,ikt) 133 trc_data(ji,jj,11) = t n (ji,jj,ikt)134 trc_data(ji,jj,12) = sn (ji,jj,ikt)133 trc_data(ji,jj,11) = tsn (ji,jj,ikt,jp_tem) 134 trc_data(ji,jj,12) = tsn (ji,jj,ikt,jp_sal) 135 135 # else 136 136 trc_data(ji,jj,7 ) = sinksil (ji,jj,ikt) 137 137 trc_data(ji,jj,8 ) = sinking (ji,jj,ikt) 138 138 trc_data(ji,jj,9 ) = sinkcal (ji,jj,ikt) 139 trc_data(ji,jj,10) = t n (ji,jj,ikt)140 trc_data(ji,jj,11) = sn (ji,jj,ikt)139 trc_data(ji,jj,10) = tsn (ji,jj,ikt,jp_tem) 140 trc_data(ji,jj,11) = tsn (ji,jj,ikt,jp_sal) 141 141 # endif 142 142 ENDIF -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90
- Property svn:keywords set to Id
r1581 r2528 123 123 DO jj = 1, jpj 124 124 DO ji = 1, jpi 125 ikt = MAX( INT( sbathy(ji,jj) ) - 1, 1 )125 ikt = MAX( INT( sbathy(ji,jj) ), 1 ) 126 126 IF( tmask(ji,jj,ikt) == 1 ) epkbot(ji,jj) = zdta(ji,jj) 127 127 ENDDO … … 135 135 DO jj = 1, jpj 136 136 DO ji = 1, jpi 137 ikt = MAX( mbathy(ji,jj) - 1, 1 )137 ikt = mbkt(ji,jj) 138 138 IF( tmask(ji,jj,ikt) == 1 ) epkbot(ji,jj) = e3t_0(ikt) 139 139 ENDDO … … 443 443 444 444 dtsed = rdt 445 nitsed000 = nit000 446 nitsedend = nitend 445 447 #if ! defined key_sed_off 446 nitsed000 = nittrc000447 nitsedend = nitend448 448 nwrised = nwritetrc 449 449 #else 450 nitsed000 = nit000451 nitsedend = nitend452 450 nwrised = nwrite 453 451 #endif -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedmat.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedmbc.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedmodel.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedrst.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedsfc.F90
- Property svn:keywords set to Id
r1250 r2528 52 52 DO jj = 1,jpj 53 53 DO ji = 1, jpi 54 ikt = MAX( mbathy(ji,jj)-1, 1)54 ikt = mbkt(ji,jj) 55 55 IF ( tmask(ji,jj,ikt) == 1 ) THEN 56 56 trn(ji,jj,ikt,jptal) = trc_data(ji,jj,1) -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedstp.F90
- Property svn:keywords set to Id
-
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedwri.F90
- Property svn:keywords set to Id
r1334 r2528 186 186 CALL histbeg ( clhstnam, jpi, glamt, jpj, gphit, & 187 187 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 188 & nitsed000-1, zjulian, zdt, nhorised, nised , domain_id=nidom )188 & nitsed000-1, zjulian, zdt, nhorised, nised , domain_id=nidom, snc4chunks=snc4set ) 189 189 CALL histvert( nised,'deptht','Vertic.sed.T levels','m',ipk, profsed, ndepsed, 'down' ) 190 190 CALL wheneq ( jpi*jpj*ipk, tmasksed, 1, 1., ndext52, ndimt52 ) … … 223 223 224 224 225 CALL histend( nised )225 CALL histend( nised, snc4set ) 226 226 227 227 WRITE(numsed,*) -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90
- Property svn:executable deleted
r1606 r2528 1 1 MODULE trcbbl 2 2 !!====================================================================== 3 3 !! *** MODULE trcbbl *** 4 4 !! Ocean passive tracers physics : advective and/or diffusive bottom boundary 5 5 !! layer scheme 6 6 !!====================================================================== 7 !! History : 8.0 ! 96-06 (L. Mortier) Original code 8 !! 8.0 ! 97-11 (G. Madec) Optimization 9 !! 8.5 ! 02-08 (G. Madec) free form + modules 10 !! 9.0 ! 04-03 (C. Ethe) Adaptation for passive tracers 11 !! ! 07-02 (C. Deltel) Diagnose ML trends for passive tracers 7 !!============================================================================== 8 !! History : OPA ! 1996-06 (L. Mortier) Original code 9 !! 8.0 ! 1997-11 (G. Madec) Optimization 10 !! NEMO 1.0 ! 2002-08 (G. Madec) free form + modules 11 !! - ! 2004-01 (A. de Miranda, G. Madec, J.M. Molines ) add advective bbl 12 !! 3.3 ! 2009-11 (G. Madec) merge trabbl and trabbl_adv + style + optimization 13 !! - ! 2010-04 (G. Madec) Campin & Goosse advective bbl 14 !! - ! 2010-06 (C. Ethe, G. Madec) merge TRA-TRC 12 15 !!---------------------------------------------------------------------- 13 #if defined key_top && ( defined key_trcbbl_dif || defined key_trcbbl_adv ) && ! defined key_c1d16 #if defined key_top && defined key_trabbl 14 17 !!---------------------------------------------------------------------- 15 !! 'key_trcbbl_dif' or diffusive bottom boundary layer 16 !! 'key_trcbbl_adv' advective bottom boundary layer 18 !! 'key_trabbl diffusive or/and adevective bottom boundary layer 17 19 !!---------------------------------------------------------------------- 18 !! trc_bbl_dif : update the passive tracer trends due to the bottom 19 !! boundary layer (diffusive only) 20 !! trc_bbl_adv : update the passive tracer trends due to the bottom 21 !! boundary layer (advective and/or diffusive) 20 !! trc_bbl : update the tracer trends due to the bottom boundary layer (advective and/or diffusive) 22 21 !!---------------------------------------------------------------------- 23 22 USE oce_trc ! ocean dynamics and active tracers variables 24 23 USE trc ! ocean passive tracers variables 25 USE trctrp_lec ! passive tracers transport 24 USE trcnam_trp ! passive tracers transport namelist variables 25 USE trabbl ! 26 26 USE prtctl_trc ! Print control for debbuging 27 USE eosbn2 28 USE lbclnk 29 USE trdmld_trc 30 USE trdmld_trc_oce 27 USE trdmod_oce 28 USE trdtra 31 29 32 IMPLICIT NONE 33 PRIVATE 30 PUBLIC trc_bbl ! routine called by step.F90 34 31 35 PUBLIC trc_bbl_dif ! routine called by step.F9036 PUBLIC trc_bbl_adv ! routine called by step.F9037 38 # if defined key_trcbbl_dif39 LOGICAL, PUBLIC, PARAMETER :: lk_trcbbl_dif = .TRUE. !: diffusive bottom boundary layer flag40 # else41 LOGICAL, PUBLIC, PARAMETER :: lk_trcbbl_dif = .FALSE. !: diffusive bottom boundary layer flag42 # endif43 44 # if defined key_trcbbl_adv45 LOGICAL, PUBLIC, PARAMETER :: lk_trcbbl_adv = .TRUE. !: advective bottom boundary layer flag46 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: u_trc_bbl !: veloc. involved in the advective BBL47 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: v_trc_bbl !: veloc. involved in the advective BBL48 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: w_trc_bbl !: vertic. increment of veloc. due to adv. BBL49 ! ! only affect tracer vertical advection50 # else51 LOGICAL, PUBLIC, PARAMETER :: lk_trcbbl_adv = .FALSE. !: advective bottom boundary layer flag52 # endif53 54 INTEGER, DIMENSION(jpi,jpj) :: mbkt, mbku, mbkv55 32 56 33 !! * Substitutions 57 34 # include "top_substitute.h90" 58 35 !!---------------------------------------------------------------------- 59 !! TOP 1.0 , LOCEAN-IPSL (2005)60 !! $ Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/TRP/trcbbl.F90,v 1.12 2006/09/12 11:10:13 opalod Exp$61 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)36 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 37 !! $Id$ 38 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 62 39 !!---------------------------------------------------------------------- 63 40 64 41 CONTAINS 65 42 66 SUBROUTINE trc_bbl_dif( kt ) 43 44 SUBROUTINE trc_bbl( kt ) 67 45 !!---------------------------------------------------------------------- 68 !! *** ROUTINE trc_bbl_dif *** 46 !! *** ROUTINE bbl *** 47 !! 48 !! ** Purpose : Compute the before tracer (t & s) trend associated 49 !! with the bottom boundary layer and add it to the general trend 50 !! of tracer equations. 69 51 !! 70 !! ** Purpose : Compute the before tracer trend associated 71 !! with the bottom boundary layer and add it to the general trend 72 !! of tracer equations. The bottom boundary layer is supposed to be 73 !! a purely diffusive bottom boundary layer. 74 !! 75 !! ** Method : When the product grad( rho) * grad(h) < 0 (where grad 76 !! is an along bottom slope gradient) an additional lateral diffu- 77 !! sive trend along the bottom slope is added to the general tracer 78 !! trend, otherwise nothing is done. 79 !! Second order operator (laplacian type) with variable coefficient 80 !! computed as follow for temperature (idem on s): 81 !! difft = 1/(e1t*e2t*e3t) { di-1[ ahbt e2u*e3u/e1u di[ztb] ] 82 !! + dj-1[ ahbt e1v*e3v/e2v dj[ztb] ] } 83 !! where ztb is a 2D array: the bottom ocean temperature and ahtb 84 !! is a time and space varying diffusive coefficient defined by: 85 !! ahbt = zahbp if grad(rho).grad(h) < 0 86 !! = 0. otherwise. 87 !! Note that grad(.) is the along bottom slope gradient. grad(rho) 88 !! is evaluated using the local density (i.e. referenced at the 89 !! local depth). Typical value of ahbt is 2000 m2/s (equivalent to 90 !! a downslope velocity of 20 cm/s if the condition for slope 91 !! convection is satified) 92 !! Add this before trend to the general trend tra of the 93 !! botton ocean tracer point: 94 !! tra = tra + difft 95 !! 96 !! ** Action : - update tra at the bottom level with the bottom 97 !! boundary layer trend 98 !! 99 !! References : 100 !! Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 101 !!---------------------------------------------------------------------- 102 USE oce, ONLY : ztrtrd => ua ! use ua as 3D workspace 103 !! 104 INTEGER, INTENT( in ) :: kt ! ocean time-step 105 INTEGER :: ji, jj, jn ! dummy loop indices 106 INTEGER :: ik, iku, ikv 107 INTEGER :: ii0, ii1, ij0, ij1 ! temporary integers 108 INTEGER :: iku1, iku2, ikv1, ikv2 ! temporary intergers 109 REAL(wp) :: ze3u, ze3v ! temporary scalars 110 REAL(wp) :: zbtr, ztra 111 #if ! defined key_off_tra 112 REAL(wp) :: zgdrho, zalbet, zsign, zt, zs, zh 113 REAL(wp), DIMENSION(jpi,jpj) :: zki, zkj 114 #endif 115 REAL(wp), DIMENSION(jpi,jpj) :: zkx, zky ! temporary workspace arrays 116 REAL(wp), DIMENSION(jpi,jpj) :: ztnb, zsnb, zdep 117 REAL(wp), DIMENSION(jpi,jpj) :: ztrb, zahu, zahv 118 52 !!---------------------------------------------------------------------- 53 INTEGER, INTENT( in ) :: kt ! ocean time-step 119 54 CHARACTER (len=22) :: charout 120 REAL(wp) :: fsalbt, pft, pfs, pfh ! statement function 121 !!---------------------------------------------------------------------- 122 ! ratio alpha/beta 123 ! ================ 124 ! fsalbt: ratio of thermal over saline expension coefficients 125 ! pft : potential temperature in degrees celcius 126 ! pfs : salinity anomaly (s-35) in psu 127 ! pfh : depth in meters 128 129 fsalbt( pft, pfs, pfh ) = & 130 ( ( ( -0.255019e-07 * pft + 0.298357e-05 ) * pft & 131 - 0.203814e-03 ) * pft & 132 + 0.170907e-01 ) * pft & 133 + 0.665157e-01 & 134 +(-0.678662e-05 * pfs - 0.846960e-04 * pft + 0.378110e-02 ) * pfs & 135 + ( ( - 0.302285e-13 * pfh & 136 - 0.251520e-11 * pfs & 137 + 0.512857e-12 * pft * pft ) * pfh & 138 - 0.164759e-06 * pfs & 139 +( 0.791325e-08 * pft - 0.933746e-06 ) * pft & 140 + 0.380374e-04 ) * pfh 55 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: ztrtrd 141 56 !!---------------------------------------------------------------------- 142 57 143 144 IF( kt == nittrc000 ) CALL trc_bbl_init 145 146 147 ! 0. 2D fields of bottom temperature and salinity, and bottom slope 148 ! ----------------------------------------------------------------- 149 ! mbathy= number of w-level, minimum value=1 (cf dommsk.F) 150 151 # if defined key_vectopt_loop 152 jj = 1 153 DO ji = 1, jpij ! vector opt. (forced unrolling) 154 # else 155 DO jj = 1, jpj 156 DO ji = 1, jpi 157 # endif 158 ik = mbkt(ji,jj) ! index of the bottom ocean T-level 159 ztnb(ji,jj) = tn(ji,jj,ik) * tmask(ji,jj,1) ! masked now T and S at ocean bottom 160 zsnb(ji,jj) = sn(ji,jj,ik) * tmask(ji,jj,1) 161 zdep(ji,jj) = fsdept(ji,jj,ik) ! depth of the ocean bottom T-level 162 # if ! defined key_vectopt_loop 163 END DO 164 # endif 165 END DO 166 167 IF( ln_zps ) THEN ! partial steps correction 168 169 # if defined key_vectopt_loop 170 jj = 1 171 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 172 # else 173 DO jj = 1, jpjm1 174 DO ji = 1, jpim1 175 # endif 176 iku1 = MAX( mbathy(ji+1,jj )-1, 1 ) 177 iku2 = MAX( mbathy(ji ,jj )-1, 1 ) 178 ikv1 = MAX( mbathy(ji ,jj+1)-1, 1 ) 179 ikv2 = MAX( mbathy(ji ,jj )-1, 1 ) 180 ze3u = MIN( fse3u(ji,jj,iku1), fse3u(ji,jj,iku2) ) 181 ze3v = MIN( fse3v(ji,jj,ikv1), fse3v(ji,jj,ikv2) ) 182 zahu(ji,jj) = atrcbbl * e2u(ji,jj) * ze3u / e1u(ji,jj) * umask(ji,jj,1) 183 zahv(ji,jj) = atrcbbl * e1v(ji,jj) * ze3v / e2v(ji,jj) * vmask(ji,jj,1) 184 # if ! defined key_vectopt_loop 185 END DO 186 # endif 187 END DO 188 ELSE ! z-coordinate - full steps or s-coordinate 189 # if defined key_vectopt_loop 190 jj = 1 191 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 192 # else 193 DO jj = 1, jpjm1 194 DO ji = 1, jpim1 195 # endif 196 iku = mbku(ji,jj) 197 ikv = mbkv(ji,jj) 198 zahu(ji,jj) = atrcbbl * e2u(ji,jj) * fse3u(ji,jj,iku) / e1u(ji,jj) * umask(ji,jj,1) 199 zahv(ji,jj) = atrcbbl * e1v(ji,jj) * fse3v(ji,jj,ikv) / e2v(ji,jj) * vmask(ji,jj,1) 200 # if ! defined key_vectopt_loop 201 END DO 202 # endif 203 END DO 58 IF( .NOT. lk_offline ) THEN 59 CALL bbl( kt, 'TRC' ) ! Online coupling with dynamics : Computation of bbl coef and bbl transport 60 l_bbl = .FALSE. ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files 204 61 ENDIF 205 62 206 #if defined key_off_tra 207 !!===================================================================== 208 !! I. OFFLINE VERSION OF DIFFUSIVE BBL 209 !!===================================================================== 210 211 ! 1. Criteria of additional bottom diffusivity : grad(rho).grad(h) < 0 212 ! -------------------------------------------------------------------- 213 214 ! Only used in the online version of diffusive BBL (see below) 215 216 ! 2. Additional second order diffusive trends 217 ! ------------------------------------------- 218 ! ! =========== 219 DO jn = 1, jptra ! tracer loop 220 ! ! =========== 221 222 IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) 223 224 ! first derivative (gradient) 225 # if defined key_vectopt_loop 226 jj = 1 227 DO ji = 1, jpij ! vector opt. (forced unrolling) 228 # else 229 DO jj = 1, jpj 230 DO ji = 1, jpi 231 # endif 232 ik = mbkt(ji,jj) 233 ztrb(ji,jj) = trb(ji,jj,ik,jn) * tmask(ji,jj,1) 234 # if ! defined key_vectopt_loop 235 END DO 236 # endif 237 END DO 238 239 # if defined key_vectopt_loop 240 jj = 1 241 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 242 # else 243 DO jj = 1, jpjm1 244 DO ji = 1, jpim1 245 # endif 246 zkx(ji,jj) = bblx(ji,jj) * zahu(ji,jj) * ( ztrb(ji+1,jj) - ztrb(ji,jj) ) 247 zky(ji,jj) = bbly(ji,jj) * zahv(ji,jj) * ( ztrb(ji,jj+1) - ztrb(ji,jj) ) 248 # if ! defined key_vectopt_loop 249 END DO 250 # endif 251 END DO 252 253 #else 254 !!===================================================================== 255 !! II. ONLINE VERSION OF DIFFUSIVE BBL 256 !!===================================================================== 257 258 ! 1. Criteria of additional bottom diffusivity : grad(rho).grad(h) < 0 259 ! -------------------------------------------------------------------- 260 ! Sign of the local density gradient along the i- and j-slopes 261 ! multiplied by the slope of the ocean bottom 262 SELECT CASE ( nn_eos ) 263 264 CASE ( 0 ) ! Jackett and McDougall (1994) formulation 265 266 # if defined key_vectopt_loop 267 jj = 1 268 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 269 # else 270 DO jj = 1, jpjm1 271 DO ji = 1, jpim1 272 # endif 273 ! temperature, salinity anomalie and depth 274 zt = 0.5 * ( ztnb(ji,jj) + ztnb(ji+1,jj) ) 275 zs = 0.5 * ( zsnb(ji,jj) + zsnb(ji+1,jj) ) - 35.0 276 zh = 0.5 * ( zdep(ji,jj) + zdep(ji+1,jj) ) 277 ! masked ratio alpha/beta 278 zalbet = fsalbt( zt, zs, zh )*umask(ji,jj,1) 279 ! local density gradient along i-bathymetric slope 280 zgdrho = zalbet * ( ztnb(ji+1,jj) - ztnb(ji,jj) ) & 281 - ( zsnb(ji+1,jj) - zsnb(ji,jj) ) 282 ! sign of local i-gradient of density multiplied by the i-slope 283 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 284 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 285 # if ! defined key_vectopt_loop 286 END DO 287 # endif 288 END DO 289 290 # if defined key_vectopt_loop 291 jj = 1 292 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 293 # else 294 DO jj = 1, jpjm1 295 DO ji = 1, jpim1 296 # endif 297 ! temperature, salinity anomalie and depth 298 zt = 0.5 * ( ztnb(ji,jj+1) + ztnb(ji,jj) ) 299 zs = 0.5 * ( zsnb(ji,jj+1) + zsnb(ji,jj) ) - 35.0 300 zh = 0.5 * ( zdep(ji,jj+1) + zdep(ji,jj) ) 301 ! masked ratio alpha/beta 302 zalbet = fsalbt( zt, zs, zh )*vmask(ji,jj,1) 303 ! local density gradient along j-bathymetric slope 304 zgdrho = zalbet * ( ztnb(ji,jj+1) - ztnb(ji,jj) ) & 305 - ( zsnb(ji,jj+1) - zsnb(ji,jj) ) 306 ! sign of local j-gradient of density multiplied by the j-slope 307 zsign = SIGN( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 308 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 309 # if ! defined key_vectopt_loop 310 END DO 311 # endif 312 END DO 313 314 CASE ( 1 ) ! Linear formulation function of temperature only 315 316 # if defined key_vectopt_loop 317 jj = 1 318 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 319 # else 320 DO jj = 1, jpjm1 321 DO ji = 1, jpim1 322 # endif 323 ! local density gradient along i-bathymetric slope 324 zgdrho = ( ztnb(ji+1,jj) - ztnb(ji,jj) ) 325 ! sign of local i-gradient of density multiplied by the i-slope 326 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 327 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 328 # if ! defined key_vectopt_loop 329 END DO 330 # endif 331 END DO 332 333 # if defined key_vectopt_loop 334 jj = 1 335 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 336 # else 337 DO jj = 1, jpjm1 338 DO ji = 1, jpim1 339 # endif 340 ! local density gradient along j-bathymetric slope 341 zgdrho = ( ztnb(ji,jj+1) - ztnb(ji,jj) ) 342 ! sign of local j-gradient of density multiplied by the j-slope 343 zsign = SIGN( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 344 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 345 346 # if ! defined key_vectopt_loop 347 END DO 348 # endif 349 END DO 350 351 CASE ( 2 ) ! Linear formulation function of temperature and salinity 352 353 DO jj = 1, jpjm1 354 DO ji = 1, fs_jpim1 ! vector opt. 355 ! local density gradient along i-bathymetric slope 356 zgdrho = - ( rn_beta*( zsnb(ji+1,jj) - zsnb(ji,jj) ) & 357 - rn_alpha*( ztnb(ji+1,jj) - ztnb(ji,jj) ) ) 358 ! sign of local i-gradient of density multiplied by the i-slope 359 zsign = SIGN( 0.5, - zgdrho * ( zdep(ji+1,jj) - zdep(ji,jj) ) ) 360 zki(ji,jj) = ( 0.5 - zsign ) * zahu(ji,jj) 361 END DO 362 END DO 363 364 DO jj = 1, jpjm1 365 DO ji = 1, fs_jpim1 ! vector opt. 366 ! local density gradient along j-bathymetric slope 367 zgdrho = - ( rn_beta*( zsnb(ji,jj+1) - zsnb(ji,jj) ) & 368 - rn_alpha*( ztnb(ji,jj+1) - ztnb(ji,jj) ) ) 369 ! sign of local j-gradient of density multiplied by the j-slope 370 zsign = sign( 0.5, -zgdrho * ( zdep(ji,jj+1) - zdep(ji,jj) ) ) 371 zkj(ji,jj) = ( 0.5 - zsign ) * zahv(ji,jj) 372 END DO 373 END DO 374 375 CASE DEFAULT 376 377 WRITE(ctmp1,*) ' bad flag value for nn_eos = ', nn_eos 378 CALL ctl_stop( ctmp1 ) 379 380 END SELECT 381 382 ! 2. Additional second order diffusive trends 383 ! ------------------------------------------- 384 ! ! =========== 385 DO jn = 1, jptra ! tracer loop 386 ! ! =========== 387 IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) 388 389 ! first derivative (gradient) 390 # if defined key_vectopt_loop 391 jj = 1 392 DO ji = 1, jpij ! vector opt. (forced unrolling) 393 # else 394 DO jj = 1, jpj 395 DO ji = 1, jpi 396 # endif 397 ik = mbkt(ji,jj) 398 ztrb(ji,jj) = trb(ji,jj,ik,jn) * tmask(ji,jj,1) 399 # if ! defined key_vectopt_loop 400 END DO 401 # endif 402 END DO 403 # if defined key_vectopt_loop 404 jj = 1 405 DO ji = 1, jpij-jpi ! vector opt. (forced unrolling) 406 # else 407 DO jj = 1, jpjm1 408 DO ji = 1, jpim1 409 # endif 410 zkx(ji,jj) = zki(ji,jj) * ( ztrb(ji+1,jj) - ztrb(ji,jj) ) 411 zky(ji,jj) = zkj(ji,jj) * ( ztrb(ji,jj+1) - ztrb(ji,jj) ) 412 # if ! defined key_vectopt_loop 413 END DO 414 # endif 415 END DO 416 #endif 417 418 !!===================================================================== 419 !! III. COMMON CODE FOR OFFLINE/ONLINE VERSIONS OF DIFFUSIVE BBL 420 !!===================================================================== 421 422 IF( cp_cfg == "orca" ) THEN 423 424 SELECT CASE ( jp_cfg ) 425 ! ! ======================= 426 CASE ( 2 ) ! ORCA_R2 configuration 427 ! ! ======================= 428 ! Gibraltar enhancement of BBL 429 ij0 = 102 ; ij1 = 102 430 ii0 = 139 ; ii1 = 140 431 zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0 * zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 432 zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0 * zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 433 434 ! Red Sea enhancement of BBL 435 ij0 = 88 ; ij1 = 88 436 ii0 = 161 ; ii1 = 162 437 zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 10.e0 * zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 438 zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 10.e0 * zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 439 440 ! ! ======================= 441 CASE ( 4 ) ! ORCA_R4 configuration 442 ! ! ======================= 443 ! Gibraltar enhancement of BBL 444 ij0 = 52 ; ij1 = 52 445 ii0 = 70 ; ii1 = 71 446 zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0 * zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 447 zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0 * zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 448 449 END SELECT 450 451 ENDIF 452 453 ! second derivative (divergence) and add to the general tracer trend 454 # if defined key_vectopt_loop 455 jj = 1 456 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 457 # else 458 DO jj = 2, jpjm1 459 DO ji = 2, jpim1 460 # endif 461 ik = MAX( mbathy(ji,jj)-1, 1 ) 462 zbtr = 1. / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,ik) ) 463 ztra = ( zkx(ji,jj) - zkx(ji-1,jj ) & 464 & + zky(ji,jj) - zky(ji ,jj-1) ) * zbtr 465 tra(ji,jj,ik,jn) = tra(ji,jj,ik,jn) + ztra 466 # if ! defined key_vectopt_loop 467 END DO 468 # endif 469 END DO 470 471 ! save the trends for diagnostic 472 IF( l_trdtrc ) THEN 473 ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 474 IF (luttrd(jn)) CALL trd_mod_trc( ztrtrd, jn, jptrc_trd_bbl, kt ) 475 END IF 476 ! ! =========== 477 END DO ! tracer loop 478 ! ! =========== 479 480 IF( ln_ctl ) THEN ! print mean trends (used for debugging) 481 WRITE(charout, FMT="('bbl - dif')") 482 CALL prt_ctl_trc_info(charout) 483 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 63 IF( l_trdtrc ) THEN 64 ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends 65 ztrtrd(:,:,:,:) = tra(:,:,:,:) 484 66 ENDIF 485 67 486 END SUBROUTINE trc_bbl_dif 68 !* Diffusive bbl : 69 IF( nn_bbl_ldf == 1 ) THEN 70 ! 71 CALL tra_bbl_dif( trb, tra, jptra ) 72 IF( ln_ctl ) THEN 73 WRITE(charout, FMT="(' bbl_dif')") ; CALL prt_ctl_trc_info(charout) 74 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 75 ENDIF 76 ! 77 END IF 487 78 488 # if defined key_trcbbl_adv 489 !!---------------------------------------------------------------------- 490 !! 'key_trcbbl_adv' advective bottom boundary layer 491 !!---------------------------------------------------------------------- 492 # include "trcbbl_adv.h90" 493 # else 494 !!---------------------------------------------------------------------- 495 !! Default option : NO advective bottom boundary layer 496 !!---------------------------------------------------------------------- 497 SUBROUTINE trc_bbl_adv (kt ) ! Empty routine 498 INTEGER, INTENT(in) :: kt 499 WRITE(*,*) 'trc_bbl_adv: You should not have seen this print! error?', kt 500 END SUBROUTINE trc_bbl_adv 501 # endif 79 !* Advective bbl : bbl upstream advective trends added to the tracer trends 80 IF( nn_bbl_adv /= 0 ) THEN 81 ! 82 CALL tra_bbl_adv( trb, tra, jptra ) 83 IF( ln_ctl ) THEN 84 WRITE(charout, FMT="(' bbl_adv')") ; CALL prt_ctl_trc_info(charout) 85 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 86 ENDIF 87 ! 88 END IF 502 89 503 SUBROUTINE trc_bbl_init 504 !!---------------------------------------------------------------------- 505 !! *** ROUTINE trc_bbl_init *** 506 !! 507 !! ** Purpose : Initialization for the bottom boundary layer scheme. 508 !!---------------------------------------------------------------------- 509 INTEGER :: ji, jj 510 REAL(wp), DIMENSION(jpi,jpj) :: zmbk 511 !!---------------------------------------------------------------------- 512 513 DO jj = 1, jpj 514 DO ji = 1, jpi 515 mbkt(ji,jj) = MAX( mbathy(ji,jj) - 1, 1 ) ! vertical index of the bottom ocean T-level 516 END DO 517 END DO 518 519 DO jj = 1, jpjm1 520 DO ji = 1, jpim1 521 mbku(ji,jj) = MAX( MIN( mbathy(ji+1,jj ), mbathy(ji,jj) ) - 1, 1 ) 522 mbkv(ji,jj) = MAX( MIN( mbathy(ji ,jj+1), mbathy(ji,jj) ) - 1, 1 ) 523 END DO 524 END DO 525 526 zmbk(:,:) = FLOAT( mbku (:,:) ) 527 CALL lbc_lnk(zmbk,'U',1.) 528 mbku (:,:) = MAX( INT( zmbk(:,:) ), 1 ) 529 530 zmbk(:,:) = FLOAT( mbkv (:,:) ) 531 CALL lbc_lnk(zmbk,'V',1.) 532 mbkv (:,:) = MAX( INT( zmbk(:,:) ), 1 ) 533 534 # if defined key_trcbbl_adv 535 w_trc_bbl(:,:,:) = 0.e0 ! initialisation of w_trc_bbl to zero 536 # endif 537 538 END SUBROUTINE trc_bbl_init 90 IF( l_trdtrc ) THEN ! save the horizontal diffusive trends for further diagnostics 91 DO jn = 1, jptra 92 ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn) 93 CALL trd_tra( kt, 'TRC', jn, jptra_trd_ldf, ztrtrd(:,:,:,jn) ) 94 END DO 95 DEALLOCATE( ztrtrd ) 96 ENDIF 97 ! 98 END SUBROUTINE trc_bbl 539 99 540 100 #else … … 542 102 !! Dummy module : No bottom boundary layer scheme 543 103 !!---------------------------------------------------------------------- 544 LOGICAL, PUBLIC, PARAMETER :: lk_trcbbl_dif = .FALSE. !: diff bbl flag545 LOGICAL, PUBLIC, PARAMETER :: lk_trcbbl_adv = .FALSE. !: adv bbl flag546 104 CONTAINS 547 SUBROUTINE trc_bbl_dif (kt ) ! Empty routine 548 INTEGER, INTENT(in) :: kt 549 WRITE(*,*) 'trc_bbl_dif: You should not have seen this print! error?', kt 550 END SUBROUTINE trc_bbl_dif 551 SUBROUTINE trc_bbl_adv (kt ) ! Empty routine 552 INTEGER, INTENT(in) :: kt 553 WRITE(*,*) 'trc_bbl_adv: You should not have seen this print! error?', kt 554 END SUBROUTINE trc_bbl_adv 105 SUBROUTINE trc_bbl( kt ) ! Empty routine 106 WRITE(*,*) 'tra_bbl: You should not have seen this print! error?', kt 107 END SUBROUTINE trc_bbl 555 108 #endif 556 109 -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
- Property svn:executable deleted
r1175 r2528 4 4 !! Ocean physics: internal restoring trend on passive tracers 5 5 !!====================================================================== 6 !! History : 7.0 ! (G. Madec) Original code7 !! ! 96-01 (G. Madec)8 !! ! 97-05 (H. Loukos) adapted for passive tracers9 !! 8.5 ! 02-08 (G. Madec )free form + modules10 !! 9.0 ! 04-03 (C. Ethe) free form + modules11 !! ! 07-02 (C. Deltel) Diagnose ML trends for passive tracers6 !! History : OPA ! 1991-03 (O. Marti, G. Madec) Original code 7 !! ! 1996-01 (G. Madec) statement function for e3 8 !! ! 1997-05 (H. Loukos) adapted for passive tracers 9 !! NEMO 9.0 ! 2004-03 (C. Ethe) free form + modules 10 !! 3.2 ! 2007-02 (C. Deltel) Diagnose ML trends for passive tracers 11 !! 3.3 ! 2010-06 (C. Ethe, G. Madec) merge TRA-TRC 12 12 !!---------------------------------------------------------------------- 13 13 #if defined key_top && defined key_trcdmp … … 17 17 !! trc_dmp : update the tracer trend with the internal damping 18 18 !! trc_dmp_init : initialization, namlist read, parameters control 19 !! trccof_zoom : restoring coefficient for zoom domain20 !! trccof : restoring coefficient for global domain21 !! cofdis : compute the distance to the coastline22 19 !!---------------------------------------------------------------------- 23 20 USE oce_trc ! ocean dynamics and tracers variables 24 21 USE trc ! ocean passive tracers variables 25 USE trc trp_lec ! passive tracers transport22 USE trcnam_trp ! passive tracers transport namelist variables 26 23 USE trcdta 24 USE tradmp 27 25 USE prtctl_trc ! Print control for debbuging 28 USE trdmld_trc 29 USE trdmld_trc_oce 26 USE trdtra 30 27 31 28 IMPLICIT NONE … … 35 32 36 33 LOGICAL , PUBLIC, PARAMETER :: lk_trcdmp = .TRUE. !: internal damping flag 37 REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: restotr ! restoring coeff. on tracers (s-1) 34 ! !!* Namelist namtrc_dmp : passive tracer newtonian damping * 35 INTEGER :: nn_hdmp_tr = -1 ! = 0/-1/'latitude' for damping over passive tracer 36 INTEGER :: nn_zdmp_tr = 0 ! = 0/1/2 flag for damping in the mixed layer 37 REAL(wp) :: rn_surf_tr = 50. ! surface time scale for internal damping [days] 38 REAL(wp) :: rn_bot_tr = 360. ! bottom time scale for internal damping [days] 39 REAL(wp) :: rn_dep_tr = 800. ! depth of transition between rn_surf and rn_bot [meters] 40 INTEGER :: nn_file_tr = 2 ! = 1 create a damping.coeff NetCDF file 41 42 REAL(wp), DIMENSION(jpi,jpj,jpk) :: restotr ! restoring coeff. on tracers (s-1) 38 43 39 44 !! * Substitutions 40 45 # include "top_substitute.h90" 41 46 !!---------------------------------------------------------------------- 42 !! TOP 1.0 , LOCEAN-IPSL (2005)47 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 43 48 !! $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/TRP/trcdmp.F90,v 1.11 2006/09/01 14:03:49 opalod Exp $ 44 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)49 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 45 50 !!---------------------------------------------------------------------- 46 51 … … 66 71 !! - save the trends ('key_trdmld_trc') 67 72 !!---------------------------------------------------------------------- 68 USE oce, ONLY : ztrtrd => ua ! use ua as 3D workspace69 73 !! 70 74 INTEGER, INTENT( in ) :: kt ! ocean time-step index 75 !! 71 76 INTEGER :: ji, jj, jk, jn ! dummy loop indices 72 REAL(wp) :: zt est, ztra !!!, zdt! temporary scalars77 REAL(wp) :: ztra ! temporary scalars 73 78 CHARACTER (len=22) :: charout 79 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrtrd 74 80 !!---------------------------------------------------------------------- 75 81 76 82 ! 0. Initialization (first time-step only) 77 83 ! -------------- 78 IF( kt == nittrc000 ) CALL trc_dmp_init 79 84 IF( kt == nit000 ) CALL trc_dmp_init 85 86 IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) ! temporary save of trends 80 87 81 88 ! 1. Newtonian damping trends on tracer fields 82 89 ! -------------------------------------------- 83 ! compute the newtonian damping trends depending on nmldmptr84 85 !!! zdt = rdt * FLOAT( ndttrc )86 87 90 ! Initialize the input fields for newtonian damping 88 CALL dta_trc( kt ) 89 91 CALL trc_dta( kt ) 90 92 ! ! =========== 91 93 DO jn = 1, jptra ! tracer loop … … 94 96 95 97 IF( lutini(jn) ) THEN 96 97 SELECT CASE ( nmldmptr ) 98 99 CASE( 0 ) ! newtonian damping throughout the water column 100 98 ! 99 SELECT CASE ( nn_zdmp_trc ) 100 ! 101 CASE( 0 ) !== newtonian damping throughout the water column ==! 101 102 DO jk = 1, jpkm1 102 103 DO jj = 2, jpjm1 103 104 DO ji = fs_2, fs_jpim1 ! vector opt. 104 ztra = restotr(ji,jj,jk,jn) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) 105 ! add the trends to the general tracer trends 106 !! trn(ji,jj,jk,jn) = trn(ji,jj,jk,jn) + ztra * zdt 105 ztra = restotr(ji,jj,jk) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) 107 106 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 108 107 END DO 109 108 END DO 110 109 END DO 111 112 CASE ( 1 ) ! no damping in the turbocline (avt > 5 cm2/s)110 ! 111 CASE ( 1 ) !== no damping in the turbocline (avt > 5 cm2/s) ==! 113 112 DO jk = 1, jpkm1 114 113 DO jj = 2, jpjm1 115 114 DO ji = fs_2, fs_jpim1 ! vector opt. 116 ztest = avt(ji,jj,jk) - 5.e-4 117 IF( ztest < 0. ) THEN 118 ztra = restotr(ji,jj,jk,jn) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) 119 ELSE 120 ztra = 0.e0 115 IF( avt(ji,jj,jk) <= 5.e-4 ) THEN 116 ztra = restotr(ji,jj,jk) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) 117 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 121 118 ENDIF 122 ! add the trends to the general tracer trends123 !! trn(ji,jj,jk,jn) = trn(ji,jj,jk,jn) + ztra * zdt124 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra125 # if defined key_trc_diatrd126 ! save the trends for diagnostics127 IF (luttrd(jn)) trtrd(ji,jj,jk,ikeep(jn),jpdiatrc) = ztra128 # endif129 130 119 END DO 131 120 END DO 132 121 END DO 133 134 CASE ( 2 ) ! no damping in the mixed layer122 ! 123 CASE ( 2 ) !== no damping in the mixed layer ==! 135 124 DO jk = 1, jpkm1 136 125 DO jj = 2, jpjm1 … … 138 127 IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN 139 128 ztra = restotr(ji,jj,jk,jn) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) 140 ELSE 141 ztra = 0.e0 142 ENDIF 143 ! add the trends to the general tracer trends 144 !! trn(ji,jj,jk,jn) = trn(ji,jj,jk,jn) + ztra * zdt 145 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 146 # if defined key_trc_diatrd 147 ! save the trends for diagnostics 148 IF (luttrd(jn)) trtrd(ji,jj,jk,ikeep(jn),jpdiatrc) = ztra 149 # endif 150 129 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 130 END IF 151 131 END DO 152 132 END DO 153 133 END DO 154 134 ! 155 135 END SELECT 156 136 ! 157 137 ENDIF 158 138 ! 159 139 IF( l_trdtrc ) THEN 160 140 ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 161 IF (luttrd(jn)) CALL trd_mod_trc( ztrtrd, jn, jptrc_trd_dmp, kt ) ! trends diags.141 CALL trd_tra( kt, 'TRC', jn, jptra_trd_dmp, ztrtrd ) 162 142 END IF 163 143 ! ! =========== 164 144 END DO ! tracer loop 165 145 ! ! =========== 166 167 IF( ln_ctl ) THEN! print mean trends (used for debugging)168 WRITE(charout, FMT="('dmp')")169 CALL prt_ctl_trc_info( charout)170 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd' )146 IF( l_trdtrc ) DEALLOCATE( ztrtrd ) 147 ! ! print mean trends (used for debugging) 148 IF( ln_ctl ) THEN 149 WRITE(charout, FMT="('dmp ')") ; CALL prt_ctl_trc_info(charout) 150 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 171 151 ENDIF 172 173 trb(:,:,:,:) = trn(:,:,:,:) 174 152 ! 175 153 END SUBROUTINE trc_dmp 176 154 … … 186 164 !!---------------------------------------------------------------------- 187 165 188 SELECT CASE ( ndmptr ) 189 190 CASE ( -1 ) ! ORCA: damping in Red & Med Seas only 191 IF(lwp) WRITE(numout,*) ' tracer damping in the Med & Red seas only' 192 193 CASE ( 1:90 ) ! Damping poleward of 'ndmptr' degrees 194 IF(lwp) WRITE(numout,*) ' tracer damping poleward of', ndmptr, ' degrees' 195 166 SELECT CASE ( nn_hdmp_tr ) 167 CASE ( -1 ) ; IF(lwp) WRITE(numout,*) ' tracer damping in the Med & Red seas only' 168 CASE ( 1:90 ) ; IF(lwp) WRITE(numout,*) ' tracer damping poleward of', nn_hdmp_tr, ' degrees' 196 169 CASE DEFAULT 197 WRITE(ctmp1,*) ' bad flag value for n dmptr = ', ndmptr170 WRITE(ctmp1,*) ' bad flag value for nn_hdmp_tr = ', nn_hdmp_tr 198 171 CALL ctl_stop(ctmp1) 199 200 172 END SELECT 201 173 202 203 SELECT CASE ( nmldmptr ) 204 205 CASE ( 0 ) ! newtonian damping throughout the water column 206 IF(lwp) WRITE(numout,*) ' tracer damping throughout the water column' 207 208 CASE ( 1 ) ! no damping in the turbocline (avt > 5 cm2/s) 209 IF(lwp) WRITE(numout,*) ' no tracer damping in the turbocline' 210 211 CASE ( 2 ) ! no damping in the mixed layer 212 IF(lwp) WRITE(numout,*) ' no tracer damping in the mixed layer' 213 174 SELECT CASE ( nn_zdmp_tr ) 175 CASE ( 0 ) ; IF(lwp) WRITE(numout,*) ' tracer damping throughout the water column' 176 CASE ( 1 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the turbocline (avt > 5 cm2/s)' 177 CASE ( 2 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the mixed layer' 214 178 CASE DEFAULT 215 WRITE(ctmp1,*) ' bad flag value for nmldmptr = ', nmldmptr179 WRITE(ctmp1,*) 'bad flag value for nn_zdmp_tr = ', nn_zdmp_tr 216 180 CALL ctl_stop(ctmp1) 217 218 181 END SELECT 219 182 220 ! Damping coefficients initialization 221 ! ----------------------------------- 222 IF( lzoom ) THEN 223 CALL trccof_zoom 224 ELSE 225 CALL trccof 183 IF( .NOT. lk_dtatrc ) & 184 & CALL ctl_stop( 'no passive tracer data define key_dtatrc' ) 185 186 IF( .NOT. lk_tradmp ) & 187 & CALL ctl_stop( 'passive trace damping need key_tradmp to compute damping coef.' ) 188 ! 189 ! ! Damping coefficients initialization 190 IF( lzoom ) THEN ; CALL dtacof_zoom( restotr ) 191 ELSE ; CALL dtacof( nn_hdmp_tr, rn_surf_tr, rn_bot_tr, rn_dep_tr, & 192 & nn_file_tr, 'TRC' , restotr ) 226 193 ENDIF 227 194 ! 228 195 END SUBROUTINE trc_dmp_init 229 230 231 SUBROUTINE trccof_zoom232 !!----------------------------------------------------------------------233 !! *** ROUTINE trccof_zoom ***234 !!235 !! ** Purpose : Compute the damping coefficient for zoom domain236 !!237 !! ** Method : - set along closed boundary due to zoom a damping over238 !! 6 points with a max time scale of 5 days.239 !! - ORCA arctic/antarctic zoom: set the damping along240 !! south/north boundary over a latitude strip.241 !!242 !! ** Action : - restotr, the damping coeff. passive tracers243 !!244 !! History :245 !! 9.0 ! 03-09 (G. Madec) Original code246 !! 9.0 ! 04-03 (C. Ethe) adapted for passive tracers247 !!----------------------------------------------------------------------248 !! * Local declarations249 INTEGER :: ji, jj, jk, jn ! dummy loop indices250 REAL(wp) :: &251 zlat, zlat0, zlat1, zlat2 ! temporary scalar252 REAL(wp), DIMENSION(6) :: &253 zfact ! temporary workspace254 !!----------------------------------------------------------------------255 256 zfact(1) = 1.257 zfact(2) = 1.258 zfact(3) = 11./12.259 zfact(4) = 8./12.260 zfact(5) = 4./12.261 zfact(6) = 1./12.262 zfact(:) = zfact(:) / ( 5. * rday ) ! 5 days max restoring time scale263 264 restotr(:,:,:,:) = 0.e0265 266 ! damping along the forced closed boundary over 6 grid-points267 DO jn = 1, 6268 IF( lzoom_w ) restotr( mi0(jn+jpizoom):mi1(jn+jpizoom), : , : , : ) = zfact(jn) ! west closed269 IF( lzoom_s ) restotr( : , mj0(jn+jpjzoom):mj1(jn+jpjzoom), : , : ) = zfact(jn) ! south closed270 IF( lzoom_e ) restotr( mi0(jpiglo+jpizoom-1-jn):mi1(jpiglo+jpizoom-1-jn) , : , : , : ) &271 & = zfact(jn) ! east closed272 IF( lzoom_n ) restotr( : , mj0(jpjglo+jpjzoom-1-jn):mj1(jpjglo+jpjzoom-1-jn) , : , : ) &273 & = zfact(jn) ! north closed274 END DO275 276 277 IF( lzoom_arct .AND. lzoom_anta ) THEN278 279 ! ====================================================280 ! ORCA configuration : arctic zoom or antarctic zoom281 ! ====================================================282 283 IF(lwp) WRITE(numout,*)284 IF(lwp .AND. lzoom_arct ) WRITE(numout,*) ' trccof_zoom : ORCA Arctic zoom'285 IF(lwp .AND. lzoom_arct ) WRITE(numout,*) ' trccof_zoom : ORCA Antarctic zoom'286 IF(lwp) WRITE(numout,*)287 288 ! ... Initialization :289 ! zlat0 : latitude strip where resto decreases290 ! zlat1 : resto = 1 before zlat1291 ! zlat2 : resto decreases from 1 to 0 between zlat1 and zlat2292 restotr(:,:,:,:) = 0.e0293 zlat0 = 10.294 zlat1 = 30.295 zlat2 = zlat1 + zlat0296 297 ! ... Compute arrays resto ; value for internal damping : 5 days298 DO jn = 1, jptra299 DO jk = 2, jpkm1300 DO jj = 1, jpj301 DO ji = 1, jpi302 zlat = ABS( gphit(ji,jj) )303 IF ( zlat1 <= zlat .AND. zlat <= zlat2 ) THEN304 restotr(ji,jj,jk,jn) = 0.5 * ( 1./(5.*rday) ) * &305 ( 1. - COS(rpi*(zlat2-zlat)/zlat0) )306 ELSE IF ( zlat < zlat1 ) THEN307 restotr(ji,jj,jk,jn) = 1./(5.*rday)308 ENDIF309 END DO310 END DO311 END DO312 END DO313 314 ENDIF315 316 ! ... Mask resto array317 DO jn = 1, jptra318 restotr(:,:,:,jn) = restotr(:,:,:,jn) * tmask(:,:,:)319 END DO320 321 322 END SUBROUTINE trccof_zoom323 324 SUBROUTINE trccof325 !!----------------------------------------------------------------------326 !! *** ROUTINE trccof ***327 !!328 !! ** Purpose : Compute the damping coefficient329 !!330 !! ** Method : Arrays defining the damping are computed for each grid331 !! point passive tracers (restotr)332 !! Damping depends on distance to coast, depth and latitude333 !!334 !! ** Action : - restotr, the damping coeff. for passive tracers335 !!336 !! History :337 !! 5.0 ! 91-03 (O. Marti, G. Madec) Original code338 !! ! 92-06 (M. Imbard) doctor norme339 !! ! 96-01 (G. Madec) statement function for e3340 !! ! 98-07 (M. Imbard, G. Madec) ORCA version341 !! ! 00-08 (G. Madec, D. Ludicone)342 !! 8.2 ! 04-03 (H. Loukos) adapted for passive tracers343 !! ! 04-02 (O. Aumont, C. Ethe) rewritten for debuging and update344 !!----------------------------------------------------------------------345 !! * Modules used346 USE iom347 USE ioipsl348 349 !! * Local declarations350 INTEGER :: ji, jj, jk, jn ! dummy loop indices351 INTEGER :: itime352 INTEGER :: ii0, ii1, ij0, ij1 ! " "353 INTEGER :: &354 idmp, & ! logical unit for file restoring damping term355 icot ! logical unit for file distance to the coast356 357 CHARACTER (len=32) :: clname3358 REAL(wp) :: &359 zdate0, zinfl, zlon, & ! temporary scalars360 zlat, zlat0, zlat1, zlat2, & ! " "361 zsdmp, zbdmp ! " "362 REAL(wp), DIMENSION(jpk) :: &363 gdept, zhfac364 REAL(wp), DIMENSION(jpi,jpj) :: &365 zmrs366 REAL(wp), DIMENSION(jpi,jpj,jpk) :: &367 zdct368 !!----------------------------------------------------------------------369 370 ! ====================================371 ! ORCA configuration : global domain372 ! ====================================373 374 IF(lwp) WRITE(numout,*)375 IF(lwp) WRITE(numout,*) ' trccof : Global domain of ORCA'376 IF(lwp) WRITE(numout,*) ' ------------------------------'377 378 379 ! ... Initialization :380 ! zdct() : distant to the coastline381 ! resto() : array of restoring coeff.382 383 zdct (:,:,:) = 0.e0384 restotr(:,:,:,:) = 0.e0385 386 387 IF ( ndmptr > 0 ) THEN388 389 ! ------------------------------------390 ! Damping poleward of 'ndmptr' degrees391 ! ------------------------------------392 393 IF(lwp) WRITE(numout,*)394 IF(lwp) WRITE(numout,*) ' Damping poleward of ', ndmptr,' deg.'395 IF(lwp) WRITE(numout,*)396 397 ! ... Distance to coast (zdct)398 399 IF(lwp) WRITE(numout,*)400 IF(lwp) WRITE(numout,*) ' dtacof : distance to coast file'401 CALL iom_open ( 'dist.coast.trc.nc', icot )402 IF( icot > 0 ) THEN403 CALL iom_get ( icot, jpdom_data, 'Tcoast', zdct )404 CALL iom_close (icot)405 ELSE406 ! ... Compute and save the distance-to-coast array (output in zdct)407 CALL cofdis( zdct )408 ENDIF409 410 411 ! ... Compute arrays resto412 ! zinfl : distance of influence for damping term413 ! zlat0 : latitude strip where resto decreases414 ! zlat1 : resto = 0 between -zlat1 and zlat1415 ! zlat2 : resto increases from 0 to 1 between |zlat1| and |zlat2|416 ! and resto = 1 between |zlat2| and 90 deg.417 zinfl = 1000.e3418 zlat0 = 10419 zlat1 = ndmptr420 zlat2 = zlat1 + zlat0421 422 DO jn = 1, jptra423 DO jj = 1, jpj424 DO ji = 1, jpi425 zlat = ABS( gphit(ji,jj) )426 IF ( zlat1 <= zlat .AND. zlat <= zlat2 ) THEN427 restotr(ji,jj,1,jn) = 0.5 * ( 1. - COS(rpi*(zlat-zlat1)/zlat0 ) )428 ELSEIF ( zlat > zlat2 ) THEN429 restotr(ji,jj,1,jn) = 1.430 ENDIF431 END DO432 END DO433 END DO434 435 ! ... North Indian ocean (20N/30N x 45E/100E) : resto=0436 IF ( ndmptr == 20 ) THEN437 DO jn = 1, jptra438 DO jj = 1, jpj439 DO ji = 1, jpi440 zlat = gphit(ji,jj)441 zlon = MOD( glamt(ji,jj), 360. )442 IF ( zlat1 < zlat .AND. zlat < zlat2 .AND. &443 45. < zlon .AND. zlon < 100. ) THEN444 restotr(ji,jj,1,jn) = 0.445 ENDIF446 END DO447 END DO448 END DO449 ENDIF450 451 zsdmp = 1./(sdmptr * rday)452 zbdmp = 1./(bdmptr * rday)453 DO jn = 1, jptra454 DO jk = 2, jpkm1455 DO jj = 1, jpj456 DO ji = 1, jpi457 zdct(ji,jj,jk) = MIN( zinfl, zdct(ji,jj,jk) )458 459 ! ... Decrease the value in the vicinity of the coast460 restotr(ji,jj,jk,jn) = restotr(ji,jj,1,jn)*0.5 &461 & * ( 1. - COS( rpi*zdct(ji,jj,jk)/zinfl) )462 463 ! ... Vertical variation from zsdmp (sea surface) to zbdmp (bottom)464 restotr(ji,jj,jk,jn) = restotr(ji,jj,jk,jn) &465 & * ( zbdmp + (zsdmp-zbdmp)*EXP(-fsdept(ji,jj,jk)/hdmptr) )466 END DO467 END DO468 END DO469 END DO470 471 ENDIF472 473 474 IF( cp_cfg == "orca" .AND. ( ndmptr > 0 .OR. ndmptr == -1 ) ) THEN475 476 ! ! =========================477 ! ! Med and Red Sea damping478 ! ! =========================479 IF(lwp)WRITE(numout,*)480 IF(lwp)WRITE(numout,*) ' ORCA configuration: Damping in Med and Red Seas'481 482 483 zmrs(:,:) = 0.e0 ! damping term on the Med or Red Sea484 485 SELECT CASE ( jp_cfg )486 ! ! =======================487 CASE ( 4 ) ! ORCA_R4 configuration488 ! ! =======================489 490 ! Mediterranean Sea491 ij0 = 50 ; ij1 = 56492 ii0 = 81 ; ii1 = 91 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0493 ij0 = 50 ; ij1 = 55494 ii0 = 75 ; ii1 = 80 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0495 ij0 = 52 ; ij1 = 53496 ii0 = 70 ; ii1 = 74 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0497 ! Smooth transition from 0 at surface to 1./rday at the 18th level in Med and Red Sea498 DO jk = 1, 17499 zhfac (jk) = 0.5*( 1.- COS( rpi*(jk-1)/16. ) ) / rday500 END DO501 DO jk = 18, jpkm1502 zhfac (jk) = 1./rday503 END DO504 505 ! ! =======================506 CASE ( 2 ) ! ORCA_R2 configuration507 ! ! =======================508 509 ! Mediterranean Sea510 ij0 = 96 ; ij1 = 110511 ii0 = 157 ; ii1 = 181 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0512 ij0 = 100 ; ij1 = 110513 ii0 = 144 ; ii1 = 156 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0514 ij0 = 100 ; ij1 = 103515 ii0 = 139 ; ii1 = 143 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0516 ! Decrease before Gibraltar Strait517 ij0 = 101 ; ij1 = 102518 ii0 = 139 ; ii1 = 141 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.e0519 ii0 = 142 ; ii1 = 142 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0 / 90.e0520 ii0 = 143 ; ii1 = 143 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.40e0521 ii0 = 144 ; ii1 = 144 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.75e0522 ! Red Sea523 ij0 = 87 ; ij1 = 96524 ii0 = 147 ; ii1 = 163 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0525 ! Decrease before Bab el Mandeb Strait526 ij0 = 91 ; ij1 = 91527 ii0 = 153 ; ii1 = 160 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.80e0528 ij0 = 90 ; ij1 = 90529 ii0 = 153 ; ii1 = 160 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.40e0530 ij0 = 89 ; ij1 = 89531 ii0 = 158 ; ii1 = 160 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0 / 90.e0532 ij0 = 88 ; ij1 = 88533 ii0 = 160 ; ii1 = 163 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.e0534 ! Smooth transition from 0 at surface to 1./rday at the 18th level in Med and Red Sea535 DO jk = 1, 17536 zhfac (jk) = 0.5*( 1.- COS( rpi*(jk-1)/16. ) ) / rday537 END DO538 DO jk = 18, jpkm1539 zhfac (jk) = 1./rday540 END DO541 542 ! ! =======================543 CASE ( 05 ) ! ORCA_R05 configuration544 ! ! =======================545 546 ! Mediterranean Sea547 ii0 = 568 ; ii1 = 574548 ij0 = 324 ; ij1 = 333 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0549 ii0 = 575 ; ii1 = 658550 ij0 = 314 ; ij1 = 366 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0551 ! Black Sea (remaining part552 ii0 = 641 ; ii1 = 651553 ij0 = 367 ; ij1 = 372 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0554 ! Decrease before Gibraltar Strait555 ii0 = 324 ; ii1 = 333556 ij0 = 565 ; ij1 = 565 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0 / 90.e0557 ij0 = 566 ; ij1 = 566 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.40558 ij0 = 567 ; ij1 = 567 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 0.75559 ! Red Sea560 ii0 = 641 ; ii1 = 665561 ij0 = 270 ; ij1 = 310 ; zmrs( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 1.e0562 ! Decrease before Bab el Mandeb Strait563 ii0 = 666 ; ii1 = 675564 ij0 = 270 ; ij1 = 290565 DO ji = mi0(ii0), mi1(ii1)566 zmrs( ji , mj0(ij0):mj1(ij1) ) = 0.1 * ABS( FLOAT(ji - mi1(ii1)) )567 END DO568 zsdmp = 1./(sdmptr * rday)569 zbdmp = 1./(bdmptr * rday)570 DO jk = 1, jpk571 zhfac (jk) = ( zbdmp + (zsdmp-zbdmp) * EXP(-fsdept(1,1,jk)/hdmptr) )572 END DO573 574 ! ! ========================575 CASE ( 025 ) ! ORCA_R025 configuration576 577 CALL ctl_stop( ' Not yet implemented in ORCA_R025' )578 579 END SELECT580 581 DO jn = 1, jptra582 DO jk = 1, jpkm1583 restotr(:,:,jk,jn) = zmrs(:,:) * zhfac(jk) + ( 1. - zmrs(:,:) ) * restotr(:,:,jk,jn)584 END DO585 586 ! Mask resto array and set to 0 first and last levels587 restotr(:,:, : ,jn) = restotr(:,:,:,jn) * tmask(:,:,:)588 restotr(:,:, 1 ,jn) = 0.e0589 restotr(:,:,jpk,jn) = 0.e0590 END DO591 592 ELSE593 ! ------------594 ! No damping595 ! ------------596 CALL ctl_stop( 'Choose a correct value of ndmp or DO NOT defined key_tradmp' )597 598 ENDIF599 600 ! ----------------------------601 ! Create Print damping array602 ! ----------------------------603 604 ! ndmpftr : = 1 create a damping.coeff NetCDF file605 606 IF( ndmpftr == 1 ) THEN607 DO jn = 1, jptra608 IF(lwp) WRITE(numout,*) ' create damping.coeff.nc file ',jn609 itime = 0610 clname3 = 'damping.coeff'//ctrcnm(jn)611 CALL ymds2ju( 0 , 1 , 1 , 0.e0 , zdate0 )612 CALL restini( 'NONE', jpi , jpj , glamt, gphit, &613 & jpk , gdept , clname3, itime, zdate0, &614 & rdt , idmp , domain_id=nidom)615 CALL restput( idmp, 'Resto', jpi, jpj, jpk, 0 , restotr(:,:,:,jn) )616 CALL restclo( idmp )617 END DO618 ENDIF619 620 621 END SUBROUTINE trccof622 623 624 SUBROUTINE cofdis ( pdct )625 !!----------------------------------------------------------------------626 !! *** ROUTINE cofdis ***627 !!628 !! ** Purpose : Compute the distance between ocean T-points and the629 !! ocean model coastlines. Save the distance in a NetCDF file.630 !!631 !! ** Method : For each model level, the distance-to-coast is632 !! computed as follows :633 !! - The coastline is defined as the serie of U-,V-,F-points634 !! that are at the ocean-land bound.635 !! - For each ocean T-point, the distance-to-coast is then636 !! computed as the smallest distance (on the sphere) between the637 !! T-point and all the coastline points.638 !! - For land T-points, the distance-to-coast is set to zero.639 !! C A U T I O N : Computation not yet implemented in mpp case.640 !!641 !! ** Action : - pdct, distance to the coastline (argument)642 !! - NetCDF file 'trc.dist.coast.nc'643 !!644 !! History :645 !! 7.0 ! 01-02 (M. Imbard) Original code646 !! 8.1 ! 01-02 (G. Madec, E. Durand)647 !! 8.5 ! 02-08 (G. Madec, E. Durand) Free form, F90648 !!----------------------------------------------------------------------649 !! * Modules used650 USE ioipsl651 652 !! * Arguments653 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( out ) :: &654 pdct ! distance to the coastline655 656 !! * local declarations657 INTEGER :: ji, jj, jk, jl ! dummy loop indices658 INTEGER :: iju, ijt ! temporary integers659 INTEGER :: icoast, itime660 INTEGER :: &661 icot ! logical unit for file distance to the coast662 LOGICAL, DIMENSION(jpi,jpj) :: &663 llcotu, llcotv, llcotf ! ???664 CHARACTER (len=32) :: clname665 REAL(wp) :: zdate0666 REAL(wp), DIMENSION(jpi,jpj) :: &667 zxt, zyt, zzt, & ! cartesian coordinates for T-points668 zmask669 REAL(wp), DIMENSION(3*jpi*jpj) :: &670 zxc, zyc, zzc, zdis ! temporary workspace671 !!----------------------------------------------------------------------672 673 ! 0. Initialization674 ! -----------------675 IF(lwp) WRITE(numout,*)676 IF(lwp) WRITE(numout,*) 'cofdis : compute the distance to coastline'677 IF(lwp) WRITE(numout,*) '~~~~~~'678 IF(lwp) WRITE(numout,*)679 IF( lk_mpp ) &680 & CALL ctl_stop(' Computation not yet implemented with key_mpp_...', &681 & ' Rerun the code on another computer or ', &682 & ' create the "dist.coast.nc" file using IDL' )683 684 685 pdct(:,:,:) = 0.e0686 zxt(:,:) = cos( rad * gphit(:,:) ) * cos( rad * glamt(:,:) )687 zyt(:,:) = cos( rad * gphit(:,:) ) * sin( rad * glamt(:,:) )688 zzt(:,:) = sin( rad * gphit(:,:) )689 690 691 ! 1. Loop on vertical levels692 ! --------------------------693 ! ! ===============694 DO jk = 1, jpkm1 ! Horizontal slab695 ! ! ===============696 ! Define the coastline points (U, V and F)697 DO jj = 2, jpjm1698 DO ji = 2, jpim1699 zmask(ji,jj) = ( tmask(ji,jj+1,jk) + tmask(ji+1,jj+1,jk) &700 & + tmask(ji,jj ,jk) + tmask(ji+1,jj ,jk) )701 llcotu(ji,jj) = ( tmask(ji,jj, jk) + tmask(ji+1,jj ,jk) == 1. )702 llcotv(ji,jj) = ( tmask(ji,jj ,jk) + tmask(ji ,jj+1,jk) == 1. )703 llcotf(ji,jj) = ( zmask(ji,jj) > 0. ) .AND. ( zmask(ji,jj) < 4. )704 END DO705 END DO706 707 ! Lateral boundaries conditions708 llcotu(:, 1 ) = umask(:, 2 ,jk) == 1709 llcotu(:,jpj) = umask(:,jpjm1,jk) == 1710 llcotv(:, 1 ) = vmask(:, 2 ,jk) == 1711 llcotv(:,jpj) = vmask(:,jpjm1,jk) == 1712 llcotf(:, 1 ) = fmask(:, 2 ,jk) == 1713 llcotf(:,jpj) = fmask(:,jpjm1,jk) == 1714 715 IF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN716 llcotu( 1 ,:) = llcotu(jpim1,:)717 llcotu(jpi,:) = llcotu( 2 ,:)718 llcotv( 1 ,:) = llcotv(jpim1,:)719 llcotv(jpi,:) = llcotv( 2 ,:)720 llcotf( 1 ,:) = llcotf(jpim1,:)721 llcotf(jpi,:) = llcotf( 2 ,:)722 ELSE723 llcotu( 1 ,:) = umask( 2 ,:,jk) == 1724 llcotu(jpi,:) = umask(jpim1,:,jk) == 1725 llcotv( 1 ,:) = vmask( 2 ,:,jk) == 1726 llcotv(jpi,:) = vmask(jpim1,:,jk) == 1727 llcotf( 1 ,:) = fmask( 2 ,:,jk) == 1728 llcotf(jpi,:) = fmask(jpim1,:,jk) == 1729 ENDIF730 IF( nperio == 3 .OR. nperio == 4 ) THEN731 DO ji = 1, jpim1732 iju = jpi - ji + 1733 llcotu(ji,jpj ) = llcotu(iju,jpj-2)734 llcotf(ji,jpj-1) = llcotf(iju,jpj-2)735 llcotf(ji,jpj ) = llcotf(iju,jpj-3)736 END DO737 DO ji = jpi/2, jpi-1738 iju = jpi - ji + 1739 llcotu(ji,jpjm1) = llcotu(iju,jpjm1)740 END DO741 DO ji = 2, jpi742 ijt = jpi - ji + 2743 llcotv(ji,jpj-1) = llcotv(ijt,jpj-2)744 llcotv(ji,jpj ) = llcotv(ijt,jpj-3)745 END DO746 ENDIF747 IF( nperio == 5 .OR. nperio == 6 ) THEN748 DO ji = 1, jpim1749 iju = jpi - ji750 llcotu(ji,jpj ) = llcotu(iju,jpj-1)751 llcotf(ji,jpj ) = llcotf(iju,jpj-2)752 END DO753 DO ji = jpi/2, jpi-1754 iju = jpi - ji755 llcotf(ji,jpjm1) = llcotf(iju,jpjm1)756 END DO757 DO ji = 1, jpi758 ijt = jpi - ji + 1759 llcotv(ji,jpj ) = llcotv(ijt,jpj-1)760 END DO761 DO ji = jpi/2+1, jpi762 ijt = jpi - ji + 1763 llcotv(ji,jpjm1) = llcotv(ijt,jpjm1)764 END DO765 ENDIF766 767 ! Compute cartesian coordinates of coastline points768 ! and the number of coastline points769 770 icoast = 0771 DO jj = 1, jpj772 DO ji = 1, jpi773 IF( llcotf(ji,jj) ) THEN774 icoast = icoast + 1775 zxc(icoast) = COS( rad*gphif(ji,jj) ) * COS( rad*glamf(ji,jj) )776 zyc(icoast) = COS( rad*gphif(ji,jj) ) * SIN( rad*glamf(ji,jj) )777 zzc(icoast) = SIN( rad*gphif(ji,jj) )778 ENDIF779 IF( llcotu(ji,jj) ) THEN780 icoast = icoast+1781 zxc(icoast) = COS( rad*gphiu(ji,jj) ) * COS( rad*glamu(ji,jj) )782 zyc(icoast) = COS( rad*gphiu(ji,jj) ) * SIN( rad*glamu(ji,jj) )783 zzc(icoast) = SIN( rad*gphiu(ji,jj) )784 ENDIF785 IF( llcotv(ji,jj) ) THEN786 icoast = icoast+1787 zxc(icoast) = COS( rad*gphiv(ji,jj) ) * COS( rad*glamv(ji,jj) )788 zyc(icoast) = COS( rad*gphiv(ji,jj) ) * SIN( rad*glamv(ji,jj) )789 zzc(icoast) = SIN( rad*gphiv(ji,jj) )790 ENDIF791 END DO792 END DO793 794 ! Distance for the T-points795 796 DO jj = 1, jpj797 DO ji = 1, jpi798 IF( tmask(ji,jj,jk) == 0. ) THEN799 pdct(ji,jj,jk) = 0.800 ELSE801 DO jl = 1, icoast802 zdis(jl) = ( zxt(ji,jj) - zxc(jl) )**2 &803 + ( zyt(ji,jj) - zyc(jl) )**2 &804 + ( zzt(ji,jj) - zzc(jl) )**2805 END DO806 pdct(ji,jj,jk) = ra * SQRT( MINVAL( zdis(1:icoast) ) )807 ENDIF808 END DO809 END DO810 ! ! ===============811 END DO ! End of slab812 ! ! ===============813 814 815 ! 2. Create the distance to the coast file in NetCDF format816 ! ----------------------------------------------------------817 clname = 'trc.dist.coast'818 itime = 0819 CALL ymds2ju( 0 , 1 , 1 , 0.e0 , zdate0 )820 CALL restini( 'NONE', jpi , jpj , glamt, gphit , &821 jpk , gdept , clname, itime, zdate0, &822 rdt , icot , domain_id=nidom )823 CALL restput( icot, 'Tcoast', jpi, jpj, jpk, 0, pdct )824 CALL restclo( icot )825 826 END SUBROUTINE cofdis827 828 196 #else 829 197 !!---------------------------------------------------------------------- … … 837 205 END SUBROUTINE trc_dmp 838 206 #endif 839 840 207 !!====================================================================== 841 208 END MODULE trcdmp -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
- Property svn:executable deleted
r1271 r2528 5 5 !!====================================================================== 6 6 !!====================================================================== 7 !! History : 7.0 ! 91-11 (G. Madec) Original code 8 !! ! 93-03 (M. Guyon) symetrical conditions 9 !! ! 95-02 (M. Levy) passive tracers 10 !! ! 96-02 (G. Madec & M. Imbard) opa release 8.0 11 !! 8.0 ! 96-04 (A. Weaver) Euler forward step 12 !! 8.2 ! 99-02 (G. Madec, N. Grima) semi-implicit pressure grad. 13 !! 8.5 ! 02-08 (G. Madec) F90: Free form and module 14 !! ! 02-11 (C. Talandier, A-M Treguier) Open boundaries 15 !! 9.0 ! 04-03 (C. Ethe) passive tracers 16 !! ! 07-02 (C. Deltel) Diagnose ML trends for passive tracers 7 !! History : 7.0 ! 1991-11 (G. Madec) Original code 8 !! ! 1993-03 (M. Guyon) symetrical conditions 9 !! ! 1995-02 (M. Levy) passive tracers 10 !! ! 1996-02 (G. Madec & M. Imbard) opa release 8.0 11 !! 8.0 ! 1996-04 (A. Weaver) Euler forward step 12 !! 8.2 ! 1999-02 (G. Madec, N. Grima) semi-implicit pressure grad. 13 !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and module 14 !! ! 2002-08 (G. Madec) F90: Free form and module 15 !! ! 2002-11 (C. Talandier, A-M Treguier) Open boundaries 16 !! ! 2004-03 (C. Ethe) passive tracers 17 !! ! 2007-02 (C. Deltel) Diagnose ML trends for passive tracers 18 !! 2.0 ! 2006-02 (L. Debreu, C. Mazauric) Agrif implementation 19 !! 3.0 ! 2008-06 (G. Madec) time stepping always done in trazdf 20 !! 3.1 ! 2009-02 (G. Madec, R. Benshila) re-introduce the vvl option 21 !! 3.3 ! 2010-06 (C. Ethe, G. Madec) Merge TRA-TRC 17 22 !!---------------------------------------------------------------------- 18 23 #if defined key_top … … 24 29 !! * Modules used 25 30 USE oce_trc ! ocean dynamics and tracers variables 26 USE tr p_trc ! ocean passive tracers variables31 USE trc ! ocean passive tracers variables 27 32 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 28 USE trctrp_lec ! pasive tracers transport29 33 USE prtctl_trc ! Print control for debbuging 30 USE trdmld_trc 31 USE trdmld_trc_oce 34 USE trdmod_oce 35 USE trdtra 36 USE tranxt 37 # if defined key_agrif 32 38 USE agrif_top_update 33 39 USE agrif_top_interp 40 # endif 34 41 35 42 IMPLICIT NONE … … 38 45 !! * Routine accessibility 39 46 PUBLIC trc_nxt ! routine called by step.F90 47 48 REAL(wp), DIMENSION(jpk) :: r2dt 40 49 !!---------------------------------------------------------------------- 41 !! TOP 1.0 , LOCEAN-IPSL (2005)50 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 42 51 !! $Id$ 43 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt52 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 44 53 !!---------------------------------------------------------------------- 45 54 … … 70 79 !! ** Action : - update trb, trn 71 80 !!---------------------------------------------------------------------- 72 USE oce, ONLY : ztrtrd => ua ! use ua as 3D workspace73 81 !! * Arguments 74 82 INTEGER, INTENT( in ) :: kt ! ocean time-step index 75 83 !! * Local declarations 76 INTEGER :: j i, jj, jk, jn ! dummy loop indices84 INTEGER :: jk, jn ! dummy loop indices 77 85 REAL(wp) :: zfact ! temporary scalar 78 86 CHARACTER (len=22) :: charout 87 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: ztrdt 79 88 !!---------------------------------------------------------------------- 80 89 81 IF( kt == nit trc000 .AND. lwp ) THEN90 IF( kt == nit000 .AND. lwp ) THEN 82 91 WRITE(numout,*) 83 92 WRITE(numout,*) 'trc_nxt : time stepping on passive tracers' 84 93 ENDIF 85 94 95 ! Update after tracer on domain lateral boundaries 86 96 DO jn = 1, jptra 97 CALL lbc_lnk( tra(:,:,:,jn), 'T', 1. ) 98 END DO 87 99 88 ! 0. Lateral boundary conditions on tra (T-point, unchanged sign)89 ! ---------------------------------============90 CALL lbc_lnk( tra(:,:,:,jn), 'T', 1. )91 92 ! ! ===============93 DO jk = 1, jpk ! Horizontal slab94 ! ! ===============95 ! 1. Leap-frog scheme (only in explicit case, otherwise the96 ! ------------------- time stepping is already done in trczdf)97 IF( l_trczdf_exp .AND. ( ln_trcadv_cen2 .OR. ln_trcadv_tvd) ) THEN98 zfact = 2. * rdttra(jk) * FLOAT(ndttrc)99 IF( neuler == 0 .AND. kt == nittrc000 ) zfact = rdttra(jk) * FLOAT(ndttrc)100 tra(:,:,jk,jn) = ( trb(:,:,jk,jn) + zfact * tra(:,:,jk,jn) ) * tmask(:,:,jk)101 ENDIF102 103 END DO104 100 105 101 #if defined key_obc 106 CALL ctl_stop( ' Passive tracers and Open Boundary condition can not be used together ' & 107 & ' Check in trc_nxt routine' ) 102 !! CALL obc_trc( kt ) ! OBC open boundaries 103 #endif 104 #if defined key_bdy 105 !! CALL bdy_trc( kt ) ! BDY open boundaries 106 #endif 107 #if defined key_agrif 108 CALL Agrif_trc ! AGRIF zoom boundaries 108 109 #endif 109 110 111 112 ! set time step size (Euler/Leapfrog) 113 IF( neuler == 0 .AND. kt == nit000) THEN ; r2dt(:) = rdttrc(:) ! at nit000 (Euler) 114 ELSEIF( kt <= nit000 + 1 ) THEN ; r2dt(:) = 2.* rdttrc(:) ! at nit000 or nit000+1 (Leapfrog) 115 ENDIF 116 117 ! trends computation initialisation 118 IF( l_trdtrc ) THEN 119 ALLOCATE( ztrdt(jpi,jpj,jpk,jptra) ) !* store now fields before applying the Asselin filter 120 ztrdt(:,:,:,:) = trn(:,:,:,:) 121 ENDIF 122 ! Leap-Frog + Asselin filter time stepping 123 IF( neuler == 0 .AND. kt == nit000 ) THEN ! Euler time-stepping at first time-step 124 ! ! (only swap) 125 DO jn = 1, jptra 126 DO jk = 1, jpkm1 127 trn(:,:,jk,jn) = tra(:,:,jk,jn) 128 END DO 129 END DO 130 ! 131 ELSE 132 ! Leap-Frog + Asselin filter time stepping 133 IF( lk_vvl ) THEN ; CALL tra_nxt_vvl( kt, 'TRC', trb, trn, tra, jptra ) ! variable volume level (vvl) 134 ELSE ; CALL tra_nxt_fix( kt, 'TRC', trb, trn, tra, jptra ) ! fixed volume level 135 ENDIF 136 ENDIF 137 110 138 #if defined key_agrif 111 ! ! =============== 112 END DO ! End of slab 113 ! ! =============== 114 ! Interp tracers on boundaries (coarse => fine) 115 CALL Agrif_trc 116 ! ! =============== 117 DO jn = 1, jptra ! Horizontal slab 118 ! ! =============== 119 #endif 139 ! Update tracer at AGRIF zoom boundaries 140 IF( .NOT.Agrif_Root() ) CALL Agrif_Update_Trc( kt ) ! children only 141 #endif 120 142 121 DO jk = 1, jpk 122 123 ! 2. Time filter and swap of arrays 124 ! --------------------------------- 125 IF ( ln_trcadv_cen2 .OR. ln_trcadv_tvd ) THEN 126 127 IF( neuler == 0 .AND. kt == nittrc000 ) THEN 128 DO jj = 1, jpj 129 DO ji = 1, jpi 130 trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 131 trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn) 132 tra(ji,jj,jk,jn) = 0. 133 END DO 134 END DO 135 IF( l_trdtrc ) ztrtrd(:,:,:) = 0.e0 ! no trend 136 ELSE 137 IF( l_trdtrc ) THEN ! Asselin trend 138 DO jj = 1, jpj 139 DO ji = 1, jpi 140 ztrtrd(ji,jj,jk) = atfp * ( trb(ji,jj,jk,jn) - 2*trn(ji,jj,jk,jn) + tra(ji,jj,jk,jn) ) 141 END DO 142 END DO 143 ENDIF 144 145 DO jj = 1, jpj 146 DO ji = 1, jpi 147 trb(ji,jj,jk,jn) = atfp * ( trb(ji,jj,jk,jn) + tra(ji,jj,jk,jn) ) + atfp1 * trn(ji,jj,jk,jn) 148 trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn) 149 tra(ji,jj,jk,jn) = 0. 150 END DO 151 END DO 152 ENDIF 153 ELSE ! >> EULER-FORWARD schemes (SMOLAR, MUSCL) 154 IF( l_trdtrc ) ztrtrd(:,:,:) = 0.e0 ! no trend 155 156 DO jj = 1, jpj 157 DO ji = 1, jpi 158 trb(ji,jj,jk,jn) = tra(ji,jj,jk,jn) 159 trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn) 160 tra(ji,jj,jk,jn) = 0. 161 END DO 162 END DO 163 164 ENDIF 165 ! ! =============== 166 END DO ! End of slab 167 ! ! =============== 168 169 IF( l_trdtrc ) THEN ! trends 170 DO jk = 1, jpk 171 zfact = 2. * rdttra(jk) * FLOAT(ndttrc) 172 ztrtrd(:,:,jk) = ztrtrd(:,:,jk) / zfact ! n.b. ztrtrd=0 in Euler-forward case 143 ! trends computation 144 IF( l_trdtrc ) THEN ! trends 145 DO jn = 1, jptra 146 DO jk = 1, jpkm1 147 zfact = 1.e0 / r2dt(jk) 148 ztrdt(:,:,jk,jn) = ( trb(:,:,jk,jn) - ztrdt(:,:,jk,jn) ) * zfact 149 CALL trd_tra( kt, 'TRC', jn, jptra_trd_atf, ztrdt ) 173 150 END DO 174 IF (luttrd(jn)) CALL trd_mod_trc( ztrtrd, jn, jptrc_trd_atf, kt ) 175 ENDIF 176 ! ! =========== 177 END DO ! tracer loop 178 ! ! =========== 179 151 END DO 152 DEALLOCATE( ztrdt ) 153 END IF 154 ! 180 155 IF(ln_ctl) THEN ! print mean trends (used for debugging) 181 156 WRITE(charout, FMT="('nxt')") … … 183 158 CALL prt_ctl_trc(tab4d=trn, mask=tmask, clinfo=ctrcnm) 184 159 ENDIF 185 186 #if defined key_agrif 187 IF (.NOT.Agrif_Root()) CALL Agrif_Update_Trc( kt ) 188 #endif 189 190 160 ! 191 161 END SUBROUTINE trc_nxt 192 162 -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90
- Property svn:executable deleted
r1257 r2528 14 14 !!---------------------------------------------------------------------- 15 15 USE oce_trc ! ocean dynamics and tracers variables 16 USE tr p_trc! ocean passive tracers variables17 USE trdm ld_trc18 USE trd mld_trc_oce16 USE trc ! ocean passive tracers variables 17 USE trdmod_oce 18 USE trdtra 19 19 USE lib_mpp 20 20 USE prtctl_trc ! Print control for debbuging … … 28 28 # include "top_substitute.h90" 29 29 !!---------------------------------------------------------------------- 30 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)30 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 31 31 !! $Id$ 32 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)32 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 33 !!---------------------------------------------------------------------- 34 34 … … 54 54 !!---------------------------------------------------------------------- 55 55 56 IF( kt == nit trc000 ) THEN56 IF( kt == nit000 ) THEN 57 57 IF(lwp) WRITE(numout,*) 58 58 IF(lwp) WRITE(numout,*) 'trc_rad : Correct artificial negative concentrations ' … … 139 139 DO ji = 1, jpi 140 140 zvolk = cvol(ji,jj,jk) 141 # if defined key_ off_degrad141 # if defined key_degrad 142 142 zvolk = zvolk * facvol(ji,jj,jk) 143 143 # endif … … 180 180 ztrtrdb(:,:,:) = ( ptrb(:,:,:,jn) - ztrtrdb(:,:,:) ) * zs2rdt 181 181 ztrtrdn(:,:,:) = ( ptrn(:,:,:,jn) - ztrtrdn(:,:,:) ) * zs2rdt 182 IF (luttrd(jn)) CALL trd_mod_trc( ztrtrdb, jn, jptrc_trd_radb, kt) ! Asselin-like trend handling183 IF (luttrd(jn)) CALL trd_mod_trc( ztrtrdn, jn, jptrc_trd_radn, kt) ! standard trend handling182 CALL trd_tra( kt, 'TRC', jn, jptra_trd_radb, ztrtrdb ) ! Asselin-like trend handling 183 CALL trd_tra( kt, 'TRC', jn, jptra_trd_radn, ztrtrdn ) ! standard trend handling 184 184 ! 185 185 ENDIF … … 208 208 IF( l_trdtrc ) THEN 209 209 ! 210 zs2rdt = 1. / ( 2. * rdt * FLOAT(n dttrc) )210 zs2rdt = 1. / ( 2. * rdt * FLOAT(nn_dttrc) ) 211 211 ztrtrdb(:,:,:) = ( ptrb(:,:,:,jn) - ztrtrdb(:,:,:) ) * zs2rdt 212 212 ztrtrdn(:,:,:) = ( ptrn(:,:,:,jn) - ztrtrdn(:,:,:) ) * zs2rdt 213 IF (luttrd(jn)) CALL trd_mod_trc( ztrtrdb, jn, jptrc_trd_radb, kt) ! Asselin-like trend handling214 IF (luttrd(jn)) CALL trd_mod_trc( ztrtrdn, jn, jptrc_trd_radn, kt) ! standard trend handling213 CALL trd_tra( kt, 'TRC', jn, jptra_trd_radb, ztrtrdb ) ! Asselin-like trend handling 214 CALL trd_tra( kt, 'TRC', jn, jptra_trd_radn, ztrtrdn ) ! standard trend handling 215 215 ! 216 216 ENDIF -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
- Property svn:executable deleted
r1739 r2528 4 4 !! Ocean passive tracers: surface boundary condition 5 5 !!====================================================================== 6 !! History : 8.2 ! 98-10 (G. Madec, G. Roullet, M. Imbard) Original code7 !! 8.2 ! 01-02 (D. Ludicone) sea ice and free surface8 !! 8.5 ! 02-06 (G. Madec) F90: Free form and module9 !! 9.0 ! 04-03 (C. Ethe) adapted for passive tracers10 !! ! 06-08 (C. Deltel) Diagnose ML trends for passive tracers6 !! 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 11 11 !!============================================================================== 12 12 #if defined key_top … … 18 18 !! * Modules used 19 19 USE oce_trc ! ocean dynamics and active tracers variables 20 USE tr p_trc ! ocean passive tracers variables20 USE trc ! ocean passive tracers variables 21 21 USE prtctl_trc ! Print control for debbuging 22 USE trdm ld_trc23 USE trd mld_trc_oce22 USE trdmod_oce 23 USE trdtra 24 24 25 25 IMPLICIT NONE … … 32 32 # include "top_substitute.h90" 33 33 !!---------------------------------------------------------------------- 34 !! TOP 1.0 , LOCEAN-IPSL (2005)34 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 35 35 !! $Id$ 36 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt36 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 37 37 !!---------------------------------------------------------------------- 38 38 … … 65 65 !! * Local declarations 66 66 INTEGER :: ji, jj, jn ! dummy loop indices 67 REAL(wp) :: ztra, zsrau, zse3t ! temporary scalars 67 REAL(wp) :: zsrau, zse3t ! temporary scalars 68 REAL(wp), DIMENSION(jpi,jpj) :: zemps ! surface freshwater flux 68 69 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrtrd 69 70 CHARACTER (len=22) :: charout 70 71 !!---------------------------------------------------------------------- 71 72 72 IF( kt == nit trc000 ) THEN73 IF( kt == nit000 ) THEN 73 74 IF(lwp) WRITE(numout,*) 74 75 IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' … … 76 77 ENDIF 77 78 79 78 80 IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) 81 82 IF( lk_offline ) THEN ! emps in dynamical files contains emps - rnf 83 zemps(:,:) = emps(:,:) 84 ELSE ! Concentration dilution effect on tracer due to evaporation, precipitation, and river runoff 85 IF( lk_vvl ) THEN ! volume variable 86 zemps(:,:) = emps(:,:) - emp(:,:) 87 !!ch zemps(:,:) = 0. 88 ELSE ! linear free surface 89 IF( ln_rnf ) THEN ; zemps(:,:) = emps(:,:) - rnf(:,:) ! E-P-R 90 ELSE ; zemps(:,:) = emps(:,:) 91 ENDIF 92 ENDIF 93 ENDIF 79 94 80 95 ! 0. initialization 81 96 zsrau = 1. / rau0 82 IF( .NOT. ln_sco ) zse3t = 1. / fse3t(1,1,1)83 84 97 DO jn = 1, jptra 85 ! 1. Concentration dillution effect on tra98 ! 86 99 IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) ! save trends 87 100 ! ! add the trend to the general tracer trend 88 101 DO jj = 2, jpj 89 102 DO ji = fs_2, fs_jpim1 ! vector opt. 90 IF( ln_sco ) zse3t = 1. / fse3t(ji,jj,1) 91 ! concent./dilut. effect 92 ztra = emps(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t * tmask(ji,jj,1) 93 ! add the trend to the general tracer trend 94 tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ztra 95 #if defined key_trc_diatrd 96 IF( luttrd(jn) ) & 97 & trtrd(ji,jj,1,ikeep(jn),jpdiatrc) = trtrd(ji,jj,1,ikeep(jn),jpdiatrc) + ztra 98 #endif 99 103 zse3t = 1. / fse3t(ji,jj,1) 104 tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zemps(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t 100 105 END DO 101 106 END DO … … 103 108 IF( l_trdtrc ) THEN 104 109 ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 105 IF (luttrd(jn)) CALL trd_mod_trc(ztrtrd, jn, jptrc_trd_sbc, kt)110 CALL trd_tra( kt, 'TRC', jn, jptra_trd_nsr, ztrtrd ) 106 111 END IF 107 108 112 ! ! =========== 109 113 END DO ! tracer loop 110 114 ! ! =========== 111 112 115 IF( l_trdtrc ) DEALLOCATE( ztrtrd ) 113 116 114 115 IF(ln_ctl) THEN ! print mean trends (used for debugging) 116 WRITE(charout, FMT="('sbc')") 117 CALL prt_ctl_trc_info(charout) 118 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 117 IF( ln_ctl ) THEN 118 WRITE(charout, FMT="('sbc ')") ; CALL prt_ctl_trc_info(charout) 119 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 119 120 ENDIF 120 121 -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
- Property svn:executable deleted
r1800 r2528 5 5 !!====================================================================== 6 6 !! History : 1.0 ! 2004-03 (C. Ethe) Original code 7 !! 3.3 ! 2010-07 (C. Ethe) Merge TRA-TRC 7 8 !!---------------------------------------------------------------------- 8 9 #if defined key_top … … 13 14 !!---------------------------------------------------------------------- 14 15 USE oce_trc ! ocean dynamics and active tracers variables 15 USE trp_trc ! ocean passive tracers variables 16 USE trctrp_lec ! passive tracers transport parameters 17 USE prtctl_trc ! Print control for debbuging 18 16 USE trc ! ocean passive tracers variables 17 USE trcnam_trp ! passive tracers transport namelist variables 18 USE trabbl ! bottom boundary layer (trc_bbl routine) 19 19 USE trcbbl ! bottom boundary layer (trc_bbl routine) 20 USE zdfkpp ! KPP non-local tracer fluxes (trc_kpp routine) 20 21 USE trcdmp ! internal damping (trc_dmp routine) 21 22 USE trcldf_bilapg ! lateral mixing (trc_ldf_bilapg routine) 23 USE trcldf_bilap ! lateral mixing (trc_ldf_bilap routine) 24 USE trcldf_iso ! lateral mixing (trc_ldf_iso routine) 25 USE trcldf_iso_zps ! lateral mixing (trc_ldf_iso_zps routine) 26 USE trcldf_lap ! lateral mixing (trc_ldf_lap routine) 27 22 USE trcldf ! lateral mixing (trc_ldf routine) 23 USE trcadv ! advection (trc_adv routine) 24 USE trczdf ! vertical diffusion (trc_zdf routine) 28 25 USE trcnxt ! time-stepping (trc_nxt routine) 29 26 USE trcrad ! positivity (trc_rad routine) 30 31 USE trcadv_cen2 ! 2nd order centered advection (trc_adv_cen2 routine)32 USE trcadv_muscl ! MUSCL advection (trc_adv_muscl routine)33 USE trcadv_muscl2 ! MUSCL2 advection (trc_adv_muscl2 routine)34 USE trcadv_tvd ! TVD advection (trc_adv_tvd routine)35 USE trcadv_smolar ! SMOLAR advection (trc_adv_smolar routine)36 37 USE trczdf_exp ! vertical diffusion (trc_zdf_exp routine)38 USE trczdf_imp ! vertical diffusion (trc_zdf_exp routine)39 USE trczdf_iso ! vertical diffusion (trc_zdf_exp routine)40 USE trczdf_iso_vopt ! vertical diffusion (trc_zdf_exp routine)41 27 USE trcsbc ! surface boundary condition (trc_sbc routine) 42 43 USE zpshde_trc ! partial step: hor. derivative (zps_hde_trc routine) 28 USE zpshde ! partial step: hor. derivative (zps_hde routine) 44 29 45 30 #if defined key_agrif … … 55 40 # include "top_substitute.h90" 56 41 !!---------------------------------------------------------------------- 57 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)42 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 58 43 !! $Id$ 59 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)44 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 60 45 !!---------------------------------------------------------------------- 61 46 62 47 CONTAINS 63 48 64 SUBROUTINE trc_trp( k t)49 SUBROUTINE trc_trp( kstp ) 65 50 !!---------------------------------------------------------------------- 66 51 !! *** ROUTINE trc_trp *** … … 71 56 !! - Update the passive tracers 72 57 !!---------------------------------------------------------------------- 73 INTEGER, INTENT( in ) :: kt ! ocean time-step index 74 !! 75 CHARACTER (len=25) :: charout 58 INTEGER, INTENT( in ) :: kstp ! ocean time-step index 76 59 !! --------------------------------------------------------------------- 77 78 CALL trc_sbc( kt ) ! surface boundary condition 79 # if defined key_trcbbc 80 !!gm bug : this should be control during the initialisation phase, not here! 81 CALL ctl_stop( ' Bottom heat flux not yet implemented with passive tracer ' & 82 & ' Check in trc_trp routine ' ) 83 # endif 84 ! ! bottom boundary condition 85 IF( lk_trcbbl_dif ) CALL trc_bbl_dif( kt ) ! diffusive bottom boundary layer scheme 86 IF( lk_trcbbl_adv ) CALL trc_bbl_adv( kt ) ! advective (and/or diffusive) bottom boundary layer scheme 87 88 IF( lk_trcdmp ) CALL trc_dmp( kt ) ! internal damping trends 89 90 ! ! horizontal & vertical advection 91 IF( ln_trcadv_cen2 ) CALL trc_adv_cen2 ( kt ) ! 2nd order centered scheme 92 IF( ln_trcadv_muscl ) CALL trc_adv_muscl ( kt ) ! MUSCL scheme 93 IF( ln_trcadv_muscl2 ) CALL trc_adv_muscl2( kt ) ! MUSCL2 scheme 94 IF( ln_trcadv_tvd ) CALL trc_adv_tvd ( kt ) ! TVD scheme 95 IF( ln_trcadv_smolar ) CALL trc_adv_smolar( kt ) ! SMOLARKIEWICZ scheme 96 97 98 IF( n_cla == 1 ) THEN 99 !!gm bug : this should be control during the initialisation phase, not here! 100 WRITE(ctmp1,*) ' Cross Land Advection not yet implemented with passive tracer n_cla = ',n_cla 101 CALL ctl_stop( ctmp1 ) 102 ENDIF 103 104 ! ! lateral mixing 105 IF( l_trcldf_bilapg ) CALL trc_ldf_bilapg ( kt ) ! s-coord. horizontal bilaplacian 106 IF( l_trcldf_bilap ) CALL trc_ldf_bilap ( kt ) ! iso-level bilaplacian 107 IF( l_trcldf_iso ) CALL trc_ldf_iso ( kt ) ! iso-neutral laplacian 108 IF( l_trcldf_iso_zps ) CALL trc_ldf_iso_zps( kt ) ! partial step iso-neutral laplacian 109 IF( l_trcldf_lap ) CALL trc_ldf_lap ( kt ) ! iso-level laplacian 110 60 IF( .NOT. lk_c1d ) THEN 61 ! 62 CALL trc_sbc( kstp ) ! surface boundary condition 63 IF( lk_trabbl ) CALL trc_bbl( kstp ) ! advective (and/or diffusive) bottom boundary layer scheme 64 IF( lk_trcdmp ) CALL trc_dmp( kstp ) ! internal damping trends 65 CALL trc_adv( kstp ) ! horizontal & vertical advection 66 CALL trc_ldf( kstp ) ! lateral mixing 67 IF( .NOT. lk_offline .AND. lk_zdfkpp ) & 68 & CALL trc_kpp( kstp ) ! KPP non-local tracer fluxes 111 69 #if defined key_agrif 112 IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc! tracers sponge70 IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc ! tracers sponge 113 71 #endif 114 115 ! ! vertical diffusion116 IF( l_trczdf_exp ) CALL trc_zdf_exp ( kt ) ! explicit time stepping (time splitting scheme)117 IF( l_trczdf_imp ) CALL trc_zdf_imp ( kt ) ! implicit time stepping (euler backward)118 IF( l_trczdf_iso ) CALL trc_zdf_iso ( kt ) ! isopycnal119 IF( l_trczdf_iso_vo ) CALL trc_zdf_iso_vopt( kt ) ! vector opt. isopycnal120 121 CALL trc_nxt( kt ) ! tracer fields at next time step122 123 IF( ln_trcrad ) CALL trc_rad( kt ) ! Correct artificial negative concentrations124 ! ! especially useful when isopycnal mixing is used125 !126 127 IF( ln_zps .AND. .NOT. lk_trc_c1d ) & ! Partial steps: now horizontal gradient of passive128 & CALL zps_hde_trc( kt, trb, gtru, gtrv ) ! tracers at the bottom ocean level72 CALL trc_zdf( kstp ) ! vertical mixing and after tracer fields 73 CALL trc_nxt( kstp ) ! tracer fields at next time step 74 IF( ln_trcrad ) CALL trc_rad( kstp ) ! Correct artificial negative concentrations 75 IF( ln_zps ) CALL zps_hde( kstp, jptra, trn, gtru, gtrv ) ! Partial steps: now horizontal gradient of passive 76 ! tracers at the bottom ocean level 77 ! 78 ELSE ! 1D vertical configuration 79 CALL trc_sbc( kstp ) ! surface boundary condition 80 IF( .NOT. lk_offline .AND. lk_zdfkpp ) & 81 & CALL trc_kpp( kstp ) ! KPP non-local tracer fluxes 82 CALL trc_zdf( kstp ) ! vertical mixing and after tracer fields 83 CALL trc_nxt( kstp ) ! tracer fields at next time step 84 IF( ln_trcrad ) CALL trc_rad( kstp ) ! Correct artificial negative concentrations 85 ! 86 END IF 129 87 ! 130 88 END SUBROUTINE trc_trp -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90
- Property svn:keywords set to Id
r1685 r2528 16 16 !! trd_mld_trc_init : initialization step 17 17 !!---------------------------------------------------------------------- 18 USE trp_trc ! tracer definitions (trn, trb, tra, etc.) 19 USE oce_trc ! needed for namelist logicals, and euphotic layer arrays 20 USE trctrp_lec 21 USE trdmld_trc_oce ! definition of main arrays used for trends computations 18 USE trc ! tracer definitions (trn, trb, tra, etc.) 19 USE dom_oce ! domain definition 20 USE zdfmxl , ONLY : nmln !: number of level in the mixed layer 21 USE zdf_oce , ONLY : avt !: vert. diffusivity coef. at w-point for temp 22 # if defined key_zdfddm 23 USE zdfddm , ONLY : avs !: salinity vertical diffusivity coeff. at w-point 24 # endif 25 USE trcnam_trp ! passive tracers transport namelist variables 26 USE trdmod_trc_oce ! definition of main arrays used for trends computations 22 27 USE in_out_manager ! I/O manager 23 28 USE dianam ! build the name of file (routine) … … 29 34 USE sms_pisces 30 35 USE sms_lobster 31 USE trc32 36 33 37 IMPLICIT NONE 34 38 PRIVATE 35 39 36 INTERFACE trd_mod_trc37 MODULE PROCEDURE trd_mod_trc_trp, trd_mod_trc_bio38 END INTERFACE39 40 PUBLIC trd_mod_trc ! routine called by step.F9041 40 PUBLIC trd_mld_trc 42 41 PUBLIC trd_mld_bio 43 42 PUBLIC trd_mld_trc_init 43 PUBLIC trd_mld_trc_zint 44 PUBLIC trd_mld_bio_zint 44 45 45 46 CHARACTER (LEN=40) :: clhstnam ! name of the trends NetCDF file … … 60 61 # include "top_substitute.h90" 61 62 !!---------------------------------------------------------------------- 62 !! TOP 1.0 , LOCEAN-IPSL (2007)63 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 63 64 !! $Header: $ 64 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)65 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 65 66 !!---------------------------------------------------------------------- 66 67 67 68 CONTAINS 68 69 SUBROUTINE trd_mod_trc_trp( ptrtrd, kjn, ktrd, kt )70 !!----------------------------------------------------------------------71 !! *** ROUTINE trd_mod_trc ***72 !!----------------------------------------------------------------------73 #if defined key_trcbbl_adv74 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zun, zvn ! temporary arrays75 #else76 USE oce_trc, zun => un ! When no bbl, zun == un77 USE oce_trc, zvn => vn ! When no bbl, zvn == vn78 #endif79 INTEGER, INTENT( in ) :: kt ! time step80 INTEGER, INTENT( in ) :: kjn ! tracer index81 INTEGER, INTENT( in ) :: ktrd ! tracer trend index82 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: ptrtrd ! Temperature or U trend83 !!----------------------------------------------------------------------84 85 IF( kt == nittrc000 ) THEN86 ! IF(lwp)WRITE(numout,*)87 ! IF(lwp)WRITE(numout,*) 'trd_mod_trc:'88 ! IF(lwp)WRITE(numout,*) '~~~~~~~~~~~~'89 ENDIF90 91 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>92 ! Mixed layer trends for passive tracers93 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<94 95 SELECT CASE ( ktrd )96 CASE ( jptrc_trd_xad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_xad , '3D', kjn )97 CASE ( jptrc_trd_yad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_yad , '3D', kjn )98 CASE ( jptrc_trd_zad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_zad , '3D', kjn )99 CASE ( jptrc_trd_ldf ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_ldf , '3D', kjn )100 CASE ( jptrc_trd_xei ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_xei , '3D', kjn )101 CASE ( jptrc_trd_yei ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_yei , '3D', kjn )102 CASE ( jptrc_trd_bbl ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_bbl , '3D', kjn )103 CASE ( jptrc_trd_zdf )104 IF( ln_trcldf_iso ) THEN105 CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_ldf, '3D', kjn )106 ELSE107 CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_zdf, '3D', kjn )108 ENDIF109 CASE ( jptrc_trd_zei ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_zei , '3D', kjn )110 CASE ( jptrc_trd_dmp ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_dmp , '3D', kjn )111 CASE ( jptrc_trd_sbc ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_sbc , '2D', kjn )112 CASE ( jptrc_trd_sms ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_sms , '3D', kjn )113 CASE ( jptrc_trd_bbc ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_bbc , '3D', kjn )114 CASE ( jptrc_trd_radb ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_radb , '3D', kjn )115 CASE ( jptrc_trd_radn ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_radn , '3D', kjn )116 CASE ( jptrc_trd_atf ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_atf , '3D', kjn )117 END SELECT118 119 120 END SUBROUTINE trd_mod_trc_trp121 122 SUBROUTINE trd_mod_trc_bio( ptrbio, ktrd, kt )123 !!----------------------------------------------------------------------124 !! *** ROUTINE trd_mod_bio ***125 !!----------------------------------------------------------------------126 127 INTEGER, INTENT( in ) :: kt ! time step128 INTEGER, INTENT( in ) :: ktrd ! bio trend index129 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: ptrbio ! Bio trend130 !!----------------------------------------------------------------------131 132 CALL trd_mld_bio_zint( ptrbio, ktrd ) ! Verticaly integrated biological trends133 134 END SUBROUTINE trd_mod_trc_bio135 136 69 137 70 SUBROUTINE trd_mld_trc_zint( ptrc_trdmld, ktrd, ctype, kjn ) … … 170 103 171 104 ! ... Set nmld(ji,jj) = index of first T point below control surf. or outside mixed-layer 172 SELECT CASE ( n ctls_trc ) ! choice of the control surface105 SELECT CASE ( nn_ctls_trc ) ! choice of the control surface 173 106 CASE ( -2 ) ; STOP 'trdmld_trc : not ready ' ! -> isopycnal surface (see ???) 174 107 #if defined key_pisces || defined key_lobster … … 177 110 CASE ( 0 ) ; nmld_trc(:,:) = nmln(:,:) ! -> ML with density criterion (see zdfmxl) 178 111 CASE ( 1 ) ; nmld_trc(:,:) = nbol_trc(:,:) ! -> read index from file 179 CASE ( 2: ) ; n ctls_trc = MIN( nctls_trc, jpktrd_trc - 1 )180 nmld_trc(:,:) = n ctls_trc + 1 ! -> model level112 CASE ( 2: ) ; nn_ctls_trc = MIN( nn_ctls_trc, jpktrd_trc - 1 ) 113 nmld_trc(:,:) = nn_ctls_trc + 1 ! -> model level 181 114 END SELECT 182 115 … … 281 214 tmltrd_bio(:,:,:) = 0.e0 ! <<< reset trend arrays to zero 282 215 ! ... Set nmld(ji,jj) = index of first T point below control surf. or outside mixed-layer 283 SELECT CASE ( n ctls_trc ) ! choice of the control surface216 SELECT CASE ( nn_ctls_trc ) ! choice of the control surface 284 217 CASE ( -2 ) ; STOP 'trdmld_trc : not ready ' ! -> isopycnal surface (see ???) 285 218 CASE ( -1 ) ; nmld_trc(:,:) = neln(:,:) ! -> euphotic layer with light criterion 286 219 CASE ( 0 ) ; nmld_trc(:,:) = nmln(:,:) ! -> ML with density criterion (see zdfmxl) 287 220 CASE ( 1 ) ; nmld_trc(:,:) = nbol_trc(:,:) ! -> read index from file 288 CASE ( 2: ) ; n ctls_trc = MIN( nctls_trc, jpktrd_trc - 1 )289 nmld_trc(:,:) = n ctls_trc + 1 ! -> model level221 CASE ( 2: ) ; nn_ctls_trc = MIN( nn_ctls_trc, jpktrd_trc - 1 ) 222 nmld_trc(:,:) = nn_ctls_trc + 1 ! -> model level 290 223 END SELECT 291 224 … … 380 313 !! of time-averaged mixed-layer fields, this residual WILL NOT BE ZERO 381 314 !! over the first two analysis windows (except if restart). 382 !! N.B. For ORCA2_LIM, use e.g. ntrc_trc=5, ucf_trc=1., nctls_trc=8315 !! N.B. For ORCA2_LIM, use e.g. ntrc_trc=5, rn_ucf_trc=1., nctls_trc=8 383 316 !! for checking residuals. 384 317 !! On a NEC-SX5 computer, this typically leads to: … … 421 354 REAL(wp), DIMENSION(jpi,jpj,jpltrd_trc,jptra) :: ztmltrd2 ! -+ 422 355 !! 423 REAL(wp), DIMENSION(jpi,jpj) :: z2d ! temporary array, used for eiv arrays424 356 CHARACTER (LEN= 5) :: clvar 425 357 #if defined key_dimgout … … 429 361 !!---------------------------------------------------------------------- 430 362 431 IF( llwarn ) THEN ! warnings 432 IF( ( nittrc000 /= nit000 ) & 433 .OR.( ndttrc /= 1 ) ) THEN 434 435 WRITE(numout,*) 'Be careful, trends diags never validated' 436 STOP 'Uncomment this line to proceed' 437 ENDIF 438 ENDIF 363 IF( nn_dttrc /= 1 ) CALL ctl_stop( " Be careful, trends diags never validated " ) 439 364 440 365 ! ====================================================================== … … 450 375 DO ji = 1,jpi 451 376 ik = nmld_trc(ji,jj) 452 zavt = avt(ji,jj,ik)377 zavt = fsavs(ji,jj,ik) 453 378 DO jn = 1, jptra 454 IF( l uttrd(jn) ) &379 IF( ln_trdtrc(jn) ) & 455 380 tmltrd_trc(ji,jj,jpmld_trc_zdf,jn) = - zavt / fse3w(ji,jj,ik) * tmask(ji,jj,ik) & 456 381 & * ( trn(ji,jj,ik-1,jn) - trn(ji,jj,ik,jn) ) & … … 462 387 DO jn = 1, jptra 463 388 ! ... Remove this K_z trend from the iso-neutral diffusion term (if any) 464 IF( l uttrd(jn) ) &389 IF( ln_trdtrc(jn) ) & 465 390 tmltrd_trc(:,:,jpmld_trc_ldf,jn) = tmltrd_trc(:,:,jpmld_trc_ldf,jn) - tmltrd_trc(:,:,jpmld_trc_zdf,jn) 466 391 … … 473 398 ! therefore we do not call lbc_lnk in GYRE config. (closed basin, no cyclic B.C.) 474 399 DO jn = 1, jptra 475 IF( l uttrd(jn) ) THEN400 IF( ln_trdtrc(jn) ) THEN 476 401 DO jl = 1, jpltrd_trc 477 402 CALL lbc_lnk( tmltrd_trc(:,:,jl,jn), 'T', 1. ) ! lateral boundary conditions … … 490 415 ! II.1 Set before values of vertically averages passive tracers 491 416 ! ------------------------------------------------------------- 492 IF( kt > nit trc000 ) THEN417 IF( kt > nit000 ) THEN 493 418 DO jn = 1, jptra 494 IF( l uttrd(jn) ) THEN419 IF( ln_trdtrc(jn) ) THEN 495 420 tmlb_trc (:,:,jn) = tml_trc (:,:,jn) 496 421 tmlatfn_trc(:,:,jn) = tmltrd_trc(:,:,jpmld_trc_atf,jn) … … 505 430 DO jk = 1, jpktrd_trc ! - 1 ??? 506 431 DO jn = 1, jptra 507 IF( l uttrd(jn) ) &432 IF( ln_trdtrc(jn) ) & 508 433 tml_trc(:,:,jn) = tml_trc(:,:,jn) + wkx_trc(:,:,jk) * trn(:,:,jk,jn) 509 434 END DO … … 515 440 ! 516 441 DO jn = 1, jptra 517 IF( l uttrd(jn) ) THEN442 IF( ln_trdtrc(jn) ) THEN 518 443 tmlbb_trc (:,:,jn) = tmlb_trc (:,:,jn) ; tmlbn_trc (:,:,jn) = tml_trc (:,:,jn) 519 444 tmlatfb_trc(:,:,jn) = tmlatfn_trc(:,:,jn) ; tmlradb_trc(:,:,jn) = tmlradn_trc(:,:,jn) … … 544 469 ! ... Cumulate over BOTH physical contributions AND over time steps 545 470 DO jn = 1, jptra 546 IF( l uttrd(jn) ) THEN471 IF( ln_trdtrc(jn) ) THEN 547 472 DO jl = 1, jpltrd_trc 548 473 tmltrdm_trc(:,:,jn) = tmltrdm_trc(:,:,jn) + tmltrd_trc(:,:,jl,jn) … … 552 477 553 478 DO jn = 1, jptra 554 IF( l uttrd(jn) ) THEN479 IF( ln_trdtrc(jn) ) THEN 555 480 ! ... Special handling of the Asselin trend 556 481 tmlatfm_trc(:,:,jn) = tmlatfm_trc(:,:,jn) + tmlatfn_trc(:,:,jn) … … 573 498 574 499 ! Convert to appropriate physical units 575 tmltrd_trc(:,:,:,:) = tmltrd_trc(:,:,:,:) * ucf_trc576 577 itmod = kt - nit trc000 + 1500 tmltrd_trc(:,:,:,:) = tmltrd_trc(:,:,:,:) * rn_ucf_trc 501 502 itmod = kt - nit000 + 1 578 503 it = kt 579 504 580 MODULO_NTRD : IF( MOD( itmod, n trd_trc ) == 0 ) THEN ! nitend MUST be multiple of ntrd_trc505 MODULO_NTRD : IF( MOD( itmod, nn_trd_trc ) == 0 ) THEN ! nitend MUST be multiple of nn_trd_trc 581 506 ! 582 507 ztmltot (:,:,:) = 0.e0 ! reset arrays to zero … … 591 516 592 517 DO jn = 1, jptra 593 IF( l uttrd(jn) ) THEN518 IF( ln_trdtrc(jn) ) THEN 594 519 !-- Compute total trends (use rdttrc instead of rdt ???) 595 IF ( ln_trcadv_ smolar .OR. ln_trcadv_muscl .OR. ln_trcadv_muscl2 ) THEN ! EULER-FORWARD schemes520 IF ( ln_trcadv_muscl .OR. ln_trcadv_muscl2 ) THEN ! EULER-FORWARD schemes 596 521 ztmltot(:,:,jn) = ( tml_trc(:,:,jn) - tmlbn_trc(:,:,jn) )/rdt 597 522 ELSE ! LEAP-FROG schemes … … 629 554 !-- Compute passive tracer total trends 630 555 DO jn = 1, jptra 631 IF( l uttrd(jn) ) THEN556 IF( ln_trdtrc(jn) ) THEN 632 557 tml_sum_trc(:,:,jn) = tmlbn_trc(:,:,jn) + 2 * ( tml_sum_trc(:,:,jn) - tml_trc(:,:,jn) ) + tml_trc(:,:,jn) 633 558 ztmltot2 (:,:,jn) = ( tml_sum_trc(:,:,jn) - tml_sumb_trc(:,:,jn) ) / ( 2.*rdt ) ! now tracer unit is /sec … … 637 562 !-- Compute passive tracer residuals 638 563 DO jn = 1, jptra 639 IF( l uttrd(jn) ) THEN564 IF( ln_trdtrc(jn) ) THEN 640 565 ! 641 566 DO jl = 1, jpltrd_trc … … 680 605 DO jn = 1, jptra 681 606 682 IF( l uttrd(jn) ) THEN607 IF( ln_trdtrc(jn) ) THEN 683 608 WRITE(numout, *) 684 609 WRITE(numout, *) '>>>>>>>>>>>>>>>>>> TRC TRACER jn =', jn, ' <<<<<<<<<<<<<<<<<<' … … 777 702 rmld_sum_trc(:,:) = rmld_sum_trc(:,:) / (2*zfn) ! similar to tml_sum and sml_sum 778 703 DO jn = 1, jptra 779 IF( l uttrd(jn) ) THEN704 IF( ln_trdtrc(jn) ) THEN 780 705 ! For passive tracer instantaneous diagnostics 781 706 tmlbb_trc (:,:,jn) = tmlb_trc (:,:,jn) ; tmlbn_trc (:,:,jn) = tml_trc (:,:,jn) … … 791 716 ! III.4 Convert to appropriate physical units 792 717 ! ------------------------------------------- 793 ztmltot (:,:,jn) = ztmltot (:,:,jn) * ucf_trc/zfn ! instant diags794 ztmlres (:,:,jn) = ztmlres (:,:,jn) * ucf_trc/zfn795 ztmlatf (:,:,jn) = ztmlatf (:,:,jn) * ucf_trc/zfn796 ztmlrad (:,:,jn) = ztmlrad (:,:,jn) * ucf_trc/zfn718 ztmltot (:,:,jn) = ztmltot (:,:,jn) * rn_ucf_trc/zfn ! instant diags 719 ztmlres (:,:,jn) = ztmlres (:,:,jn) * rn_ucf_trc/zfn 720 ztmlatf (:,:,jn) = ztmlatf (:,:,jn) * rn_ucf_trc/zfn 721 ztmlrad (:,:,jn) = ztmlrad (:,:,jn) * rn_ucf_trc/zfn 797 722 tml_sum_trc (:,:,jn) = tml_sum_trc (:,:,jn) / (2*zfn) ! mean diags 798 ztmltot2 (:,:,jn) = ztmltot2 (:,:,jn) * ucf_trc/zfn2799 ztmltrd2 (:,:,:,jn) = ztmltrd2 (:,:,:,jn) * ucf_trc/zfn2800 ztmlatf2 (:,:,jn) = ztmlatf2 (:,:,jn) * ucf_trc/zfn2801 ztmlrad2 (:,:,jn) = ztmlrad2 (:,:,jn) * ucf_trc/zfn2802 ztmlres2 (:,:,jn) = ztmlres2 (:,:,jn) * ucf_trc/zfn2723 ztmltot2 (:,:,jn) = ztmltot2 (:,:,jn) * rn_ucf_trc/zfn2 724 ztmltrd2 (:,:,:,jn) = ztmltrd2 (:,:,:,jn) * rn_ucf_trc/zfn2 725 ztmlatf2 (:,:,jn) = ztmlatf2 (:,:,jn) * rn_ucf_trc/zfn2 726 ztmlrad2 (:,:,jn) = ztmlrad2 (:,:,jn) * rn_ucf_trc/zfn2 727 ztmlres2 (:,:,jn) = ztmlres2 (:,:,jn) * rn_ucf_trc/zfn2 803 728 ENDIF 804 729 END DO … … 820 745 ! ---------------------------------- 821 746 822 IF( lwp .AND. MOD( itmod , n trd_trc ) == 0 ) THEN747 IF( lwp .AND. MOD( itmod , nn_trd_trc ) == 0 ) THEN 823 748 WRITE(numout,*) ' ' 824 749 WRITE(numout,*) 'trd_mld_trc : write passive tracer trends in the NetCDF file :' … … 834 759 DO jn = 1, jptra 835 760 ! 836 IF( luttrd(jn) ) THEN 837 !-- Specific treatment for EIV trends 838 ! WARNING : When eiv is switched on but key_diaeiv is not, we do NOT diagnose 839 ! u_eiv, v_eiv, and w_eiv : the exact eiv advective trends thus cannot be computed, 840 ! only their sum makes sense => mask directional contrib. to avoid confusion 841 z2d(:,:) = tmltrd_trc(:,:,jpmld_trc_xei,jn) + tmltrd_trc(:,:,jpmld_trc_yei,jn) & 842 & + tmltrd_trc(:,:,jpmld_trc_zei,jn) 843 #if ( defined key_trcldf_eiv && defined key_diaeiv ) 844 tmltrd_trc(:,:,jpmld_trc_xei,jn) = -999. 845 tmltrd_trc(:,:,jpmld_trc_yei,jn) = -999. 846 tmltrd_trc(:,:,jpmld_trc_zei,jn) = -999. 847 #endif 761 IF( ln_trdtrc(jn) ) THEN 848 762 CALL histwrite( nidtrd(jn), "mxl_depth", it, rmld_trc(:,:), ndimtrd1, ndextrd1 ) 849 763 !-- Output the fields … … 864 778 & it, ztmlatf(:,:,jn), ndimtrd1, ndextrd1 ) 865 779 866 CALL histwrite( nidtrd(jn), trim(clvar//ctrd_trc( jpltrd_trc+1,2)), & ! now total EIV : jpltrd_trc + 1867 & it, z2d(:,:), ndimtrd1, ndextrd1 )868 !869 780 ENDIF 870 781 END DO … … 872 783 IF( kt == nitend ) THEN 873 784 DO jn = 1, jptra 874 IF( l uttrd(jn) ) CALL histclo( nidtrd(jn) )785 IF( ln_trdtrc(jn) ) CALL histclo( nidtrd(jn) ) 875 786 END DO 876 787 ENDIF … … 881 792 DO jn = 1, jptra 882 793 ! 883 IF( luttrd(jn) ) THEN 884 !-- Specific treatment for EIV trends 885 ! WARNING : see above 886 z2d(:,:) = ztmltrd2(:,:,jpmld_trc_xei,jn) + ztmltrd2(:,:,jpmld_trc_yei,jn) & 887 & + ztmltrd2(:,:,jpmld_trc_zei,jn) 888 889 #if ( defined key_trcldf_eiv && defined key_diaeiv ) 890 ztmltrd2(:,:,jpmld_trc_xei,jn) = -999. 891 ztmltrd2(:,:,jpmld_trc_yei,jn) = -999. 892 ztmltrd2(:,:,jpmld_trc_zei,jn) = -999. 893 #endif 794 IF( ln_trdtrc(jn) ) THEN 894 795 CALL histwrite( nidtrd(jn), "mxl_depth", it, rmld_sum_trc(:,:), ndimtrd1, ndextrd1 ) 895 796 !-- Output the fields … … 911 812 & it, ztmlatf2(:,:,jn), ndimtrd1, ndextrd1 ) 912 813 913 CALL histwrite( nidtrd(jn), trim(clvar//ctrd_trc( jpltrd_trc+1,2)), & ! now total EIV : jpltrd_trc + 1914 & it, z2d(:,:), ndimtrd1, ndextrd1 )915 916 814 ENDIF 917 815 ! … … 919 817 IF( kt == nitend ) THEN 920 818 DO jn = 1, jptra 921 IF( l uttrd(jn) ) CALL histclo( nidtrd(jn) )819 IF( ln_trdtrc(jn) ) CALL histclo( nidtrd(jn) ) 922 820 END DO 923 821 ENDIF … … 931 829 # endif /* key_dimgout */ 932 830 933 IF( MOD( itmod, n trd_trc ) == 0 ) THEN831 IF( MOD( itmod, nn_trd_trc ) == 0 ) THEN 934 832 ! 935 833 ! Reset cumulative arrays to zero … … 1010 908 !!---------------------------------------------------------------------- 1011 909 ! ... Warnings 1012 IF( llwarn ) THEN 1013 IF( ( nittrc000 /= nit000 ) & 1014 .OR.( ndttrc /= 1 ) ) THEN 1015 1016 WRITE(numout,*) 'Be careful, trends diags never validated' 1017 STOP 'Uncomment this line to proceed' 1018 END IF 1019 END IF 910 IF( nn_dttrc /= 1 ) CALL ctl_stop( " Be careful, trends diags never validated " ) 1020 911 1021 912 ! ====================================================================== … … 1058 949 1059 950 ! Convert to appropriate physical units 1060 tmltrd_bio(:,:,:) = tmltrd_bio(:,:,:) * ucf_trc1061 1062 MODULO_NTRD : IF( MOD( kt, n trd_trc ) == 0 ) THEN ! nitend MUST be multiple of ntrd951 tmltrd_bio(:,:,:) = tmltrd_bio(:,:,:) * rn_ucf_trc 952 953 MODULO_NTRD : IF( MOD( kt, nn_trd_trc ) == 0 ) THEN ! nitend MUST be multiple of ntrd 1063 954 ! 1064 955 zfn = float(nmoymltrdbio) ; zfn2 = zfn * zfn … … 1114 1005 ! III.4 Convert to appropriate physical units 1115 1006 ! ------------------------------------------- 1116 ztmltrdbio2 (:,:,:) = ztmltrdbio2 (:,:,:) * ucf_trc/zfn21007 ztmltrdbio2 (:,:,:) = ztmltrdbio2 (:,:,:) * rn_ucf_trc/zfn2 1117 1008 1118 1009 END IF MODULO_NTRD … … 1133 1024 1134 1025 ! define time axis 1135 itmod = kt - nit trc000 + 11026 itmod = kt - nit000 + 1 1136 1027 it = kt 1137 1028 1138 IF( lwp .AND. MOD( itmod , n trd_trc ) == 0 ) THEN1029 IF( lwp .AND. MOD( itmod , nn_trd_trc ) == 0 ) THEN 1139 1030 WRITE(numout,*) ' ' 1140 1031 WRITE(numout,*) 'trd_mld_bio : write ML bio trends in the NetCDF file :' … … 1176 1067 # endif /* key_dimgout */ 1177 1068 1178 IF( MOD( itmod, n trd_trc ) == 0 ) THEN1069 IF( MOD( itmod, nn_trd_trc ) == 0 ) THEN 1179 1070 ! 1180 1071 ! III.5 Reset cumulative arrays to zero … … 1216 1107 INTEGER :: ilseq, jl, jn 1217 1108 REAL(wp) :: zjulian, zsto, zout 1218 CHARACTER (LEN=40) :: clop , cleiv1109 CHARACTER (LEN=40) :: clop 1219 1110 CHARACTER (LEN=15) :: csuff 1220 1111 CHARACTER (LEN=12) :: clmxl 1221 1112 CHARACTER (LEN=16) :: cltrcu 1222 1113 CHARACTER (LEN= 5) :: clvar 1223 1224 NAMELIST/namtoptrd/ ntrd_trc, nctls_trc, ucf_trc, &1225 ln_trdmld_trc_restart, ln_trdmld_trc_instant, luttrd1226 1114 1227 1115 !!---------------------------------------------------------------------- … … 1241 1129 ! I.1 Check consistency of user defined preferences 1242 1130 ! ------------------------------------------------- 1243 #if defined key_trcldf_eiv 1244 IF( lk_trdmld_trc .AND. ln_trcldf_iso ) THEN 1245 WRITE(numout,cform_war) 1246 WRITE(numout,*) ' You asked for ML diagnostics with iso-neutral diffusion ' 1247 WRITE(numout,*) ' and eiv physics. ' 1248 WRITE(numout,*) ' Yet, key_diaeiv is NOT switched on, so the eddy induced ' 1249 WRITE(numout,*) ' velocity is not diagnosed. ' 1250 WRITE(numout,*) ' Therefore, we cannot deduce the eiv advective trends. ' 1251 WRITE(numout,*) ' Only THE SUM of the i,j,k directional contributions then ' 1252 WRITE(numout,*) ' makes sense => To avoid any confusion, we choosed to mask ' 1253 WRITE(numout,*) ' these i,j,k directional contributions (with -999.) ' 1254 nwarn = nwarn + 1 1255 ENDIF 1256 # endif 1257 1258 IF( ( lk_trdmld_trc ) .AND. ( MOD( nitend, ntrd_trc ) /= 0 ) ) THEN 1131 1132 IF( ( lk_trdmld_trc ) .AND. ( MOD( nitend, nn_trd_trc ) /= 0 ) ) THEN 1259 1133 WRITE(numout,cform_err) 1260 1134 WRITE(numout,*) ' Your nitend parameter, nitend = ', nitend 1261 1135 WRITE(numout,*) ' is no multiple of the trends diagnostics frequency ' 1262 WRITE(numout,*) ' you defined, n trd_trc = ', ntrd_trc1136 WRITE(numout,*) ' you defined, nn_trd_trc = ', nn_trd_trc 1263 1137 WRITE(numout,*) ' This will not allow you to restart from this simulation. ' 1264 1138 WRITE(numout,*) ' You should reconsider this choice. ' … … 1269 1143 ENDIF 1270 1144 1271 IF( ( lk_trdmld_trc ) .AND. ( n_cla == 1 ) ) THEN1272 WRITE(numout,cform_war)1273 WRITE(numout,*) ' You set n_cla = 1. Note that the Mixed-Layer diagnostics '1274 WRITE(numout,*) ' are not exact along the corresponding straits. '1275 nwarn = nwarn + 11276 ENDIF1277 1278 1279 1145 ! * Debugging information * 1280 1146 IF( lldebug ) THEN 1281 1147 WRITE(numout,*) ' ln_trcadv_muscl = ' , ln_trcadv_muscl 1282 WRITE(numout,*) ' ln_trcadv_smolar = ' , ln_trcadv_smolar1283 1148 WRITE(numout,*) ' ln_trdmld_trc_instant = ', ln_trdmld_trc_instant 1284 ENDIF1285 1286 IF( ln_trcadv_smolar .AND. .NOT. ln_trdmld_trc_instant ) THEN1287 WRITE(numout,cform_err)1288 WRITE(numout,*) ' Currently, you can NOT use simultaneously tracer Smolark. '1289 WRITE(numout,*) ' advection and window averaged diagnostics of ML trends. '1290 WRITE(numout,*) ' WHY? Everything in trdmld_trc is coded for leap-frog, and '1291 WRITE(numout,*) ' Smolarkiewicz scheme is Euler forward. '1292 WRITE(numout,*) ' In particuliar, entrainment trend would be FALSE. However '1293 WRITE(numout,*) ' this residual is correct for instantaneous ML diagnostics.'1294 WRITE(numout,*)1295 nstop = nstop + 11296 1149 ENDIF 1297 1150 … … 1364 1217 ! I.3 Read control surface from file ctlsurf_idx 1365 1218 ! ---------------------------------------------- 1366 IF( n ctls_trc == 1 ) THEN1219 IF( nn_ctls_trc == 1 ) THEN 1367 1220 CALL ctl_opn( inum, 'ctlsurf_idx', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 1368 1221 READ ( inum ) nbol_trc … … 1378 1231 #else 1379 1232 ! clmxl = legend root for netCDF output 1380 IF( n ctls_trc == 0 ) THEN ! control surface = mixed-layer with density criterion1233 IF( nn_ctls_trc == 0 ) THEN ! control surface = mixed-layer with density criterion 1381 1234 clmxl = 'Mixed Layer ' 1382 ELSE IF( n ctls_trc == 1 ) THEN ! control surface = read index from file1235 ELSE IF( nn_ctls_trc == 1 ) THEN ! control surface = read index from file 1383 1236 clmxl = ' Bowl ' 1384 ELSE IF( n ctls_trc >= 2 ) THEN ! control surface = model level1385 WRITE(clmxl,'(A10,I2,1X)') 'Levels 1 -', n ctls_trc1237 ELSE IF( nn_ctls_trc >= 2 ) THEN ! control surface = model level 1238 WRITE(clmxl,'(A10,I2,1X)') 'Levels 1 -', nn_ctls_trc 1386 1239 ENDIF 1387 1240 … … 1395 1248 STOP 'trd_mld_trc : this was never checked. Comment this line to proceed...' 1396 1249 ENDIF 1397 zsto = n trd_trc * rdt1250 zsto = nn_trd_trc * rdt 1398 1251 clop = "inst("//TRIM(clop)//")" 1399 1252 # else … … 1401 1254 zsto = rdt ! inst. diags : we use IOIPSL time averaging 1402 1255 ELSE 1403 zsto = n trd_trc * rdt ! mean diags : we DO NOT use any IOIPSL time averaging1256 zsto = nn_trd_trc * rdt ! mean diags : we DO NOT use any IOIPSL time averaging 1404 1257 ENDIF 1405 1258 clop = "ave("//TRIM(clop)//")" 1406 1259 # endif 1407 zout = n trd_trc * rdt1260 zout = nn_trd_trc * rdt 1408 1261 1409 1262 IF(lwp) WRITE (numout,*) ' netCDF initialization' … … 1424 1277 ! ==> choose them according to trdmld_trc_oce.F90 <== 1425 1278 1426 #if defined key_diaeiv1427 cleiv = " (*** only total EIV is meaningful ***)" ! eiv advec. trends require u_eiv, v_eiv1428 #else1429 cleiv = " "1430 #endif1431 1279 ctrd_trc(jpmld_trc_xad ,1) = " Zonal advection" ; ctrd_trc(jpmld_trc_xad ,2) = "_xad" 1432 1280 ctrd_trc(jpmld_trc_yad ,1) = " Meridional advection" ; ctrd_trc(jpmld_trc_yad ,2) = "_yad" … … 1434 1282 ctrd_trc(jpmld_trc_ldf ,1) = " Lateral diffusion" ; ctrd_trc(jpmld_trc_ldf ,2) = "_ldf" 1435 1283 ctrd_trc(jpmld_trc_zdf ,1) = " Vertical diff. (Kz)" ; ctrd_trc(jpmld_trc_zdf ,2) = "_zdf" 1436 ctrd_trc(jpmld_trc_xei ,1) = " Zonal EIV advection"//cleiv ; ctrd_trc(jpmld_trc_xei ,2) = "_xei"1437 ctrd_trc(jpmld_trc_yei ,1) = " Merid. EIV advection"//cleiv ; ctrd_trc(jpmld_trc_yei ,2) = "_yei"1438 ctrd_trc(jpmld_trc_zei ,1) = " Vertical EIV advection"//cleiv ; ctrd_trc(jpmld_trc_zei ,2) = "_zei"1439 ctrd_trc(jpmld_trc_bbc ,1) = " Geothermal flux" ; ctrd_trc(jpmld_trc_bbc ,2) = "_bbc"1440 1284 ctrd_trc(jpmld_trc_bbl ,1) = " Adv/diff. Bottom boundary layer" ; ctrd_trc(jpmld_trc_bbl ,2) = "_bbl" 1441 1285 ctrd_trc(jpmld_trc_dmp ,1) = " Tracer damping" ; ctrd_trc(jpmld_trc_dmp ,2) = "_dmp" … … 1445 1289 ctrd_trc(jpmld_trc_radn ,1) = " Correct negative concentrations" ; ctrd_trc(jpmld_trc_radn ,2) = "_radn" 1446 1290 ctrd_trc(jpmld_trc_atf ,1) = " Asselin time filter" ; ctrd_trc(jpmld_trc_atf ,2) = "_atf" 1447 ctrd_trc(jpltrd_trc+1 ,1) = " Total EIV"//cleiv ; ctrd_trc(jpltrd_trc+1 ,2) = "_tei"1448 1291 1449 1292 DO jn = 1, jptra 1450 1293 !-- Create a NetCDF file and enter the define mode 1451 IF( l uttrd(jn) ) THEN1294 IF( ln_trdtrc(jn) ) THEN 1452 1295 csuff="ML_"//ctrcnm(jn) 1453 CALL dia_nam( clhstnam, n trd_trc, csuff )1296 CALL dia_nam( clhstnam, nn_trd_trc, csuff ) 1454 1297 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & 1455 & 1, jpi, 1, jpj, nit trc000-ndttrc, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom)1298 & 1, jpi, 1, jpj, nit000, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set ) 1456 1299 1457 1300 !-- Define the ML depth variable … … 1464 1307 #if defined key_lobster 1465 1308 !-- Create a NetCDF file and enter the define mode 1466 CALL dia_nam( clhstnam, n trd_trc, 'trdbio' )1309 CALL dia_nam( clhstnam, nn_trd_trc, 'trdbio' ) 1467 1310 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & 1468 & 1, jpi, 1, jpj, nit trc000-ndttrc, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom)1311 & 1, jpi, 1, jpj, nit000, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom, snc4chunks=snc4set ) 1469 1312 #endif 1470 1313 1471 1314 !-- Define physical units 1472 IF( ucf_trc == 1. ) THEN1315 IF( rn_ucf_trc == 1. ) THEN 1473 1316 cltrcu = "(mmole-N/m3)/sec" ! all passive tracers have the same unit 1474 ELSEIF ( ucf_trc == 3600.*24.) THEN ! ??? trop long : seulement (mmole-N/m3)1317 ELSEIF ( rn_ucf_trc == 3600.*24.) THEN ! ??? trop long : seulement (mmole-N/m3) 1475 1318 cltrcu = "(mmole-N/m3)/day" ! ??? apparait dans les sorties netcdf 1476 1319 ELSE … … 1485 1328 DO jn = 1, jptra 1486 1329 ! 1487 IF( l uttrd(jn) ) THEN1330 IF( ln_trdtrc(jn) ) THEN 1488 1331 clvar = trim(ctrcnm(jn))//"ml" ! e.g. detml, zooml, no3ml, etc. 1489 1332 CALL histdef(nidtrd(jn), clvar, clmxl//" "//trim(ctrcnm(jn))//" Mixed Layer ", & … … 1504 1347 CALL histdef(nidtrd(jn), trim(clvar//ctrd_trc(jpmld_trc_atf,2)), clmxl//" "//clvar//ctrd_trc(jpmld_trc_atf,1), & 1505 1348 & cltrcu, jpi, jpj, nh_t(jn), 1 , 1, 1 , -99 , 32, clop, zout, zout ) ! IOIPSL: NO time mean 1506 1507 CALL histdef(nidtrd(jn), trim(clvar//ctrd_trc(jpltrd_trc+1,2)), clmxl//" "//clvar//ctrd_trc(jpltrd_trc+1 ,1), &1508 & cltrcu, jpi, jpj, nh_t(jn), 1 , 1, 1 , -99 , 32, clop, zsto, zout ) ! Total EIV1509 1349 ! 1510 1350 ENDIF … … 1520 1360 !-- Leave IOIPSL/NetCDF define mode 1521 1361 DO jn = 1, jptra 1522 IF( l uttrd(jn) ) CALL histend( nidtrd(jn))1362 IF( ln_trdtrc(jn) ) CALL histend( nidtrd(jn), snc4set ) 1523 1363 END DO 1524 1364 1525 1365 #if defined key_lobster 1526 1366 !-- Leave IOIPSL/NetCDF define mode 1527 CALL histend( nidtrdbio )1367 CALL histend( nidtrdbio, snc4set ) 1528 1368 1529 1369 IF(lwp) WRITE(numout,*) … … 1539 1379 !!---------------------------------------------------------------------- 1540 1380 1541 INTERFACE trd_mod_trc1542 MODULE PROCEDURE trd_mod_trc_trp, trd_mod_trc_bio1543 END INTERFACE1544 1545 1381 CONTAINS 1546 1382 … … 1554 1390 WRITE(*,*) 'trd_mld_bio: You should not have seen this print! error?', kt 1555 1391 END SUBROUTINE trd_mld_bio 1556 1557 SUBROUTINE trd_mod_trc_bio( ptrbio, ktrd, kt )1558 INTEGER , INTENT( in ) :: kt ! time step1559 INTEGER , INTENT( in ) :: ktrd ! bio trend index1560 REAL, DIMENSION(:,:,:), INTENT( inout ) :: ptrbio ! Bio trend1561 WRITE(*,*) 'trd_mod_trc_bio : You should not have seen this print! error?', ptrbio(1,1,1)1562 WRITE(*,*) ' " " : You should not have seen this print! error?', ktrd1563 WRITE(*,*) ' " " : You should not have seen this print! error?', kt1564 END SUBROUTINE trd_mod_trc_bio1565 1566 SUBROUTINE trd_mod_trc_trp( ptrtrd, kjn, ktrd, kt )1567 INTEGER , INTENT( in ) :: kt ! time step1568 INTEGER , INTENT( in ) :: kjn ! tracer index1569 INTEGER , INTENT( in ) :: ktrd ! tracer trend index1570 REAL, DIMENSION(:,:,:), INTENT( inout ) :: ptrtrd ! Temperature or U trend1571 WRITE(*,*) 'trd_mod_trc_trp : You should not have seen this print! error?', ptrtrd(1,1,1)1572 WRITE(*,*) ' " " : You should not have seen this print! error?', kjn1573 WRITE(*,*) ' " " : You should not have seen this print! error?', ktrd1574 WRITE(*,*) ' " " : You should not have seen this print! error?', kt1575 END SUBROUTINE trd_mod_trc_trp1576 1392 1577 1393 SUBROUTINE trd_mld_trc_zint( ptrc_trdmld, ktrd, ctype, kjn ) -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc_rst.F90
- Property svn:keywords set to Id
r1473 r2528 9 9 #if defined key_top && defined key_trdmld_trc 10 10 !!---------------------------------------------------------------------- 11 USE oce_trc12 11 USE in_out_manager ! I/O manager 13 12 USE iom ! I/O module 14 USE trc ! for n dttrc ctrcnm15 USE trdm ld_trc_oce ! for lk_trdmld_trc13 USE trc ! for nn_dttrc ctrcnm 14 USE trdmod_trc_oce ! for lk_trdmld_trc 16 15 17 16 IMPLICIT NONE … … 23 22 INTEGER :: nummldw_trc ! logical unit for mld restart 24 23 !!--------------------------------------------------------------------------------- 25 !! OPA 9.0 , LOCEAN-IPSL (2006)24 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 26 25 !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/TRD/trdmld_rst.F90,v 1.6 2006/11/14 09:46:13 opalod Exp $ 27 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)26 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 28 27 !!--------------------------------------------------------------------------------- 29 28 … … 45 44 !!-------------------------------------------------------------------------------- 46 45 47 IF( kt == nitrst - n dttrc .OR. nitend - nit000 + 1 < 2 * ndttrc ) THEN ! idem trcrst.F9046 IF( kt == nitrst - nn_dttrc .OR. nitend - nit000 + 1 < 2 * nn_dttrc ) THEN ! idem trcrst.F90 48 47 IF( nitrst > 1.0e9 ) THEN 49 48 WRITE(clkt,*) nitrst -
trunk/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
- Property svn:eol-style deleted
r1753 r2528 6 6 !! History : 1.0 ! 2004-03 (C. Ethe) original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) rewritting 8 !!----------------------------------------------------------------------9 !! NEMO/TOP 2.0, LOCEAN-IPSL (2007)10 !! $Id$11 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)12 8 !!---------------------------------------------------------------------- 13 9 #if defined key_top … … 32 28 USE par_oce , ONLY : jpkdta => jpkdta !: number of levels > or = jpk 33 29 USE par_oce , ONLY : lk_esopa => lk_esopa !: flag to activate the all option 30 USE par_oce , ONLY : jp_tem => jp_tem !: indice for temperature 31 USE par_oce , ONLY : jp_sal => jp_sal !: indice for salinity 34 32 35 33 !* IO manager * 36 USE in_out_manager ! use all the variables 34 USE in_out_manager 35 37 36 !* physical constants * 38 USE phycst ! use all the variables 37 USE phycst 38 39 !* 1D configuration 40 USE c1d 39 41 40 42 !* model domain * … … 111 113 USE dom_oce , ONLY : ln_sco => ln_sco !: s-coordinate flag 112 114 USE dom_oce , ONLY : ln_zco => ln_zco !: z-coordinate flag 113 USE dom_oce , ONLY : lk_zco => lk_zco !: z-coordinate flag (1D or 3D arrays) 114 USE dom_oce , ONLY : hbatt => hbatt !: ocean depth at the vertical of t-point (m) 115 USE dom_oce , ONLY : hbatu => hbatu !: ocean depth at the vertical of u-point (m) 116 USE dom_oce , ONLY : hbatv => hbatv !: ocean depth at the vertical of w-point (m) 117 USE dom_oce , ONLY : gsigt => gsigt !: model level depth coefficient at T-levels 118 USE dom_oce , ONLY : gsigw => gsigw !: model level depth coefficient at W-levels 119 USE dom_oce , ONLY : gsi3w => gsi3w !: model level depth coef at w-levels (defined as the sum of e3w) 120 USE dom_oce , ONLY : esigt => esigt !: vertical scale factor coef. at t-levels 121 USE dom_oce , ONLY : esigw => esigw !: vertical scale factor coef. at w-levels 122 USE dom_oce , ONLY : lk_vvl => lk_vvl !: variable grid flag 123 115 USE dom_oce , ONLY : hbatt => hbatt !: ocean depth at the vertical of t-point (m) 116 USE dom_oce , ONLY : hbatu => hbatu !: ocean depth at the vertical of u-point (m) 117 USE dom_oce , ONLY : hbatv => hbatv !: ocean depth at the vertical of w-point (m) 118 USE dom_oce , ONLY : gsigt => gsigt !: model level depth coefficient at T-levels 119 USE dom_oce , ONLY : gsigw => gsigw !: model level depth coefficient at W-levels 120 USE dom_oce , ONLY : gsi3w => gsi3w !: model level depth coef at w-levels (defined as the sum of e3w) 121 USE dom_oce , ONLY : esigt => esigt !: vertical scale factor coef. at t-levels 122 USE dom_oce , ONLY : esigw => esigw !: vertical scale factor coef. at w-levels 123 USE dom_oce , ONLY : lk_vvl => lk_vvl !: variable grid flag 124 # if defined key_vvl 125 USE dom_oce , ONLY : gdep3w_1 => gdep3w_1 !: ??? 126 USE dom_oce , ONLY : gdept_1 => gdept_1 !: depth of t-points (m) 127 USE dom_oce , ONLY : gdepw_1 => gdepw_1 !: depth of t-points (m) 128 USE dom_oce , ONLY : e3t_1 => e3t_1 !: vertical scale factors at t- 129 USE dom_oce , ONLY : e3u_1 => e3u_1 !: vertical scale factors at u- 130 USE dom_oce , ONLY : e3v_1 => e3v_1 !: vertical scale factors v- 131 USE dom_oce , ONLY : e3w_1 => e3w_1 !: w-points (m) 132 USE dom_oce , ONLY : e3f_1 => e3f_1 !: f-points (m) 133 USE dom_oce , ONLY : e3uw_1 => e3uw_1 !: uw-points (m) 134 USE dom_oce , ONLY : e3vw_1 => e3vw_1 !: vw-points (m) 135 # endif 124 136 !* masks, bathymetry * 125 USE dom_oce , ONLY : mbathy => mbathy !: number of ocean level (=0, & 1, ... , jpk-1) 137 USE dom_oce , ONLY : mbkt => mbkt !: vertical index of the bottom last T- ocean level 138 USE dom_oce , ONLY : mbku => mbku !: vertical index of the bottom last U- ocean level 139 USE dom_oce , ONLY : mbkv => mbkv !: vertical index of the bottom last V- ocean level 126 140 USE dom_oce , ONLY : tmask_i => tmask_i !: Interior mask at t-points 127 141 USE dom_oce , ONLY : tmask => tmask !: land/ocean mask at t-points … … 129 143 USE dom_oce , ONLY : vmask => vmask !: land/ocean mask at v-points 130 144 USE dom_oce , ONLY : fmask => fmask !: land/ocean mask at f-points 131 # if defined key_off_degrad132 USE dom_oce , ONLY : facvol => facvol !: volume factor for degradation133 # endif134 145 135 146 !* time domain * … … 166 177 USE oce , ONLY : tn => tn !: pot. temperature (celsius) 167 178 USE oce , ONLY : sn => sn !: salinity (psu) 179 USE oce , ONLY : tsn => tsn !: 4D array contaning ( tn, sn ) 180 USE oce , ONLY : tsb => tsb !: 4D array contaning ( tb, sb ) 181 USE oce , ONLY : tsa => tsa !: 4D array contaning ( ta, sa ) 168 182 USE oce , ONLY : rhop => rhop !: potential volumic mass (kg m-3) 169 183 USE oce , ONLY : rhd => rhd !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 170 184 USE oce , ONLY : hdivn => hdivn !: horizontal divergence (1/s) 171 #if defined key_off_tra 172 USE oce , ONLY : gtu => gtu !: t-, s- and rd horizontal gradient at u- and 173 USE oce , ONLY : gsu => gsu !: v-points at bottom ocean level 185 USE oce , ONLY : l_traldf_rot => l_traldf_rot !: rotated laplacian operator for lateral diffusion 186 #if defined key_offline 187 USE oce , ONLY : gtsu => gtsu !: t-, s- and rd horizontal gradient at u- and 188 USE oce , ONLY : gtsv => gtsv !: 174 189 USE oce , ONLY : gru => gru !: 175 USE oce , ONLY : gtv => gtv !:176 USE oce , ONLY : gsv => gsv !:177 190 USE oce , ONLY : grv => grv !: 191 # if defined key_degrad 192 USE dommsk , ONLY : facvol => facvol !: volume factor for degradation 193 # endif 194 178 195 #endif 179 USE lib_mpp , ONLY : lk_mpp => lk_mpp !: Mpp flag180 181 USE dom_oce , ONLY : n _cla => n_cla!: flag (0/1) for cross land advection196 USE lib_mpp , ONLY : lk_mpp => lk_mpp !: Mpp flag 197 198 USE dom_oce , ONLY : nn_cla => nn_cla !: flag (0/1) for cross land advection 182 199 183 200 !* surface fluxes * … … 186 203 USE sbc_oce , ONLY : wndm => wndm !: 10m wind speed 187 204 USE sbc_oce , ONLY : qsr => qsr !: penetrative solar radiation (w m-2) 188 USE sbc_oce , ONLY : emp => emp !: evaporation minus precipitation (kg m-2 s-2) 189 USE sbc_oce , ONLY : emps => emps !: evaporation minus precipitation (kg m-2 s-2) 205 USE sbc_oce , ONLY : emp => emp !: freshwater budget: volume flux [Kg/m2/s] 206 USE sbc_oce , ONLY : emps => emps !: freshwater budget: concentration/dillution [Kg/m2/s] 207 USE sbc_oce , ONLY : rnf => rnf !: river runoff [Kg/m2/s] 208 USE sbc_oce , ONLY : ln_dm2dc => ln_dm2dc !: Daily mean to Diurnal Cycle short wave (qsr) 209 USE sbc_oce , ONLY : ln_rnf => ln_rnf !: runoffs / runoff mouths 190 210 USE sbc_oce , ONLY : fr_i => fr_i !: ice fraction (between 0 to 1) 191 211 USE traqsr , ONLY : rn_abs => rn_abs !: fraction absorbed in the very near surface 192 212 USE traqsr , ONLY : rn_si0 => rn_si0 !: very near surface depth of extinction 193 USE traqsr , ONLY : rn_si2 => rn_si2 !: deepest depth of extinction (blue & 0.01 mg.m-3) (RGB)194 213 USE traqsr , ONLY : ln_qsr_bio => ln_qsr_bio !: flag to use or not the biological fluxes for light 195 214 USE sbcrnf , ONLY : rnfmsk => rnfmsk !: mixed adv scheme in runoffs vicinity (hori.) 196 215 USE sbcrnf , ONLY : rnfmsk_z => rnfmsk_z !: mixed adv scheme in runoffs vicinity (vert.) 197 216 198 !* bottom boundary layer * 199 # if defined key_trabbl_dif || defined key_trabbl_adv 200 # if ! defined key_off_tra 201 USE trabbl , ONLY : atrbbl => rn_ahtbbl !: lateral coeff. for bottom boundary layer scheme (m2/s) 202 # else 203 USE trabbl, ONLY : bblx => bblx !: ??? 204 USE trabbl, ONLY : bbly => bbly !: ??? 205 # endif 206 # endif 217 USE trc_oce 207 218 208 219 !* lateral diffusivity (tracers) * … … 221 232 USE zdf_oce , ONLY : avt => avt !: vert. diffusivity coef. at w-point for temp 222 233 # if defined key_zdfddm 223 USE zdfddm , ONLY : avs => 234 USE zdfddm , ONLY : avs => avs !: salinity vertical diffusivity coeff. at w-point 224 235 # endif 225 236 … … 245 256 #endif 246 257 258 !!---------------------------------------------------------------------- 259 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 260 !! $Id$ 261 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 247 262 !!====================================================================== 248 263 END MODULE oce_trc -
trunk/NEMOGCM/NEMO/TOP_SRC/par_trc.F90
- Property svn:eol-style deleted
r2047 r2528 9 9 !! 1.0 ! 2004-03 (C. Ethe) Free form and module 10 10 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) revised architecture 11 !!----------------------------------------------------------------------12 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)13 !! $Id$14 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)15 11 !!---------------------------------------------------------------------- 16 12 USE par_kind ! kind parameters … … 39 35 LOGICAL, PUBLIC, PARAMETER :: lk_trc_c1d = .FALSE. !: 1D pass. tracer configuration flag 40 36 # endif 41 ! Passive tracers : size for TRP trends diagnotics (used if 'key_trc_diatrd' defined)42 # if defined key_trc_diatrd43 ! Passive tracers : size for TRP trends diagnotics (used if 'key_trc_diatrd' defined)44 INTEGER, PUBLIC, PARAMETER :: jptrc_xad = 1 !: x- horizontal advection45 INTEGER, PUBLIC, PARAMETER :: jptrc_yad = 2 !: y- horizontal advection46 INTEGER, PUBLIC, PARAMETER :: jptrc_zad = 3 !: z- vertical advection47 INTEGER, PUBLIC, PARAMETER :: jptrc_xdf = 4 !: lateral diffusion48 INTEGER, PUBLIC, PARAMETER :: jptrc_ydf = 5 !: lateral diffusion49 INTEGER, PUBLIC, PARAMETER :: jptrc_zdf = 6 !: vertical diffusion (Kz)50 INTEGER, PUBLIC, PARAMETER :: jptrc_sbc = 7 !: surface boundary condition51 #if ! defined key_trcldf_eiv && ! defined key_trcdmp52 INTEGER, PUBLIC, PARAMETER :: jpdiatrc = 7 !: trends: 3*(advection + diffusion ) + sbc53 #endif54 #if defined key_trcldf_eiv && defined key_trcdmp55 INTEGER, PUBLIC, PARAMETER :: jptrc_xei = 8 !: x- horiz. EIV advection56 INTEGER, PUBLIC, PARAMETER :: jptrc_yei = 9 !: y- horiz. EIV advection57 INTEGER, PUBLIC, PARAMETER :: jptrc_zei = 10 !: z- vert. EIV advection58 INTEGER, PUBLIC, PARAMETER :: jptrc_dmp = 11 !: damping59 INTEGER, PUBLIC, PARAMETER :: jpdiatrc = 11 !: trends: 3*(advection + diffusion + eiv ) + sbc + damping60 #endif61 #if defined key_trcldf_eiv && ! defined key_trcdmp62 INTEGER, PUBLIC, PARAMETER :: jptrc_xei = 8 !: x- horiz. EIV advection63 INTEGER, PUBLIC, PARAMETER :: jptrc_yei = 9 !: y- horiz. EIV advection64 INTEGER, PUBLIC, PARAMETER :: jptrc_zei = 10 !: z- vert. EIV advection65 INTEGER, PUBLIC, PARAMETER :: jpdiatrc = 10 !: trends: 3*(advection + diffusion + eiv ) + sbc66 #endif67 #if ! defined key_trcldf_eiv && defined key_trcdmp68 INTEGER, PUBLIC, PARAMETER :: jptrc_dmp = 8 !: damping69 INTEGER, PUBLIC, PARAMETER :: jpdiatrc = 8 !: trends: 3*(advection + diffusion ) + sbc + damping70 #endif71 #endif72 37 73 38 REAL(wp), PUBLIC :: rtrn = 1.e-15 !: truncation value 39 40 !!---------------------------------------------------------------------- 41 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 42 !! $Id$ 43 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 74 44 !!====================================================================== 75 45 END MODULE par_trc -
trunk/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90
- Property svn:eol-style deleted
r1581 r2528 35 35 PUBLIC prt_ctl_trc_info ! 36 36 PUBLIC prt_ctl_trc_init ! called by opa.F90 37 38 !!----------------------------------------------------------------------39 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)40 !! $Id$41 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)42 !!----------------------------------------------------------------------43 37 44 38 CONTAINS … … 466 460 !!---------------------------------------------------------------------- 467 461 #endif 468 469 !!====================================================================== 462 463 !!---------------------------------------------------------------------- 464 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 465 !! $Id$ 466 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 467 !!====================================================================== 470 468 END MODULE prtctl_trc -
trunk/NEMOGCM/NEMO/TOP_SRC/top_substitute.h90
r1146 r2528 2 2 !! *** top_substitute.h90 *** 3 3 !!---------------------------------------------------------------------- 4 !! ** purpose : Statement function file: to be include in all routines 5 !! concerning passive tracer model 4 !! ** purpose : Statement function file: to be include in all passive tracer modules 6 5 !!---------------------------------------------------------------------- 7 6 !! History : 1.0 ! 2004-03 (C. Ethe) Original code 8 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) new architecture 9 8 !!---------------------------------------------------------------------- 10 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007) 9 # include "domzgr_substitute.h90" 10 # include "ldfeiv_substitute.h90" 11 # include "ldftra_substitute.h90" 12 # include "vectopt_loop_substitute.h90" 13 !!---------------------------------------------------------------------- 14 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 11 15 !! $Id$ 12 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)16 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 13 17 !!---------------------------------------------------------------------- 14 15 ! Lateral eddy diffusivity coefficient for passive tracer:16 ! ========================================================17 #if defined key_traldf_c3d || defined key_off_degrad18 ! 'key_traldf_c3d' : aht: 3D coefficient19 # define fsahtrt(i,j,k) trcrat * ahtt(i,j,k)20 # define fsahtru(i,j,k) trcrat * ahtu(i,j,k)21 # define fsahtrv(i,j,k) trcrat * ahtv(i,j,k)22 # define fsahtrw(i,j,k) trcrat * ahtw(i,j,k)23 #elif defined key_traldf_c2d24 ! 'key_traldf_c2d' : aht: 2D coefficient25 # define fsahtrt(i,j,k) trcrat * ahtt(i,j)26 # define fsahtru(i,j,k) trcrat * ahtu(i,j)27 # define fsahtrv(i,j,k) trcrat * ahtv(i,j)28 # define fsahtrw(i,j,k) trcrat * ahtw(i,j)29 #elif defined key_traldf_c1d30 ! 'key_traldf_c1d' : aht: 1D coefficient31 # define fsahtrt(i,j,k) trcrat * ahtt(k)32 # define fsahtru(i,j,k) trcrat * ahtu(k)33 # define fsahtrv(i,j,k) trcrat * ahtv(k)34 # define fsahtrw(i,j,k) trcrat * ahtw(k)35 #else36 ! Default option : aht: Constant coefficient37 # define fsahtrt(i,j,k) ahtrc038 # define fsahtru(i,j,k) ahtrc039 # define fsahtrv(i,j,k) ahtrc040 # define fsahtrw(i,j,k) ahtrc041 #endif42 43 ! Eddy induced velocity coefficient for passive tracer:44 ! ========================================================45 #if defined key_traldf_c3d || defined key_off_degrad46 ! 'key_traldf_c3d' : eiv: 3D coefficient47 # define fsaeitru(i,j,k) trcrat * aeiu(i,j,k)48 # define fsaeitrv(i,j,k) trcrat * aeiv(i,j,k)49 # define fsaeitrw(i,j,k) trcrat * aeiw(i,j,k)50 #elif defined key_traldf_c2d51 ! 'key_traldf_c2d' : eiv: 2D coefficient52 # define fsaeitru(i,j,k) trcrat * aeiu(i,j)53 # define fsaeitrv(i,j,k) trcrat * aeiv(i,j)54 # define fsaeitrw(i,j,k) trcrat * aeiw(i,j)55 #elif defined key_traldf_c1d56 ! 'key_traldf_c1d' : eiv: 1D coefficient57 # define fsaeitru(i,j,k) trcrat * aeiu(k)58 # define fsaeitrv(i,j,k) trcrat * aeiv(k)59 # define fsaeitrw(i,j,k) trcrat * aeiw(k)60 #else61 ! Default option : eiv: Constant coefficient62 # define fsaeitru(i,j,k) aeiv063 # define fsaeitrv(i,j,k) aeiv064 # define fsaeitrw(i,j,k) aeiv065 #endif66 ! mixing for passive tracer:67 ! ========================================================68 #if defined key_trc_zdfddm69 ! 'key_trc_zdfddm' : avs70 # define fstravs(i,j,k) avs(i,j,k)71 #else72 ! Defautl option : avs = avt73 # define fstravs(i,j,k) avt(i,j,k)74 #endif75 76 ! ========================================================77 #include "domzgr_substitute.h90"78 #include "ldfeiv_substitute.h90"79 #include "ldftra_substitute.h90"80 #include "vectopt_loop_substitute.h90" -
trunk/NEMOGCM/NEMO/TOP_SRC/trc.F90
- Property svn:eol-style deleted
r1542 r2528 4 4 !! Passive tracers : module for tracers defined 5 5 !!====================================================================== 6 !! History : -! 1996-01 (M. Levy) Original code6 !! History : OPA ! 1996-01 (M. Levy) Original code 7 7 !! - ! 1999-07 (M. Levy) for LOBSTER1 or NPZD model 8 8 !! - ! 2000-04 (O. Aumont, M.A. Foujols) HAMOCC3 and P3ZD 9 !! 1.0 ! 2004-03 (C. Ethe) Free form and module 10 !!---------------------------------------------------------------------- 11 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 12 !! $Id$ 13 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 9 !! NEMO 1.0 ! 2004-03 (C. Ethe) Free form and module 14 10 !!---------------------------------------------------------------------- 15 11 #if defined key_top … … 34 30 INTEGER, PUBLIC :: numnat !: the number of the passive tracer NAMELIST 35 31 LOGICAL, PUBLIC, DIMENSION(jptra) :: lutini !: initialisation from FILE or not (NAMELIST) 36 LOGICAL, PUBLIC, DIMENSION(jptra) :: lutsav !: logical for saving tracer or not 37 INTEGER, PUBLIC, DIMENSION(jptra) :: nutini !: FORTRAN LOGICAL UNIT for initialisation file 32 LOGICAL, PUBLIC, DIMENSION(jptra) :: lutsav !: save the tracer or not 38 33 39 34 !! passive tracers fields (before,now,after) 40 35 !! -------------------------------------------------- 41 REAL(wp), PUBLIC :: trai !: initial total tracer42 REAL(wp), PUBLIC , DIMENSION (jpi,jpj,jpk) :: cvol !: masked grid volume43 REAL(wp), PUBLIC :: areatot !: total volume36 REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) :: cvol !: volume correction -degrad option- 37 REAL(wp), PUBLIC :: trai !: initial total tracer 38 REAL(wp), PUBLIC :: areatot !: total volume 44 39 45 40 REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) :: trn !: traceur concentration for actual time step … … 47 42 REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) :: trb !: traceur concentration for before time step 48 43 44 !! interpolated gradient 45 !!-------------------------------------------------- 46 REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jptra) :: gtru !: horizontal gradient at u-points at bottom ocean level 47 REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jptra) :: gtrv !: horizontal gradient at v-points at bottom ocean level 49 48 50 49 !! passive tracers restart (input and output) 51 50 !! ------------------------------------------ 52 INTEGER , PUBLIC :: ndttrc !: frequency of step on passive tracers 53 INTEGER , PUBLIC :: nittrc000 !: first time step of passive tracers model 54 LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) 55 LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write 56 INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart 57 INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers 58 INTEGER , PUBLIC :: nrsttr !: control of the time step ( 0 or 1 ) for pass. tr. 59 CHARACTER(len=50) :: cn_trcrst_in !: suffix of pass. tracer restart name (input) 60 CHARACTER(len=50) :: cn_trcrst_out !: suffix of pass. tracer restart name (output) 51 LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) 52 LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write 53 INTEGER , PUBLIC :: nn_dttrc !: frequency of step on passive tracers 54 INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart 55 INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers 56 INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. 57 CHARACTER(len=50), PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) 58 CHARACTER(len=50), PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) 61 59 62 60 !! information for outputs 63 61 !! -------------------------------------------------- 64 INTEGER , PUBLIC :: nwritetrc !: time step frequency for concentration outputs (namelist) 62 INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) 63 REAL(wp), PUBLIC, DIMENSION(jpk) :: rdttrc !: vertical profile of passive tracer time step 65 64 66 # if defined key_ trc_diaadd&& ! defined key_iomput65 # if defined key_diatrc && ! defined key_iomput 67 66 !! additional 2D/3D outputs namelist 68 67 !! -------------------------------------------------- 69 CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) :: ctrc2d !: 2d output field name 70 CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) :: ctrc2u !: 2d output field unit 71 CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) :: ctrc3d !: 3d output field name 72 CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) :: ctrc3u !: 3d output field unit 73 CHARACTER(len=80), PUBLIC, DIMENSION (jpdia2d) :: ctrc2l !: 2d output field long name 74 CHARACTER(len=80), PUBLIC, DIMENSION (jpdia3d) :: ctrc3l !: 3d output field long name 68 INTEGER , PUBLIC :: nwritedia !: frequency of additional arrays outputs(namelist) 69 CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) :: ctrc2d !: 2d output field name 70 CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) :: ctrc2u !: 2d output field unit 71 CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) :: ctrc3d !: 3d output field name 72 CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) :: ctrc3u !: 3d output field unit 73 CHARACTER(len=80), PUBLIC, DIMENSION (jpdia2d) :: ctrc2l !: 2d output field long name 74 CHARACTER(len=80), PUBLIC, DIMENSION (jpdia3d) :: ctrc3l !: 3d output field long name 75 75 76 REAL(wp), PUBLIC, DIMENSION (jpi,jpj, jpdia2d) :: trc2d !: additional 2d outputs77 REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jpdia3d) :: trc3d !: additional 3d outputs76 REAL(wp), PUBLIC, DIMENSION (jpi,jpj, jpdia2d) :: trc2d !: additional 2d outputs 77 REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jpdia3d) :: trc3d !: additional 3d outputs 78 78 79 INTEGER , PUBLIC :: nwritedia !: frequency of additional arrays outputs(namelist)80 79 # endif 81 80 82 #if defined key_trc_diabio || defined key_trdmld_trc 83 CHARACTER(len=8), DIMENSION(jpdiabio) :: ctrbio !: biological trends name (NAMELIST) 84 CHARACTER(len=20), DIMENSION(jpdiabio) :: ctrbiu !: biological trends unit (NAMELIST) 85 CHARACTER(len=80), DIMENSION(jpdiabio) :: ctrbil !: biological trends long name (NAMELIST) 86 INTEGER :: nwritebio !: time step frequency for biological outputs (NAMELIST) 81 #if defined key_diabio || defined key_trdmld_trc 82 ! !!* namtop_XXX namelist * 83 INTEGER , PUBLIC :: nwritebio !: time step frequency for biological outputs 84 CHARACTER(len=8 ), PUBLIC, DIMENSION(jpdiabio) :: ctrbio !: biological trends name 85 CHARACTER(len=20), PUBLIC, DIMENSION(jpdiabio) :: ctrbiu !: biological trends unit 86 CHARACTER(len=80), PUBLIC, DIMENSION(jpdiabio) :: ctrbil !: biological trends long name 87 87 #endif 88 # if defined key_ trc_diabio88 # if defined key_diabio 89 89 !! Biological trends 90 90 !! ----------------- 91 REAL(wp), DIMENSION(jpi,jpj,jpk,jpdiabio) :: trbio !: biological trends91 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk,jpdiabio) :: trbio !: biological trends 92 92 # endif 93 93 … … 105 105 #endif 106 106 107 !!---------------------------------------------------------------------- 108 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 109 !! $Id$ 110 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 107 111 !!====================================================================== 108 112 END MODULE trc -
trunk/NEMOGCM/NEMO/TOP_SRC/trcdia.F90
- Property svn:eol-style deleted
r2421 r2528 4 4 !! TOP : Output of passive tracers 5 5 !!====================================================================== 6 !! History : -! 1995-01 (M. Levy) Original code6 !! History : OPA ! 1995-01 (M. Levy) Original code 7 7 !! - ! 1998-01 (C. Levy) NETCDF format using ioipsl interface 8 8 !! - ! 1999-01 (M.A. Foujols) adapted for passive tracer 9 9 !! - ! 1999-09 (M.A. Foujols) split into three parts 10 !! 10 !! NEMO 1.0 ! 2005-03 (O. Aumont, A. El Moussaoui) F90 11 11 !! ! 2008-05 (C. Ethe re-organization) 12 12 !!---------------------------------------------------------------------- … … 17 17 !! trc_dia : main routine of output passive tracer 18 18 !! trcdit_wr : outputs of concentration fields 19 !! trcdid_wr : outputs of dvection-diffusion trends20 19 !! trcdii_wr : outputs of additional 2D/3D diagnostics 21 20 !! trcdib_wr : outputs of biological fields … … 24 23 USE oce_trc 25 24 USE trc 26 USE trp_trc27 25 USE par_trc 28 USE trdmld_trc_oce, ONLY : luttrd29 26 USE dianam ! build name of file (routine) 30 27 USE in_out_manager ! I/O manager … … 35 32 PRIVATE 36 33 37 PUBLIC trc_dia34 PUBLIC trc_dia ! called by XXX module 38 35 39 36 INTEGER :: nit5 !: id for tracer output file … … 45 42 INTEGER , DIMENSION (jpij*jpk) :: ndext50 !: integer arrays for ocean 3D index 46 43 INTEGER , DIMENSION (jpij) :: ndext51 !: integer arrays for ocean surface index 47 # if defined key_ trc_diaadd44 # if defined key_diatrc 48 45 INTEGER :: nitd !: id for additional array output file 49 46 INTEGER :: ndepitd !: id for depth mesh 50 47 INTEGER :: nhoritd !: id for horizontal mesh 51 48 # endif 52 # if defined key_trc_diatrd 53 INTEGER , DIMENSION (jptra) :: nit6 !: id for additional array output file 54 INTEGER , DIMENSION (jptra) :: ndepit6 !: id for depth mesh 55 INTEGER , DIMENSION (jptra) :: nhorit6 !: id for horizontal mesh 56 # endif 57 # if defined key_trc_diabio 49 # if defined key_diabio 58 50 INTEGER :: nitb !: id. for additional array output file 59 51 INTEGER :: ndepitb !: id for depth mesh … … 64 56 # include "top_substitute.h90" 65 57 !!---------------------------------------------------------------------- 66 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)58 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 67 59 !! $Id$ 68 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 69 !!---------------------------------------------------------------------- 70 60 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 61 !!---------------------------------------------------------------------- 71 62 CONTAINS 72 63 … … 80 71 INTEGER :: kindic 81 72 !!--------------------------------------------------------------------- 82 73 ! 83 74 CALL trcdit_wr( kt, kindic ) ! outputs for tracer concentration 84 CALL trcdid_wr( kt, kindic ) ! outputs for dynamical trends85 75 CALL trcdii_wr( kt, kindic ) ! outputs for additional arrays 86 76 CALL trcdib_wr( kt, kindic ) ! outputs for biological trends 87 88 77 ! 89 78 END SUBROUTINE trc_dia 79 90 80 91 81 SUBROUTINE trcdit_wr( kt, kindic ) … … 111 101 LOGICAL :: ll_print = .FALSE. 112 102 CHARACTER (len=40) :: clhstnam, clop 113 #if defined key_off_tra114 103 INTEGER :: inum = 11 ! temporary logical unit 115 #endif116 104 CHARACTER (len=20) :: cltra, cltrau 117 105 CHARACTER (len=80) :: cltral 118 106 REAL(wp) :: zsto, zout, zdt 119 INTEGER :: iimi, iima, ijmi, ijma, ipk, it, itmod 107 INTEGER :: iimi, iima, ijmi, ijma, ipk, it, itmod, iiter 120 108 !!---------------------------------------------------------------------- 121 109 … … 133 121 ENDIF 134 122 # if defined key_diainstant 135 zsto = n writetrc * rdt123 zsto = nn_writetrc * rdt 136 124 clop = "inst("//TRIM(clop)//")" 137 125 # else … … 139 127 clop = "ave("//TRIM(clop)//")" 140 128 # endif 141 zout = n writetrc * zdt129 zout = nn_writetrc * zdt 142 130 143 131 ! Define indices of the horizontal output zoom and vertical limit storage … … 147 135 148 136 ! define time axis 149 itmod = kt - nit trc000 + 1137 itmod = kt - nit000 + 1 150 138 it = kt 139 iiter = ( nit000 - 1 ) / nn_dttrc 151 140 152 141 ! Define NETCDF files and fields at beginning of first time step … … 155 144 IF(ll_print)WRITE(numout,*)'trcdit_wr kt=',kt,' kindic ',kindic 156 145 157 IF( kt == nit trc000 ) THEN146 IF( kt == nit000 ) THEN 158 147 159 148 ! Compute julian date from starting date of the run … … 161 150 zjulian = zjulian - adatrj ! set calendar origin to the beginning of the experiment 162 151 IF(lwp)WRITE(numout,*)' ' 163 IF(lwp)WRITE(numout,*)' Date 0 used :', nit trc000 &152 IF(lwp)WRITE(numout,*)' Date 0 used :', nit000 & 164 153 & ,' YEAR ', nyear, ' MONTH ', nmonth, ' DAY ', nday & 165 154 & ,'Julian day : ', zjulian … … 168 157 & ' limit storage in depth = ', ipk 169 158 170 #if defined key_off_tra 171 ! WRITE root name in date.file for use by postpro 172 IF(lwp) THEN 173 CALL dia_nam( clhstnam, nwritetrc,' ' ) 159 IF( lk_offline .AND. lwp ) THEN 160 CALL dia_nam( clhstnam, nn_writetrc,' ' ) 174 161 CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', 1, numout, lwp, narea ) 175 162 WRITE(inum,*) clhstnam 176 163 CLOSE(inum) 177 164 ENDIF 178 #endif179 165 180 166 ! Define the NETCDF files for passive tracer concentration 181 CALL dia_nam( clhstnam, n writetrc, 'ptrc_T' )167 CALL dia_nam( clhstnam, nn_writetrc, 'ptrc_T' ) 182 168 IF(lwp)WRITE(numout,*)" Name of NETCDF file ", clhstnam 183 169 … … 185 171 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & 186 172 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 187 & nittrc000-ndttrc, zjulian, zdt, nhorit5, nit5 , domain_id=nidom)173 & iiter, zjulian, zdt, nhorit5, nit5 , domain_id=nidom, snc4chunks=snc4set) 188 174 189 175 ! Vertical grid for tracer : gdept … … 206 192 207 193 ! end netcdf files header 208 CALL histend( nit5 )194 CALL histend( nit5, snc4set ) 209 195 IF(lwp) WRITE(numout,*) 210 196 IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization in trcdit_wr' … … 216 202 ! --------------------------------------- 217 203 218 IF( lwp .AND. MOD( itmod, n writetrc ) == 0 ) THEN204 IF( lwp .AND. MOD( itmod, nn_writetrc ) == 0 ) THEN 219 205 WRITE(numout,*) 'trcdit_wr : write NetCDF passive tracer concentrations at ', kt, 'time-step' 220 206 WRITE(numout,*) '~~~~~~~~~ ' … … 233 219 END SUBROUTINE trcdit_wr 234 220 235 # if defined key_trc_diatrd 236 237 SUBROUTINE trcdid_wr( kt, kindic ) 238 !!---------------------------------------------------------------------- 239 !! *** ROUTINE trcdid_wr *** 240 !! 241 !! ** Purpose : output of passive tracer : advection-diffusion trends 242 !! 243 !! ** Method : At the beginning of the first time step (nit000), define all 244 !! the NETCDF files and fields for concentration of passive tracer 245 !! 246 !! At each time step call histdef to compute the mean if necessary 247 !! Each nwritetrd time step, output the instantaneous or mean fields 248 !! 249 !! IF kindic <0, output of fields before the model interruption. 250 !! IF kindic =0, time step loop 251 !! IF kindic >0, output of fields before the time step loop 252 !!---------------------------------------------------------------------- 253 INTEGER, INTENT( in ) :: kt ! ocean time-step 254 INTEGER, INTENT( in ) :: kindic ! indicator of abnormal termination 255 !! 256 LOGICAL :: ll_print = .FALSE. 257 CHARACTER (len=40) :: clhstnam, clop 258 CHARACTER (len=20) :: cltra, cltrau 259 CHARACTER (len=80) :: cltral 260 CHARACTER (len=10) :: csuff 261 INTEGER :: jn, jl, ikn 262 INTEGER :: iimi, iima, ijmi, ijma, ipk, it, itmod 263 REAL(wp) :: zsto, zout, zdt 264 !!---------------------------------------------------------------------- 265 266 ! 0. Initialisation 267 ! ----------------- 268 269 270 ! local variable for debugging 271 ll_print = .FALSE. 272 ll_print = ll_print .AND. lwp 273 ! 274 ! Define frequency of output and means 275 zdt = rdt 276 IF( ln_mskland ) THEN ; clop = "only(x)" ! put 1.e+20 on land (very expensive!!) 277 ELSE ; clop = "x" ! no use of the mask value (require less cpu time) 278 ENDIF 279 # if defined key_diainstant 280 zsto = nwritetrd * rdt 281 clop = "inst("//TRIM(clop)//")" 282 # else 283 zsto = zdt 284 clop = "ave("//TRIM(clop)//")" 285 # endif 286 zout = nwritetrd * zdt 287 288 ! Define indices of the horizontal output zoom and vertical limit storage 289 iimi = 1 ; iima = jpi 290 ijmi = 1 ; ijma = jpj 291 ipk = jpk 292 293 ! define time axis 294 itmod = kt - nittrc000 + 1 295 it = kt 296 297 ! Define the NETCDF files (one per tracer) 298 IF( ll_print ) WRITE(numout,*) 'trcdid kt=', kt, ' kindic ', kindic 299 300 301 IF( kt == nittrc000 ) THEN 302 303 DO jn = 1, jptra 304 ! 305 IF( luttrd(jn) ) THEN ! Define the file for dynamical trends - one per each tracer IF required 306 307 IF(lwp)WRITE(numout,*) ' indexes of zoom = ', iimi, iima, ijmi, ijma, & 308 & ' limit storage in depth = ', ipk 309 csuff='DY_'//ctrcnm(jn) 310 CALL dia_nam( clhstnam, nwritetrd, csuff ) 311 IF(lwp)WRITE(numout,*) " Name of NETCDF file for dynamical trends", & 312 & " of tracer number : ",clhstnam 313 314 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & 315 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 316 & nittrc000-ndttrc, zjulian, zdt, nhorit6(jn), & 317 & nit6(jn) , domain_id=nidom ) 318 319 ! Vertical grid for tracer trend - one per each tracer IF needed 320 CALL histvert( nit6(jn), 'deptht', 'Vertical T levels', 'm', ipk, gdept_0, ndepit6(jn) ) 321 END IF 322 END DO 323 324 ! Declare all the output fields as NETCDF variables 325 DO jn = 1, jptra 326 IF( luttrd(jn) ) THEN 327 DO jl = 1, jpdiatrc 328 IF( jl == jptrc_xad ) THEN 329 ! short and long title for x advection for tracer 330 WRITE (cltra,'("XAD_",16a)') ctrcnm(jn) 331 WRITE (cltral,'("X advective trend for ",58a)') ctrcnl(jn)(1:58) 332 END IF 333 IF( jl == jptrc_yad ) THEN 334 ! short and long title for y advection for tracer 335 WRITE (cltra,'("YAD_",16a)') ctrcnm(jn) 336 WRITE (cltral,'("Y advective trend for ",58a)') ctrcnl(jn)(1:58) 337 END IF 338 IF( jl == jptrc_zad ) THEN 339 ! short and long title for Z advection for tracer 340 WRITE (cltra,'("ZAD_",16a)') ctrcnm(jn) 341 WRITE (cltral,'("Z advective trend for ",58a)') ctrcnl(jn)(1:58) 342 END IF 343 IF( jl == jptrc_xdf ) THEN 344 ! short and long title for X diffusion for tracer 345 WRITE (cltra,'("XDF_",16a)') ctrcnm(jn) 346 WRITE (cltral,'("X diffusion trend for ",58a)') ctrcnl(jn)(1:58) 347 END IF 348 IF( jl == jptrc_ydf ) THEN 349 ! short and long title for Y diffusion for tracer 350 WRITE (cltra,'("YDF_",16a)') ctrcnm(jn) 351 WRITE (cltral,'("Y diffusion trend for ",58a)') ctrcnl(jn)(1:58) 352 END IF 353 IF( jl == jptrc_zdf ) THEN 354 ! short and long title for Z diffusion for tracer 355 WRITE (cltra,'("ZDF_",16a)') ctrcnm(jn) 356 WRITE (cltral,'("Z diffusion trend for ",58a)') ctrcnl(jn)(1:58) 357 END IF 358 # if defined key_trcldf_eiv 359 IF( jl == jptrc_xei ) THEN 360 ! short and long title for x gent velocity for tracer 361 WRITE (cltra,'("XGV_",16a)') ctrcnm(jn) 362 WRITE (cltral,'("X gent velocity trend for ",53a)') ctrcnl(jn)(1:53) 363 END IF 364 IF( jl == jptrc_yei ) THEN 365 ! short and long title for y gent velocity for tracer 366 WRITE (cltra,'("YGV_",16a)') ctrcnm(jn) 367 WRITE (cltral,'("Y gent velocity trend for ",53a)') ctrcnl(jn)(1:53) 368 END IF 369 IF( jl == jptrc_zei ) THEN 370 ! short and long title for Z gent velocity for tracer 371 WRITE (cltra,'("ZGV_",16a)') ctrcnm(jn) 372 WRITE (cltral,'("Z gent velocity trend for ",53a)') ctrcnl(jn)(1:53) 373 END IF 374 # endif 375 # if defined key_trcdmp 376 IF( jl == jptrc_dmp ) THEN 377 ! last trends for tracer damping : short and long title 378 WRITE (cltra,'("TDM_",16a)') ctrcnm(jn) 379 WRITE (cltral,'("Tracer damping trend for ",55a)') ctrcnl(jn)(1:55) 380 END IF 381 # endif 382 IF( jl == jptrc_sbc ) THEN 383 ! last trends for tracer damping : short and long title 384 WRITE (cltra,'("SBC_",16a)') ctrcnm(jn) 385 WRITE (cltral,'("Surface boundary flux ",58a)') ctrcnl(jn)(1:55) 386 END IF 387 WRITE (cltral,'("Surface boundary flux ",58a)') ctrcnl(jn)(1:55) 388 END IF 389 CALL FLUSH( numout ) 390 cltrau = ctrcun(jn) ! UNIT for tracer /trends 391 CALL histdef( nit6(jn), cltra, cltral, cltrau, jpi,jpj, & 392 & nhorit6(jn), ipk, 1, ipk, ndepit6(jn), 32, clop , & 393 & zsto,zout ) 394 END DO 395 END IF 396 END DO 397 ! CLOSE netcdf Files 398 DO jn = 1, jptra 399 IF( luttrd(jn) ) CALL histend( nit6(jn) ) 400 END DO 401 402 IF(lwp) WRITE(numout,*) 403 IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization in trcdid' 404 IF(ll_print) CALL FLUSH(numout ) 405 ! 406 ENDIF 407 408 ! SOME diagnostics to DO first time 409 410 ! Start writing data 411 ! --------------------- 412 413 ! trends for tracer concentrations 414 415 IF( lwp .AND. MOD( itmod, nwritetrd ) == 0 ) THEN 416 WRITE(numout,*) 'trcdid_wr : write NetCDF dynamical trends at ', kt, 'time-step' 417 WRITE(numout,*) '~~~~~~ ' 418 ENDIF 419 420 DO jn = 1, jptra 421 IF( luttrd(jn) ) THEN 422 ikn = ikeep(jn) 423 DO jl = 1, jpdiatrc 424 ! short titles 425 IF( jl == jptrc_xad) WRITE (cltra,'("XAD_",16a)') ctrcnm(jn) 426 IF( jl == jptrc_yad) WRITE (cltra,'("YAD_",16a)') ctrcnm(jn) 427 IF( jl == jptrc_zad) WRITE (cltra,'("ZAD_",16a)') ctrcnm(jn) 428 IF( jl == jptrc_xdf) WRITE (cltra,'("XDF_",16a)') ctrcnm(jn) 429 IF( jl == jptrc_ydf) WRITE (cltra,'("YDF_",16a)') ctrcnm(jn) 430 IF( jl == jptrc_zdf) WRITE (cltra,'("ZDF_",16a)') ctrcnm(jn) 431 # if defined key_trcldf_eiv 432 IF( jl == jptrc_xei) WRITE (cltra,'("XGV_",16a)') ctrcnm(jn) 433 IF( jl == jptrc_yei) WRITE (cltra,'("YGV_",16a)') ctrcnm(jn) 434 IF( jl == jptrc_zei) WRITE (cltra,'("ZGV_",16a)') ctrcnm(jn) 435 # endif 436 # if defined key_trcdmp 437 IF( jl == jptrc_dmp ) WRITE (cltra,'("TDM_",16a)') ctrcnm(jn) 438 # endif 439 IF( jl == jptrc_sbc ) WRITE (cltra,'("SBC_",16a)') ctrcnm(jn) 440 ! 441 CALL histwrite(nit6(jn), cltra, it, trtrd(:,:,:,ikn,jl),ndimt50, ndext50) 442 END DO 443 END IF 444 END DO 445 446 ! Closing all files 447 ! ----------------- 448 IF( kt == nitend .OR. kindic < 0 ) THEN 449 DO jn = 1, jptra 450 IF( luttrd(jn) ) CALL histclo( nit6(jn) ) 451 END DO 452 ENDIF 453 ! 454 455 END SUBROUTINE trcdid_wr 456 457 # else 458 459 SUBROUTINE trcdid_wr( kt, kindic ) ! Dummy routine 460 INTEGER, INTENT ( in ) :: kt, kindic 461 END SUBROUTINE trcdid_wr 462 463 # endif 464 465 #if defined key_trc_diaadd 221 #if defined key_diatrc 466 222 467 223 SUBROUTINE trcdii_wr( kt, kindic ) … … 489 245 CHARACTER (len=80) :: cltral 490 246 INTEGER :: jl 491 INTEGER :: iimi, iima, ijmi, ijma, ipk, it, itmod 247 INTEGER :: iimi, iima, ijmi, ijma, ipk, it, itmod, iiter 492 248 REAL(wp) :: zsto, zout, zdt 493 249 !!---------------------------------------------------------------------- … … 506 262 ENDIF 507 263 # if defined key_diainstant 508 zsto = n writedia * zdt264 zsto = nn_writedia * zdt 509 265 clop = "inst("//TRIM(clop)//")" 510 266 # else … … 512 268 clop = "ave("//TRIM(clop)//")" 513 269 # endif 514 zout = n writedia * zdt270 zout = nn_writedia * zdt 515 271 516 272 ! Define indices of the horizontal output zoom and vertical limit storage … … 520 276 521 277 ! define time axis 522 itmod = kt - nit trc000 + 1278 itmod = kt - nit000 + 1 523 279 it = kt 280 iiter = ( nit000 - 1 ) / nn_dttrc 524 281 525 282 ! 1. Define NETCDF files and fields at beginning of first time step … … 528 285 IF( ll_print ) WRITE(numout,*) 'trcdii_wr kt=', kt, ' kindic ', kindic 529 286 530 IF( kt == nit trc000 ) THEN287 IF( kt == nit000 ) THEN 531 288 532 289 ! Define the NETCDF files for additional arrays : 2D or 3D … … 534 291 ! Define the T grid file for tracer auxiliary files 535 292 536 CALL dia_nam( clhstnam, n writedia, 'diad_T' )293 CALL dia_nam( clhstnam, nn_writedia, 'diad_T' ) 537 294 IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam 538 295 … … 541 298 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & 542 299 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 543 & nittrc000-ndttrc, zjulian, zdt, nhoritd, nitd , domain_id=nidom)300 & iiter, zjulian, zdt, nhoritd, nitd , domain_id=nidom, snc4chunks=snc4set ) 544 301 545 302 ! Vertical grid for 2d and 3d arrays … … 570 327 571 328 ! CLOSE netcdf Files 572 CALL histend( nitd )329 CALL histend( nitd, snc4set ) 573 330 574 331 IF(lwp) WRITE(numout,*) … … 581 338 ! --------------------- 582 339 583 IF( lwp .AND. MOD( itmod, n writedia ) == 0 ) THEN340 IF( lwp .AND. MOD( itmod, nn_writedia ) == 0 ) THEN 584 341 WRITE(numout,*) 'trcdii_wr : write NetCDF additional arrays at ', kt, 'time-step' 585 342 WRITE(numout,*) '~~~~~~ ' … … 606 363 607 364 # else 608 609 365 SUBROUTINE trcdii_wr( kt, kindic ) ! Dummy routine 610 366 INTEGER, INTENT ( in ) :: kt, kindic 611 367 END SUBROUTINE trcdii_wr 612 613 368 # endif 614 369 615 # if defined key_ trc_diabio370 # if defined key_diabio 616 371 617 372 SUBROUTINE trcdib_wr( kt, kindic ) … … 631 386 !! IF kindic >0, output of fields before the time step loop 632 387 !!---------------------------------------------------------------------- 633 !!634 388 INTEGER, INTENT( in ) :: kt ! ocean time-step 635 389 INTEGER, INTENT( in ) :: kindic ! indicator of abnormal termination … … 640 394 CHARACTER (len=80) :: cltral 641 395 INTEGER :: ji, jj, jk, jl 642 INTEGER :: iimi, iima, ijmi, ijma, ipk, it, itmod 396 INTEGER :: iimi, iima, ijmi, ijma, ipk, it, itmod, iiter 643 397 REAL(wp) :: zsto, zout, zdt 644 398 !!---------------------------------------------------------------------- … … 658 412 ENDIF 659 413 # if defined key_diainstant 660 zsto = n writebio * zdt414 zsto = nn_writebio * zdt 661 415 clop = "inst("//TRIM(clop)//")" 662 416 # else … … 664 418 clop = "ave("//TRIM(clop)//")" 665 419 # endif 666 zout = n writebio * zdt420 zout = nn_writebio * zdt 667 421 668 422 ! Define indices of the horizontal output zoom and vertical limit storage … … 672 426 673 427 ! define time axis 674 itmod = kt - nit trc000 + 1428 itmod = kt - nit000 + 1 675 429 it = kt 430 iiter = ( nit000 - 1 ) / nn_dttrc 676 431 677 432 ! Define NETCDF files and fields at beginning of first time step … … 680 435 IF(ll_print) WRITE(numout,*)'trcdib_wr kt=',kt,' kindic ',kindic 681 436 682 IF( kt == nit trc000 ) THEN437 IF( kt == nit000 ) THEN 683 438 684 439 ! Define the NETCDF files for biological trends 685 440 686 CALL dia_nam(clhstnam,n writebio,'biolog')441 CALL dia_nam(clhstnam,nn_writebio,'biolog') 687 442 IF(lwp)WRITE(numout,*) " Name of NETCDF file for biological trends ", clhstnam 688 443 ! Horizontal grid : glamt and gphit 689 444 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & 690 445 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 691 & nittrc000-ndttrc, zjulian, zdt, nhoritb, nitb , domain_id=nidom)446 & iiter, zjulian, zdt, nhoritb, nitb , domain_id=nidom, snc4chunks=snc4set ) 692 447 ! Vertical grid for biological trends 693 448 CALL histvert(nitb, 'deptht', 'Vertical T levels', 'm', ipk, gdept_0, ndepitb) … … 704 459 705 460 ! CLOSE netcdf Files 706 CALL histend( nitb )461 CALL histend( nitb, snc4set ) 707 462 708 463 IF(lwp) WRITE(numout,*) … … 716 471 717 472 ! biological trends 718 IF( lwp .AND. MOD( itmod, n writebio ) == 0 ) THEN473 IF( lwp .AND. MOD( itmod, nn_writebio ) == 0 ) THEN 719 474 WRITE(numout,*) 'trcdit_wr : write NetCDF biological trends at ', kt, 'time-step' 720 475 WRITE(numout,*) '~~~~~~ ' … … 749 504 INTEGER, INTENT(in) :: kt 750 505 END SUBROUTINE trc_dia 751 752 506 #endif 753 507 -
trunk/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
- Property svn:eol-style deleted
r1801 r2528 36 36 # include "top_substitute.h90" 37 37 !!---------------------------------------------------------------------- 38 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)38 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 39 39 !! $Id$ 40 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 41 !!---------------------------------------------------------------------- 42 40 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 41 !!---------------------------------------------------------------------- 43 42 CONTAINS 44 43 45 !!----------------------------------------------------------------------46 !! Default case NetCDF file47 !!----------------------------------------------------------------------48 49 44 SUBROUTINE trc_dta( kt ) 50 45 !!---------------------------------------------------------------------- … … 63 58 !! 64 59 CHARACTER (len=39) :: clname(jptra) 65 INTEGER, PARAMETER :: & 66 jpmonth = 12 ! number of months 60 INTEGER, PARAMETER :: jpmonth = 12 ! number of months 67 61 INTEGER :: ji, jj, jn, jl 68 62 INTEGER :: imois, iman, i15, ik ! temporary integers 69 63 REAL(wp) :: zxy, zl 64 !!gm HERE the daymod should be used instead of computation of month and co !! 65 !!gm better in case of real calandar and leap-years ! 70 66 !!---------------------------------------------------------------------- 71 67 … … 74 70 IF( lutini(jn) ) THEN 75 71 76 IF ( kt == nit trc000 ) THEN72 IF ( kt == nit000 ) THEN 77 73 !! 3D tracer data 78 74 IF(lwp)WRITE(numout,*) … … 92 88 ! -------------------- 93 89 94 IF ( kt == nit trc000 .AND. nlectr(jn) == 0 ) THEN90 IF ( kt == nit000 .AND. nlectr(jn) == 0 ) THEN 95 91 ntrc1(jn) = 0 96 92 IF(lwp) WRITE(numout,*) ' trc_dta : Levitus tracer data monthly fields' … … 107 103 # if defined key_pisces 108 104 ! Read montly file 109 IF( ( kt == nit trc000 .AND. nlectr(jn) == 0) .OR. imois /= ntrc1(jn) ) THEN105 IF( ( kt == nit000 .AND. nlectr(jn) == 0) .OR. imois /= ntrc1(jn) ) THEN 110 106 nlectr(jn) = 1 111 107 … … 142 138 DO jj = 1, jpj ! interpolation of temperature at the last level 143 139 DO ji = 1, jpi 144 ik = mb athy(ji,jj) - 1140 ik = mbkt(ji,jj) 145 141 IF( ik > 2 ) THEN 146 142 zl = ( gdept_0(ik) - fsdept_0(ji,jj,ik) ) / ( gdept_0(ik) - gdept_0(ik-1) ) … … 189 185 # else 190 186 ! Read init file only 191 IF( kt == nit trc000 ) THEN187 IF( kt == nit000 ) THEN 192 188 ntrc1(jn) = 1 193 189 CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), trdta(:,:,:,jn), ntrc1(jn) ) … … 196 192 ENDIF 197 193 # endif 198 199 194 ENDIF 200 195 -
trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90
- Property svn:eol-style deleted
r1836 r2528 14 14 !!---------------------------------------------------------------------- 15 15 !!---------------------------------------------------------------------- 16 !! trc_ini : Initialization for passive tracer16 !! trc_init : Initialization for passive tracer 17 17 !!---------------------------------------------------------------------- 18 18 USE oce_trc 19 19 USE trc 20 USE trp_trc21 20 USE trcrst 22 USE trcctl 23 USE trclec 21 USE trcnam ! Namelist read 24 22 USE trcini_cfc ! CFC initialisation 25 23 USE trcini_lobster ! LOBSTER initialisation … … 28 26 USE trcini_my_trc ! MY_TRC initialisation 29 27 USE trcdta 30 #if defined key_off _tra28 #if defined key_offline 31 29 USE daymod 32 30 #endif 33 USE zpshde _trc ! partial step: hor. derivative31 USE zpshde ! partial step: hor. derivative (zps_hde routine) 34 32 USE in_out_manager ! I/O manager 35 33 USE prtctl_trc ! Print control passive tracers (prt_ctl_trc_init routine) 36 34 USE lib_mpp ! distributed memory computing library 35 USE lib_fortran ! 37 36 38 37 IMPLICIT NONE 39 38 PRIVATE 40 39 41 PUBLIC trc_ini ! called by opa40 PUBLIC trc_init ! called by opa 42 41 43 42 !! * Substitutions 44 43 # include "domzgr_substitute.h90" 45 !!----------------------------------------------------------------------46 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)47 !! $Id$48 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)49 !!----------------------------------------------------------------------50 44 51 45 CONTAINS 52 46 53 SUBROUTINE trc_ini 47 SUBROUTINE trc_init 54 48 !!--------------------------------------------------------------------- 55 !! *** ROUTINE trc_ini ***49 !! *** ROUTINE trc_init *** 56 50 !! 57 51 !! ** Purpose : Initialization of the passive tracer fields … … 69 63 70 64 IF(lwp) WRITE(numout,*) 71 IF(lwp) WRITE(numout,*) 'trc_ini : initial set up of the passive tracers'65 IF(lwp) WRITE(numout,*) 'trc_init : initial set up of the passive tracers' 72 66 IF(lwp) WRITE(numout,*) '~~~~~~~' 73 67 74 68 ! ! masked grid volume 75 69 DO jk = 1, jpk 76 cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)70 cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) 77 71 END DO 78 72 79 73 ! total volume of the ocean 80 #if ! defined key_ off_degrad81 areatot = SUM( cvol(:,:,:) )74 #if ! defined key_degrad 75 areatot = glob_sum( cvol(:,:,:) ) 82 76 #else 83 areatot = SUM( cvol(:,:,:) * facvol(:,:,:) )! degrad option: reduction by facvol77 areatot = glob_sum( cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol 84 78 #endif 85 IF( lk_mpp ) CALL mpp_sum( areatot ) ! sum over the global domain86 79 87 CALL trc_ lec ! READpassive tracers namelists80 CALL trc_nam ! read passive tracers namelists 88 81 89 CALL trc_ctl ! control consistency between parameters, cpp key 82 ! restart for passive tracer (input) 83 IF( ln_rsttr ) THEN 84 IF(lwp) WRITE(numout,*) ' read a restart file for passive tracer : ', cn_trcrst_in 85 IF(lwp) WRITE(numout,*) ' ' 86 ELSE 87 IF(lwp) WRITE(numout,*) 88 DO jn = 1, jptra 89 IF( lwp .AND. lutini(jn) ) & ! open input FILE only IF lutini(jn) is true 90 & WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' traceur : ', ctrcnm(jn) 91 END DO 92 ENDIF 93 94 IF( ln_dm2dc .AND. ( lk_pisces .OR. lk_lobster ) ) & 95 & CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES or LOBSTER ' ) 96 97 IF( nn_cla == 1 ) & 98 & CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' ) 90 99 91 100 IF( lk_lobster ) THEN ; CALL trc_ini_lobster ! LOBSTER bio-model … … 109 118 ENDIF 110 119 111 IF( .NOT. ln_rsttr ) THEN 112 #if defined key_off_tra 113 CALL day_init ! calendar 114 #endif 115 # if defined key_dtatrc 116 ! Initialization of tracer from a file that may also be used for damping 117 CALL trc_dta( nittrc000 ) 118 DO jn = 1, jptra 119 IF( lutini(jn) ) trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:) ! initialisation from file if required 120 END DO 121 # endif 122 trb(:,:,:,:) = trn(:,:,:,:) 120 IF( ln_rsttr ) THEN 121 ! 122 IF( lk_offline ) neuler = 1 ! Set time-step indicator at nit000 (leap-frog) 123 CALL trc_rst_read ! restart from a file 124 ! 123 125 ELSE 124 ! 125 CALL trc_rst_read ! restart from a file 126 ! 126 IF( lk_offline ) THEN 127 neuler = 0 ! Set time-step indicator at nit000 (euler) 128 CALL day_init ! set calendar 129 ENDIF 130 IF( lk_dtatrc ) THEN 131 CALL trc_dta( nit000 ) ! Initialization of tracer from a file that may also be used for damping 132 DO jn = 1, jptra 133 IF( lutini(jn) ) trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:) ! initialisation from file if required 134 END DO 135 ENDIF 136 trb(:,:,:,:) = trn(:,:,:,:) 137 ! 127 138 ENDIF 128 139 129 140 tra(:,:,:,:) = 0. 130 141 131 IF( ln_zps .AND. .NOT. lk_ trc_c1d ) & ! Partial steps: before horizontal gradient of passive132 & CALL zps_hde _trc( nittrc000, trb, gtru, gtrv ) ! tracers at the bottom ocean level142 IF( ln_zps .AND. .NOT. lk_c1d ) & ! Partial steps: before horizontal gradient of passive 143 & CALL zps_hde( nit000, jptra, trn, gtru, gtrv ) ! tracers at the bottom ocean level 133 144 134 145 … … 136 147 trai = 0.e0 137 148 DO jn = 1, jptra 138 #if ! defined key_ off_degrad139 trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) )149 #if ! defined key_degrad 150 trai = trai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 140 151 #else 141 trai = trai + SUM( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol152 trai = trai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol 142 153 #endif 143 154 END DO 144 IF( lk_mpp ) CALL mpp_sum( trai ) ! sum over the global domain145 146 155 147 156 ! ! control print … … 162 171 ENDIF 163 172 164 END SUBROUTINE trc_ini 173 END SUBROUTINE trc_init 165 174 166 175 #else … … 169 178 !!---------------------------------------------------------------------- 170 179 CONTAINS 171 SUBROUTINE trc_ini ! Dummy routine172 END SUBROUTINE trc_ini 180 SUBROUTINE trc_init ! Dummy routine 181 END SUBROUTINE trc_init 173 182 #endif 174 183 184 !!---------------------------------------------------------------------- 185 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 186 !! $Id$ 187 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 175 188 !!====================================================================== 176 189 END MODULE trcini -
trunk/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
- Property svn:eol-style deleted
r1836 r2528 25 25 USE oce_trc 26 26 USE trc 27 USE trc trp_lec27 USE trcnam_trp 28 28 USE lib_mpp 29 USE lib_fortran 29 30 USE iom 30 31 USE trcrst_cfc ! CFC … … 33 34 USE trcrst_c14b ! C14 bomb restart 34 35 USE trcrst_my_trc ! MY_TRC restart 35 #if defined key_off_tra 36 USE daymod 37 #endif 36 USE daymod 38 37 IMPLICIT NONE 39 38 PRIVATE … … 47 46 !! * Substitutions 48 47 # include "top_substitute.h90" 49 !!----------------------------------------------------------------------50 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)51 !! $Id$52 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)53 !!----------------------------------------------------------------------54 48 55 49 CONTAINS … … 67 61 !!---------------------------------------------------------------------- 68 62 ! 69 # if ! defined key_off_tra 70 IF( kt == nit000 ) lrst_trc = .FALSE. 71 # else 72 IF( kt == nit000 ) THEN 73 lrst_trc = .FALSE. 74 nitrst = nitend 75 ENDIF 76 77 IF( MOD( kt - 1, nstock ) == 0 ) THEN 78 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 79 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing 80 IF( nitrst > nitend ) nitrst = nitend ! make sure we write a restart at the end of the run 81 ENDIF 82 # endif 83 ! to get better performances with NetCDF format: 84 ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*ndttrc + 1) 85 ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*ndttrc + 1 86 IF( kt == nitrst - 2*ndttrc + 1 .OR. nstock == ndttrc .OR. ( kt == nitend - ndttrc + 1 .AND. .NOT. lrst_trc ) ) THEN 63 IF( lk_offline ) THEN 64 IF( kt == nit000 ) THEN 65 lrst_trc = .FALSE. 66 nitrst = nitend 67 ENDIF 68 69 IF( MOD( kt - 1, nstock ) == 0 ) THEN 70 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 71 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing 72 IF( nitrst > nitend ) nitrst = nitend ! make sure we write a restart at the end of the run 73 ENDIF 74 ELSE 75 IF( kt == nit000 ) lrst_trc = .FALSE. 76 ENDIF 77 78 ! to get better performances with NetCDF format: 79 ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 80 ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*nn_dttrc + 1 81 IF( kt == nitrst - 2*nn_dttrc + 1 .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc + 1 .AND. .NOT. lrst_trc ) ) THEN 87 82 ! beware of the format used to write kt (default is i8.8, that should be large enough) 88 83 IF( nitrst > 1.0e9 ) THEN ; WRITE(clkt,* ) nitrst … … 106 101 !!---------------------------------------------------------------------- 107 102 INTEGER :: jn 108 INTEGER :: iarak0109 REAL(wp) :: zarak0110 103 INTEGER :: jlibalt = jprstlib 111 104 LOGICAL :: llok … … 128 121 ! Time domain : restart 129 122 ! --------------------- 130 CALL trc_rst_cal( nittrc000, 'READ' ) ! calendar 131 132 IF( ln_trcadv_cen2 .OR. ln_trcadv_tvd ) THEN ; iarak0 = 1 133 ELSE ; iarak0 = 0 134 ENDIF 135 CALL iom_get( numrtr, 'arak0', zarak0 ) 136 137 IF( iarak0 /= NINT( zarak0 ) ) & ! Control of the scheme 138 & CALL ctl_stop( ' ===>>>> : problem with advection scheme', & 139 & ' it must be the same type for both restart and previous run', & 140 & ' centered or euler ' ) 141 IF(lwp) WRITE(numout,*) 142 IF(lwp) WRITE(numout,*) ' arakawa option : ', NINT( zarak0 ) 123 CALL trc_rst_cal( nit000, 'READ' ) ! calendar 143 124 144 125 ! READ prognostic variables and computes diagnostic variable … … 175 156 176 157 CALL trc_rst_cal( kt, 'WRITE' ) ! calendar 177 178 IF( ln_trcadv_cen2 .OR. ln_trcadv_tvd ) THEN ; zarak0 = 1. 179 ELSE ; zarak0 = 0. 180 ENDIF 181 CALL iom_rstput( kt, nitrst, numrtw, 'arak0', zarak0 ) 182 158 CALL iom_rstput( kt, nitrst, numrtw, 'rdttrc1', rdttrc(1) ) ! surface passive tracer time step 183 159 ! prognostic variables 184 160 ! -------------------- … … 222 198 !! 223 199 !! According to namelist parameter nrstdt, 224 !! n rsttr = 0 no control on the date (nittrc000 is arbitrary).225 !! n rsttr = 1 we verify that nit000 is equal to the last200 !! nn_rsttr = 0 no control on the date (nit000 is arbitrary). 201 !! nn_rsttr = 1 we verify that nit000 is equal to the last 226 202 !! time step of previous run + 1. 227 203 !! In both those options, the exact duration of the experiment … … 230 206 !! This is valid is the time step has remained constant. 231 207 !! 232 !! n rsttr = 2 the duration of the experiment in days (adatrj)208 !! nn_rsttr = 2 the duration of the experiment in days (adatrj) 233 209 !! has been stored in the restart file. 234 210 !!---------------------------------------------------------------------- … … 236 212 CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag 237 213 ! 238 REAL(wp) :: zkt 239 #if defined key_off_tra 214 REAL(wp) :: zkt, zrdttrc1 240 215 REAL(wp) :: zndastp 241 #endif242 216 243 217 ! Time domain : restart … … 250 224 WRITE(numout,*) ' previous time-step : ', NINT( zkt ) 251 225 WRITE(numout,*) ' *** restart option' 252 SELECT CASE ( n rsttr )253 CASE ( 0 ) ; WRITE(numout,*) ' n rsttr = 0 : no control of nittrc000'254 CASE ( 1 ) ; WRITE(numout,*) ' n rsttr = 1 : no control the date at nit000 (use ndate0 read in the namelist)'255 CASE ( 2 ) ; WRITE(numout,*) ' n rsttr = 2 : calendar parameters read in restart'226 SELECT CASE ( nn_rsttr ) 227 CASE ( 0 ) ; WRITE(numout,*) ' nn_rsttr = 0 : no control of nit000' 228 CASE ( 1 ) ; WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nit000 (use ndate0 read in the namelist)' 229 CASE ( 2 ) ; WRITE(numout,*) ' nn_rsttr = 2 : calendar parameters read in restart' 256 230 END SELECT 257 231 WRITE(numout,*) 258 232 ENDIF 259 233 ! Control of date 260 IF( nit trc000 - NINT( zkt ) /= 1 .AND. nrsttr /= 0 ) &234 IF( nit000 - NINT( zkt ) /= 1 .AND. nn_rsttr /= 0 ) & 261 235 & CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart', & 262 & ' verify the restart file or rerun with nrsttr = 0 (namelist)' ) 263 #if defined key_off_tra 264 ! define ndastp and adatrj 265 IF ( nrsttr == 2 ) THEN 266 CALL iom_get( numrtr, 'ndastp', zndastp ) 267 ndastp = NINT( zndastp ) 268 CALL iom_get( numrtr, 'adatrj', adatrj ) 269 ELSE 270 ndastp = ndate0 - 1 ! ndate0 read in the namelist in dom_nam 271 adatrj = ( REAL( nittrc000-1, wp ) * rdttra(1) ) / rday 272 ! note this is wrong if time step has changed during run 236 & ' verify the restart file or rerun with nn_rsttr = 0 (namelist)' ) 237 IF( lk_offline ) THEN ! set the date in offline mode 238 ! Check dynamics and tracer time-step consistency and force Euler restart if changed 239 IF( iom_varid( numrtr, 'rdttrc1', ldstop = .FALSE. ) > 0 ) THEN 240 CALL iom_get( numrtr, 'rdttrc1', zrdttrc1 ) 241 IF( zrdttrc1 /= rdttrc(1) ) neuler = 0 242 ENDIF 243 ! ! define ndastp and adatrj 244 IF ( nn_rsttr == 2 ) THEN 245 CALL iom_get( numrtr, 'ndastp', zndastp ) 246 ndastp = NINT( zndastp ) 247 CALL iom_get( numrtr, 'adatrj', adatrj ) 248 ELSE 249 ndastp = ndate0 - 1 ! ndate0 read in the namelist in dom_nam 250 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 251 ! note this is wrong if time step has changed during run 252 ENDIF 253 ! 254 IF(lwp) THEN 255 WRITE(numout,*) ' *** Info used values : ' 256 WRITE(numout,*) ' date ndastp : ', ndastp 257 WRITE(numout,*) ' number of elapsed days since the begining of run : ', adatrj 258 WRITE(numout,*) 259 ENDIF 260 ! 261 CALL day_init ! compute calendar 262 ! 273 263 ENDIF 274 264 ! 275 IF(lwp) THEN276 WRITE(numout,*) ' *** Info used values : '277 WRITE(numout,*) ' date ndastp : ', ndastp278 WRITE(numout,*) ' number of elapsed days since the begining of run : ', adatrj279 WRITE(numout,*)280 ENDIF281 !282 CALL day_init ! compute calendar283 !284 #endif285 286 265 ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN 287 266 ! … … 291 270 IF(lwp) WRITE(numout,*) '~~~~~~~' 292 271 ENDIF 293 ! calendar control294 272 CALL iom_rstput( kt, nitrst, numrtw, 'kt' , REAL( kt , wp) ) ! time-step 295 273 CALL iom_rstput( kt, nitrst, numrtw, 'ndastp' , REAL( ndastp, wp) ) ! date … … 308 286 !!---------------------------------------------------------------------- 309 287 310 INTEGER :: j i, jj, jk, jn288 INTEGER :: jn 311 289 REAL(wp) :: zdiag_var, zdiag_varmin, zdiag_varmax, zdiag_tot 312 REAL(wp) :: zder , zvol290 REAL(wp) :: zder 313 291 !!---------------------------------------------------------------------- 314 292 … … 322 300 zdiag_tot = 0.e0 323 301 DO jn = 1, jptra 324 zdiag_var = 0.e0 325 zdiag_varmin = 0.e0 326 zdiag_varmax = 0.e0 327 DO jk = 1, jpk 328 DO jj = 1, jpj 329 DO ji = 1, jpi 330 zvol = cvol(ji,jj,jk) 331 # if defined key_off_degrad 332 zvol = zvol * facvol(ji,jj,jk) 302 # if defined key_degrad 303 zdiag_var = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) 304 # else 305 zdiag_var = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 333 306 # endif 334 zdiag_var = zdiag_var + trn(ji,jj,jk,jn) * zvol335 END DO336 END DO337 END DO338 339 307 zdiag_varmin = MINVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 340 308 zdiag_varmax = MAXVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) … … 342 310 CALL mpp_min( zdiag_varmin ) ! min over the global domain 343 311 CALL mpp_max( zdiag_varmax ) ! max over the global domain 344 CALL mpp_sum( zdiag_var ) ! sum over the global domain345 312 END IF 346 313 zdiag_tot = zdiag_tot + zdiag_var … … 369 336 #endif 370 337 338 !!---------------------------------------------------------------------- 339 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 340 !! $Id$ 341 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 371 342 !!====================================================================== 372 343 END MODULE trcrst -
trunk/NEMOGCM/NEMO/TOP_SRC/trcsms.F90
- Property svn:eol-style deleted
r1254 r2528 28 28 29 29 !!---------------------------------------------------------------------- 30 !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)30 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 31 31 !! $Id$ 32 !! Software governed by the CeCILL licence ( modipsl/doc/NEMO_CeCILL.txt)32 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 33 !!---------------------------------------------------------------------- 34 34 … … 48 48 !!--------------------------------------------------------------------- 49 49 50 IF ( MOD( kt,ndttrc) /= 0) RETURN ! this ROUTINE is called only every ndttrc time step50 IF ( MOD( kt, nn_dttrc) /= 0 ) RETURN ! this ROUTINE is called only every ndttrc time step 51 51 52 52 IF( lk_lobster ) CALL trc_sms_lobster( kt ) ! main program of LOBSTER -
trunk/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
- Property svn:keywords set to Id
r1457 r2528 4 4 !! Time-stepping : time loop of opa for passive tracer 5 5 !!====================================================================== 6 !! History : 1.0 ! 2004-03 (C. Ethe) Original 7 !!---------------------------------------------------------------------- 6 8 #if defined key_top 7 9 !!---------------------------------------------------------------------- 8 10 !! trc_stp : passive tracer system time-stepping 9 11 !!---------------------------------------------------------------------- 10 !! * Modules used11 12 USE oce_trc ! ocean dynamics and active tracers variables 12 USE tr p_trc13 USE trc 13 14 USE trctrp ! passive tracers transport 14 15 USE trcsms ! passive tracers sources and sinks … … 17 18 USE trcwri 18 19 USE trcrst 19 USE trdm ld_trc_oce20 USE trdmod_trc_oce 20 21 USE trdmld_trc 21 22 USE iom … … 25 26 PRIVATE 26 27 27 !! * Routine accessibility28 PUBLIC trc_stp ! called by step28 PUBLIC trc_stp ! called by step 29 29 30 !!---------------------------------------------------------------------- 30 !! TOP 1.0 , LOCEAN-IPSL (2005)31 !! $Id : trcstp.F90 1285 2009-02-03 13:38:51Z cetlod$32 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt31 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 32 !! $Id$ 33 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 34 !!---------------------------------------------------------------------- 34 35 35 CONTAINS 36 36 … … 44 44 !! Compute the passive tracers trends 45 45 !! Update the passive tracers 46 !!47 !! History :48 !! 9.0 ! 04-03 (C. Ethe) Original49 46 !!------------------------------------------------------------------- 50 !! * Arguments51 47 INTEGER, INTENT( in ) :: kt ! ocean time-step index 52 48 CHARACTER (len=25) :: charout 49 !!------------------------------------------------------------------- 53 50 54 ! this ROUTINE is called only every ndttrc time step 55 IF( MOD( kt , ndttrc ) /= 0 ) RETURN 56 57 IF(ln_ctl) THEN 58 WRITE(charout,FMT="('kt =', I4,' d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 59 CALL prt_ctl_trc_info(charout) 51 IF( MOD( kt - 1 , nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step 52 ! 53 IF(ln_ctl) THEN 54 WRITE(charout,FMT="('kt =', I4,' d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 55 CALL prt_ctl_trc_info(charout) 56 ENDIF 57 ! 58 tra(:,:,:,:) = 0.e0 59 ! 60 IF( kt == nit000 .AND. lk_trdmld_trc ) & 61 & CALL trd_mld_trc_init ! trends: Mixed-layer 62 CALL trc_rst_opn( kt ) ! Open tracer restart file 63 IF( lk_iomput ) THEN ; CALL trc_wri( kt ) ! output of passive tracers 64 ELSE ; CALL trc_dia( kt ) 65 ENDIF 66 CALL trc_sms( kt ) ! tracers: sink and source 67 CALL trc_trp( kt ) ! transport of passive tracers 68 IF( kt == nit000 ) CALL iom_close( numrtr ) ! close input passive tracers restart file 69 IF( lrst_trc ) CALL trc_rst_wri( kt ) ! write tracer restart file 70 IF( lk_trdmld_trc ) CALL trd_mld_trc( kt ) ! trends: Mixed-layer 71 ! 60 72 ENDIF 61 62 IF( kt == nittrc000 .AND. lk_trdmld_trc ) &63 & CALL trd_mld_trc_init ! trends: Mixed-layer64 CALL trc_rst_opn( kt ) ! Open tracer restart file65 CALL trc_sms( kt ) ! tracers: sink and source66 CALL trc_trp( kt ) ! transport of passive tracers67 IF( kt == nittrc000 ) CALL iom_close( numrtr ) ! close input passive tracers restart file68 IF( lrst_trc ) CALL trc_rst_wri( kt ) ! write tracer restart file69 IF( lk_iomput ) THEN70 CALL trc_wri( kt ) ! output of passive tracers71 ELSE72 CALL trc_dia( kt ) ! diagnostics73 ENDIF74 IF( lk_trdmld_trc ) CALL trd_mld_trc( kt ) ! trends: Mixed-layer75 73 76 74 END SUBROUTINE trc_stp … … 82 80 CONTAINS 83 81 SUBROUTINE trc_stp( kt ) ! Empty routine 84 INTEGER, INTENT(in) :: kt85 82 WRITE(*,*) 'trc_stp: You should not have seen this print! error?', kt 86 83 END SUBROUTINE trc_stp -
trunk/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
- Property svn:keywords set to Id
r1836 r2528 5 5 !!==================================================================================== 6 6 !! History : 1.0 ! 2009-05 (C. Ethe) Original code 7 !! ! 2010-03 (C. Ethe, R. Seferian ) Add the tracer transport trends8 7 !!---------------------------------------------------------------------- 9 8 #if defined key_top && defined key_iomput … … 12 11 !!---------------------------------------------------------------------- 13 12 !! trc_wri_trc : outputs of concentration fields 14 !! trc_wri_trd : outputs of transport trends15 13 !!---------------------------------------------------------------------- 16 14 USE dom_oce ! ocean space and time domain variables 17 15 USE oce_trc 18 USE trp_trc19 16 USE trc 20 USE trdmld_trc_oce, ONLY : luttrd21 17 USE iom 22 #if defined key_off_tra23 USE oce_trc24 18 USE dianam 25 #endif26 19 27 20 IMPLICIT NONE … … 32 25 !! * Substitutions 33 26 # include "top_substitute.h90" 34 !!----------------------------------------------------------------------35 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)36 !! $Id: trcdia.F90 1450 2009-05-15 14:12:12Z cetlod $37 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)38 !!----------------------------------------------------------------------39 27 40 28 CONTAINS … … 50 38 51 39 ! 52 CALL iom_setkt ( kt + n dttrc - 1 ) ! set the passive tracer time step40 CALL iom_setkt ( kt + nn_dttrc - 1 ) ! set the passive tracer time step 53 41 CALL trc_wri_trc( kt ) ! outputs for tracer concentration 54 CALL trc_wri_trd( kt ) ! outputs for dynamical trends55 42 CALL iom_setkt ( kt ) ! set the model time step 56 43 ! … … 65 52 INTEGER, INTENT( in ) :: kt ! ocean time-step 66 53 INTEGER :: jn 67 CHARACTER (len=20) :: cltra, cltras 68 #if defined key_off_tra 54 CHARACTER (len=20) :: cltra 69 55 CHARACTER (len=40) :: clhstnam 70 56 INTEGER :: inum = 11 ! temporary logical unit 71 #endif72 57 !!--------------------------------------------------------------------- 73 58 74 #if defined key_off_tra 75 IF( kt == nittrc000 ) THEN 76 ! WRITE root name in date.file for use by postpro 77 IF(lwp) THEN 78 CALL dia_nam( clhstnam, nwritetrc,' ' ) 79 CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 80 WRITE(inum,*) clhstnam 81 CLOSE(inum) 82 ENDIF 59 IF( lk_offline .AND. kt == nit000 .AND. lwp ) THEN ! WRITE root name in date.file for use by postpro 60 CALL dia_nam( clhstnam, nn_writetrc,' ' ) 61 CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 62 WRITE(inum,*) clhstnam 63 CLOSE(inum) 83 64 ENDIF 84 #endif85 65 ! write the tracer concentrations in the file 86 66 ! --------------------------------------- … … 92 72 END SUBROUTINE trc_wri_trc 93 73 94 # if defined key_trc_diatrd95 96 SUBROUTINE trc_wri_trd( kt )97 !!----------------------------------------------------------------------98 !! *** ROUTINE trc_wri_trd ***99 !!100 !! ** Purpose : output of passive tracer : advection-diffusion trends101 !!102 !!----------------------------------------------------------------------103 INTEGER, INTENT( in ) :: kt ! ocean time-step104 !!105 CHARACTER (len=3) :: cltra106 INTEGER :: jn, jl, ikn107 !!----------------------------------------------------------------------108 109 DO jn = 1, jptra110 IF( luttrd(jn) ) THEN111 ikn = ikeep(jn)112 DO jl = 1, jpdiatrc113 IF( jl == jptrc_xad ) WRITE (cltra,"(3a)") 'XAD' ! x advection for tracer114 IF( jl == jptrc_yad ) WRITE (cltra,"(3a)") 'YAD' ! y advection for tracer115 IF( jl == jptrc_zad ) WRITE (cltra,"(3a)") 'ZAD' ! z advection for tracer116 IF( jl == jptrc_xdf ) WRITE (cltra,"(3a)") 'XDF' ! x diffusion for tracer117 IF( jl == jptrc_ydf ) WRITE (cltra,"(3a)") 'YDF' ! y diffusion for tracer118 IF( jl == jptrc_zdf ) WRITE (cltra,"(3a)") 'ZDF' ! z diffusion for tracer119 # if defined key_trcldf_eiv120 IF( jl == jptrc_xei ) WRITE (cltra,"(3a)") 'XGV' ! x gent velocity for tracer121 IF( jl == jptrc_yei ) WRITE (cltra,"(3a)") 'YGV' ! y gent velocity for tracer122 IF( jl == jptrc_zei ) WRITE (cltra,"(3a)") 'ZGV' ! z gent velocity for tracer123 # endif124 # if defined key_trcdmp125 IF( jl == jptrc_dmp ) WRITE (cltra,"(3a)") 'DMP' ! damping126 # endif127 IF( jl == jptrc_sbc ) WRITE (cltra,"(3a)") 'SBC' ! surface boundary conditions128 ! write the trends129 CALL iom_put( cltra, trtrd(:,:,:,ikn,jl) )130 END DO131 END IF132 END DO133 !134 END SUBROUTINE trc_wri_trd135 136 # else137 SUBROUTINE trc_wri_trd( kt ) ! Dummy routine138 INTEGER, INTENT ( in ) :: kt139 END SUBROUTINE trc_wri_trd140 #endif141 74 #else 142 75 !!---------------------------------------------------------------------- … … 150 83 #endif 151 84 85 !!---------------------------------------------------------------------- 86 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 87 !! $Id$ 88 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 152 89 !!====================================================================== 153 90 END MODULE trcwri
Note: See TracChangeset
for help on using the changeset viewer.