[3443] | 1 | MODULE p4zsbc |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE p4sbc *** |
---|
| 4 | !! TOP : PISCES surface boundary conditions of external inputs of nutrients |
---|
| 5 | !!====================================================================== |
---|
| 6 | !! History : 3.5 ! 2012-07 (O. Aumont, C. Ethe) Original code |
---|
| 7 | !!---------------------------------------------------------------------- |
---|
| 8 | #if defined key_pisces |
---|
| 9 | !!---------------------------------------------------------------------- |
---|
| 10 | !! 'key_pisces' PISCES bio-model |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
| 12 | !! p4z_sbc : Read and interpolate time-varying nutrients fluxes |
---|
| 13 | !! p4z_sbc_init : Initialization of p4z_sbc |
---|
| 14 | !!---------------------------------------------------------------------- |
---|
| 15 | USE oce_trc ! shared variables between ocean and passive tracers |
---|
| 16 | USE trc ! passive tracers common variables |
---|
| 17 | USE sms_pisces ! PISCES Source Minus Sink variables |
---|
| 18 | USE iom ! I/O manager |
---|
| 19 | USE fldread ! time interpolation |
---|
| 20 | |
---|
| 21 | IMPLICIT NONE |
---|
| 22 | PRIVATE |
---|
| 23 | |
---|
| 24 | PUBLIC p4z_sbc |
---|
| 25 | PUBLIC p4z_sbc_init |
---|
| 26 | |
---|
[4147] | 27 | LOGICAL , PUBLIC :: ln_dust !: boolean for dust input from the atmosphere |
---|
| 28 | LOGICAL , PUBLIC :: ln_solub !: boolean for variable solubility of atmospheric iron |
---|
| 29 | LOGICAL , PUBLIC :: ln_river !: boolean for river input of nutrients |
---|
| 30 | LOGICAL , PUBLIC :: ln_ndepo !: boolean for atmospheric deposition of N |
---|
| 31 | LOGICAL , PUBLIC :: ln_ironsed !: boolean for Fe input from sediments |
---|
| 32 | LOGICAL , PUBLIC :: ln_hydrofe !: boolean for Fe input from hydrothermal vents |
---|
| 33 | LOGICAL , PUBLIC :: ln_ironice !: boolean for Fe input from sea ice |
---|
| 34 | REAL(wp), PUBLIC :: sedfeinput !: Coastal release of Iron |
---|
| 35 | REAL(wp), PUBLIC :: dustsolub !: Solubility of the dust |
---|
[4529] | 36 | REAL(wp), PUBLIC :: mfrac !: Mineral Content of the dust |
---|
[4147] | 37 | REAL(wp), PUBLIC :: icefeinput !: Iron concentration in sea ice |
---|
| 38 | REAL(wp), PUBLIC :: wdust !: Sinking speed of the dust |
---|
| 39 | REAL(wp), PUBLIC :: nitrfix !: Nitrogen fixation rate |
---|
| 40 | REAL(wp), PUBLIC :: diazolight !: Nitrogen fixation sensitivty to light |
---|
| 41 | REAL(wp), PUBLIC :: concfediaz !: Fe half-saturation Cste for diazotrophs |
---|
| 42 | REAL(wp) :: hratio !: Fe:3He ratio assumed for vent iron supply |
---|
[3443] | 43 | |
---|
| 44 | LOGICAL , PUBLIC :: ll_sbc |
---|
| 45 | |
---|
| 46 | LOGICAL :: ll_solub |
---|
| 47 | |
---|
| 48 | INTEGER , PARAMETER :: jpriv = 7 !: Maximum number of river input fields |
---|
| 49 | INTEGER , PARAMETER :: jr_dic = 1 !: index of dissolved inorganic carbon |
---|
| 50 | INTEGER , PARAMETER :: jr_doc = 2 !: index of dissolved organic carbon |
---|
| 51 | INTEGER , PARAMETER :: jr_din = 3 !: index of dissolved inorganic nitrogen |
---|
| 52 | INTEGER , PARAMETER :: jr_don = 4 !: index of dissolved organic nitrogen |
---|
| 53 | INTEGER , PARAMETER :: jr_dip = 5 !: index of dissolved inorganic phosporus |
---|
| 54 | INTEGER , PARAMETER :: jr_dop = 6 !: index of dissolved organic phosphorus |
---|
| 55 | INTEGER , PARAMETER :: jr_dsi = 7 !: index of dissolved silicate |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_dust ! structure of input dust |
---|
| 59 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_solub ! structure of input dust |
---|
| 60 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_river ! structure of input riverdic |
---|
| 61 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ndepo ! structure of input nitrogen deposition |
---|
| 62 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ironsed ! structure of input iron from sediment |
---|
| 63 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_hydrofe ! structure of input iron from hydrothermal vents |
---|
| 64 | |
---|
| 65 | INTEGER , PARAMETER :: nbtimes = 365 !: maximum number of times record in a file |
---|
| 66 | INTEGER :: ntimes_dust, ntimes_riv, ntimes_ndep ! number of time steps in a file |
---|
| 67 | INTEGER :: ntimes_solub, ntimes_hydro ! number of time steps in a file |
---|
| 68 | |
---|
| 69 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: dust, solub !: dust fields |
---|
| 70 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rivdic, rivalk !: river input fields |
---|
| 71 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rivdin, rivdip !: river input fields |
---|
| 72 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rivdsi !: river input fields |
---|
| 73 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: nitdep !: atmospheric N deposition |
---|
| 74 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ironsed !: Coastal supply of iron |
---|
| 75 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hydrofe !: Hydrothermal vent supply of iron |
---|
| 76 | |
---|
| 77 | REAL(wp), PUBLIC :: sumdepsi, rivalkinput, rivdicinput, nitdepinput |
---|
| 78 | REAL(wp), PUBLIC :: rivdininput, rivdipinput, rivdsiinput |
---|
| 79 | |
---|
[6808] | 80 | !! * Substitutions |
---|
| 81 | # include "vectopt_loop_substitute.h90" |
---|
[3443] | 82 | !!---------------------------------------------------------------------- |
---|
| 83 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
[5215] | 84 | !! $Id$ |
---|
[3443] | 85 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 86 | !!---------------------------------------------------------------------- |
---|
| 87 | CONTAINS |
---|
| 88 | |
---|
| 89 | SUBROUTINE p4z_sbc( kt ) |
---|
| 90 | !!---------------------------------------------------------------------- |
---|
| 91 | !! *** routine p4z_sbc *** |
---|
| 92 | !! |
---|
| 93 | !! ** purpose : read and interpolate the external sources of nutrients |
---|
| 94 | !! |
---|
| 95 | !! ** method : read the files and interpolate the appropriate variables |
---|
| 96 | !! |
---|
| 97 | !! ** input : external netcdf files |
---|
| 98 | !! |
---|
| 99 | !!---------------------------------------------------------------------- |
---|
| 100 | !! * arguments |
---|
| 101 | INTEGER, INTENT( in ) :: kt ! ocean time step |
---|
| 102 | |
---|
| 103 | !! * local declarations |
---|
| 104 | INTEGER :: ji,jj |
---|
| 105 | REAL(wp) :: zcoef, zyyss |
---|
| 106 | !!--------------------------------------------------------------------- |
---|
| 107 | ! |
---|
| 108 | IF( nn_timing == 1 ) CALL timing_start('p4z_sbc') |
---|
| 109 | |
---|
| 110 | ! |
---|
| 111 | ! Compute dust at nit000 or only if there is more than 1 time record in dust file |
---|
| 112 | IF( ln_dust ) THEN |
---|
| 113 | IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_dust > 1 ) ) THEN |
---|
| 114 | CALL fld_read( kt, 1, sf_dust ) |
---|
[5507] | 115 | IF( nn_ice_tr == -1 .AND. .NOT. ln_ironice ) THEN |
---|
| 116 | dust(:,:) = sf_dust(1)%fnow(:,:,1) |
---|
| 117 | ELSE |
---|
| 118 | dust(:,:) = sf_dust(1)%fnow(:,:,1) * ( 1.0 - fr_i(:,:) ) |
---|
| 119 | ENDIF |
---|
[3443] | 120 | ENDIF |
---|
| 121 | ENDIF |
---|
| 122 | |
---|
| 123 | IF( ll_solub ) THEN |
---|
| 124 | IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_solub > 1 ) ) THEN |
---|
| 125 | CALL fld_read( kt, 1, sf_solub ) |
---|
| 126 | solub(:,:) = sf_solub(1)%fnow(:,:,1) |
---|
| 127 | ENDIF |
---|
| 128 | ENDIF |
---|
| 129 | |
---|
| 130 | ! N/P and Si releases due to coastal rivers |
---|
| 131 | ! Compute river at nit000 or only if there is more than 1 time record in river file |
---|
| 132 | ! ----------------------------------------- |
---|
| 133 | IF( ln_river ) THEN |
---|
| 134 | IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_riv > 1 ) ) THEN |
---|
| 135 | CALL fld_read( kt, 1, sf_river ) |
---|
| 136 | DO jj = 1, jpj |
---|
| 137 | DO ji = 1, jpi |
---|
[5385] | 138 | zcoef = ryyss * e1e2t(ji,jj) * h_rnf(ji,jj) |
---|
[3443] | 139 | rivalk(ji,jj) = sf_river(jr_dic)%fnow(ji,jj,1) & |
---|
| 140 | & * 1.E3 / ( 12. * zcoef + rtrn ) |
---|
| 141 | rivdic(ji,jj) = ( sf_river(jr_dic)%fnow(ji,jj,1) + sf_river(jr_doc)%fnow(ji,jj,1) ) & |
---|
| 142 | & * 1.E3 / ( 12. * zcoef + rtrn ) |
---|
| 143 | rivdin(ji,jj) = ( sf_river(jr_din)%fnow(ji,jj,1) + sf_river(jr_don)%fnow(ji,jj,1) ) & |
---|
| 144 | & * 1.E3 / rno3 / ( 14. * zcoef + rtrn ) |
---|
| 145 | rivdip(ji,jj) = ( sf_river(jr_dip)%fnow(ji,jj,1) + sf_river(jr_dop)%fnow(ji,jj,1) ) & |
---|
| 146 | & * 1.E3 / po4r / ( 31. * zcoef + rtrn ) |
---|
| 147 | rivdsi(ji,jj) = sf_river(jr_dsi)%fnow(ji,jj,1) & |
---|
[3475] | 148 | & * 1.E3 / ( 28.1 * zcoef + rtrn ) |
---|
[3443] | 149 | END DO |
---|
| 150 | END DO |
---|
| 151 | ENDIF |
---|
| 152 | ENDIF |
---|
| 153 | |
---|
| 154 | ! Compute N deposition at nit000 or only if there is more than 1 time record in N deposition file |
---|
| 155 | IF( ln_ndepo ) THEN |
---|
| 156 | IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_ndep > 1 ) ) THEN |
---|
| 157 | CALL fld_read( kt, 1, sf_ndepo ) |
---|
| 158 | DO jj = 1, jpj |
---|
| 159 | DO ji = 1, jpi |
---|
[6808] | 160 | nitdep(ji,jj) = sf_ndepo(1)%fnow(ji,jj,1) / rno3 / ( 14E6 * ryyss * e3t_n(ji,jj,1) + rtrn ) |
---|
[3443] | 161 | END DO |
---|
| 162 | END DO |
---|
| 163 | ENDIF |
---|
| 164 | ENDIF |
---|
| 165 | ! |
---|
| 166 | IF( nn_timing == 1 ) CALL timing_stop('p4z_sbc') |
---|
| 167 | ! |
---|
| 168 | END SUBROUTINE p4z_sbc |
---|
| 169 | |
---|
| 170 | SUBROUTINE p4z_sbc_init |
---|
| 171 | |
---|
| 172 | !!---------------------------------------------------------------------- |
---|
| 173 | !! *** routine p4z_sbc_init *** |
---|
| 174 | !! |
---|
| 175 | !! ** purpose : initialization of the external sources of nutrients |
---|
| 176 | !! |
---|
| 177 | !! ** method : read the files and compute the budget |
---|
| 178 | !! called at the first timestep (nittrc000) |
---|
| 179 | !! |
---|
| 180 | !! ** input : external netcdf files |
---|
| 181 | !! |
---|
| 182 | !!---------------------------------------------------------------------- |
---|
| 183 | ! |
---|
| 184 | INTEGER :: ji, jj, jk, jm, ifpr |
---|
[3446] | 185 | INTEGER :: ii0, ii1, ij0, ij1 |
---|
[3443] | 186 | INTEGER :: numdust, numsolub, numriv, numiron, numdepo, numhydro |
---|
| 187 | INTEGER :: ierr, ierr1, ierr2, ierr3 |
---|
[4147] | 188 | INTEGER :: ios ! Local integer output status for namelist read |
---|
[5385] | 189 | INTEGER :: ik50 ! last level where depth less than 50 m |
---|
| 190 | INTEGER :: isrow ! index for ORCA1 starting row |
---|
[3443] | 191 | REAL(wp) :: zexpide, zdenitide, zmaskt |
---|
| 192 | REAL(wp) :: ztimes_dust, ztimes_riv, ztimes_ndep |
---|
| 193 | REAL(wp), DIMENSION(nbtimes) :: zsteps ! times records |
---|
| 194 | REAL(wp), DIMENSION(:), ALLOCATABLE :: rivinput |
---|
| 195 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zdust, zndepo, zriver, zcmask |
---|
| 196 | ! |
---|
| 197 | CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files |
---|
| 198 | TYPE(FLD_N), DIMENSION(jpriv) :: slf_river ! array of namelist informations on the fields to read |
---|
| 199 | TYPE(FLD_N) :: sn_dust, sn_solub, sn_ndepo, sn_ironsed, sn_hydrofe ! informations about the fields to be read |
---|
| 200 | TYPE(FLD_N) :: sn_riverdoc, sn_riverdic, sn_riverdsi ! informations about the fields to be read |
---|
| 201 | TYPE(FLD_N) :: sn_riverdin, sn_riverdon, sn_riverdip, sn_riverdop |
---|
| 202 | ! |
---|
| 203 | NAMELIST/nampissbc/cn_dir, sn_dust, sn_solub, sn_riverdic, sn_riverdoc, sn_riverdin, sn_riverdon, & |
---|
| 204 | & sn_riverdip, sn_riverdop, sn_riverdsi, sn_ndepo, sn_ironsed, sn_hydrofe, & |
---|
| 205 | & ln_dust, ln_solub, ln_river, ln_ndepo, ln_ironsed, ln_ironice, ln_hydrofe, & |
---|
[4564] | 206 | & sedfeinput, dustsolub, icefeinput, wdust, mfrac, nitrfix, diazolight, concfediaz, hratio |
---|
[3443] | 207 | !!---------------------------------------------------------------------- |
---|
| 208 | ! |
---|
| 209 | IF( nn_timing == 1 ) CALL timing_start('p4z_sbc_init') |
---|
| 210 | ! |
---|
| 211 | ! !* set file information |
---|
[4147] | 212 | REWIND( numnatp_ref ) ! Namelist nampissbc in reference namelist : Pisces external sources of nutrients |
---|
| 213 | READ ( numnatp_ref, nampissbc, IOSTAT = ios, ERR = 901) |
---|
| 214 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampissbc in reference namelist', lwp ) |
---|
[3443] | 215 | |
---|
[4147] | 216 | REWIND( numnatp_cfg ) ! Namelist nampissbc in configuration namelist : Pisces external sources of nutrients |
---|
| 217 | READ ( numnatp_cfg, nampissbc, IOSTAT = ios, ERR = 902 ) |
---|
| 218 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampissbc in configuration namelist', lwp ) |
---|
[4624] | 219 | IF(lwm) WRITE ( numonp, nampissbc ) |
---|
[4147] | 220 | |
---|
[5385] | 221 | IF ( ( nn_ice_tr >= 0 ) .AND. ln_ironice ) THEN |
---|
[5411] | 222 | IF(lwp) THEN |
---|
| 223 | WRITE(numout,*) ' ln_ironice incompatible with nn_ice_tr = ', nn_ice_tr |
---|
| 224 | WRITE(numout,*) ' Specify your sea ice iron concentration in nampisice instead ' |
---|
| 225 | WRITE(numout,*) ' ln_ironice is forced to .FALSE. ' |
---|
| 226 | ln_ironice = .FALSE. |
---|
| 227 | ENDIF |
---|
[5385] | 228 | ENDIF |
---|
| 229 | |
---|
[3443] | 230 | IF(lwp) THEN |
---|
| 231 | WRITE(numout,*) ' ' |
---|
| 232 | WRITE(numout,*) ' namelist : nampissbc ' |
---|
| 233 | WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~ ' |
---|
| 234 | WRITE(numout,*) ' dust input from the atmosphere ln_dust = ', ln_dust |
---|
| 235 | WRITE(numout,*) ' Variable solubility of iron input ln_solub = ', ln_solub |
---|
| 236 | WRITE(numout,*) ' river input of nutrients ln_river = ', ln_river |
---|
| 237 | WRITE(numout,*) ' atmospheric deposition of n ln_ndepo = ', ln_ndepo |
---|
| 238 | WRITE(numout,*) ' Fe input from sediments ln_ironsed = ', ln_ironsed |
---|
| 239 | WRITE(numout,*) ' Fe input from seaice ln_ironice = ', ln_ironice |
---|
| 240 | WRITE(numout,*) ' fe input from hydrothermal vents ln_hydrofe = ', ln_hydrofe |
---|
| 241 | WRITE(numout,*) ' coastal release of iron sedfeinput = ', sedfeinput |
---|
| 242 | WRITE(numout,*) ' solubility of the dust dustsolub = ', dustsolub |
---|
[4529] | 243 | WRITE(numout,*) ' Mineral Fe content of the dust mfrac = ', mfrac |
---|
[3443] | 244 | WRITE(numout,*) ' Iron concentration in sea ice icefeinput = ', icefeinput |
---|
| 245 | WRITE(numout,*) ' sinking speed of the dust wdust = ', wdust |
---|
| 246 | WRITE(numout,*) ' nitrogen fixation rate nitrfix = ', nitrfix |
---|
| 247 | WRITE(numout,*) ' nitrogen fixation sensitivty to light diazolight = ', diazolight |
---|
| 248 | WRITE(numout,*) ' fe half-saturation cste for diazotrophs concfediaz = ', concfediaz |
---|
| 249 | WRITE(numout,*) ' Fe to 3He ratio assumed for vent iron supply hratio = ', hratio |
---|
| 250 | END IF |
---|
| 251 | |
---|
| 252 | IF( ln_dust .OR. ln_river .OR. ln_ndepo ) THEN ; ll_sbc = .TRUE. |
---|
| 253 | ELSE ; ll_sbc = .FALSE. |
---|
| 254 | ENDIF |
---|
| 255 | |
---|
| 256 | IF( ln_dust .AND. ln_solub ) THEN ; ll_solub = .TRUE. |
---|
| 257 | ELSE ; ll_solub = .FALSE. |
---|
| 258 | ENDIF |
---|
| 259 | |
---|
[5385] | 260 | ! set the number of level over which river runoffs are applied |
---|
| 261 | ! online configuration : computed in sbcrnf |
---|
| 262 | IF( lk_offline ) THEN |
---|
| 263 | nk_rnf(:,:) = 1 |
---|
[6808] | 264 | h_rnf (:,:) = gdept_n(:,:,1) |
---|
[5385] | 265 | ENDIF |
---|
| 266 | |
---|
[3443] | 267 | ! dust input from the atmosphere |
---|
| 268 | ! ------------------------------ |
---|
| 269 | IF( ln_dust ) THEN |
---|
| 270 | ! |
---|
| 271 | IF(lwp) WRITE(numout,*) ' initialize dust input from atmosphere ' |
---|
| 272 | IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' |
---|
| 273 | ! |
---|
| 274 | ALLOCATE( dust(jpi,jpj) ) ! allocation |
---|
| 275 | ! |
---|
| 276 | ALLOCATE( sf_dust(1), STAT=ierr ) !* allocate and fill sf_sst (forcing structure) with sn_sst |
---|
| 277 | IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_dust structure' ) |
---|
| 278 | ! |
---|
| 279 | CALL fld_fill( sf_dust, (/ sn_dust /), cn_dir, 'p4z_sed_init', 'Atmospheric dust deposition', 'nampissed' ) |
---|
| 280 | ALLOCATE( sf_dust(1)%fnow(jpi,jpj,1) ) |
---|
| 281 | IF( sn_dust%ln_tint ) ALLOCATE( sf_dust(1)%fdta(jpi,jpj,1,2) ) |
---|
| 282 | ! |
---|
[3557] | 283 | IF( Agrif_Root() ) THEN ! Only on the master grid |
---|
| 284 | ! Get total input dust ; need to compute total atmospheric supply of Si in a year |
---|
| 285 | CALL iom_open ( TRIM( sn_dust%clname ) , numdust ) |
---|
| 286 | CALL iom_gettime( numdust, zsteps, kntime=ntimes_dust) ! get number of record in file |
---|
| 287 | ALLOCATE( zdust(jpi,jpj,ntimes_dust) ) |
---|
| 288 | DO jm = 1, ntimes_dust |
---|
| 289 | CALL iom_get( numdust, jpdom_data, TRIM( sn_dust%clvar ), zdust(:,:,jm), jm ) |
---|
| 290 | END DO |
---|
| 291 | CALL iom_close( numdust ) |
---|
| 292 | ztimes_dust = 1._wp / FLOAT( ntimes_dust ) |
---|
| 293 | sumdepsi = 0.e0 |
---|
| 294 | DO jm = 1, ntimes_dust |
---|
| 295 | sumdepsi = sumdepsi + glob_sum( zdust(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) * ztimes_dust ) |
---|
| 296 | ENDDO |
---|
[4529] | 297 | sumdepsi = sumdepsi / ( nyear_len(1) * rday ) * 12. * 8.8 * 0.075 * mfrac / 28.1 |
---|
[3557] | 298 | DEALLOCATE( zdust) |
---|
| 299 | ENDIF |
---|
[3443] | 300 | ELSE |
---|
| 301 | sumdepsi = 0._wp |
---|
| 302 | END IF |
---|
| 303 | |
---|
| 304 | ! Solubility of dust deposition of iron |
---|
| 305 | ! Only if ln_dust and ln_solubility set to true (ll_solub = .true.) |
---|
| 306 | ! ----------------------------------------------------------------- |
---|
| 307 | IF( ll_solub ) THEN |
---|
| 308 | ! |
---|
| 309 | IF(lwp) WRITE(numout,*) ' initialize variable solubility of Fe ' |
---|
| 310 | IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' |
---|
| 311 | ! |
---|
| 312 | ALLOCATE( solub(jpi,jpj) ) ! allocation |
---|
| 313 | ! |
---|
| 314 | ALLOCATE( sf_solub(1), STAT=ierr ) !* allocate and fill sf_sst (forcing structure) with sn_sst |
---|
| 315 | IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_solub structure' ) |
---|
| 316 | ! |
---|
| 317 | CALL fld_fill( sf_solub, (/ sn_solub /), cn_dir, 'p4z_sed_init', 'Solubility of atm. iron ', 'nampissed' ) |
---|
| 318 | ALLOCATE( sf_solub(1)%fnow(jpi,jpj,1) ) |
---|
| 319 | IF( sn_solub%ln_tint ) ALLOCATE( sf_solub(1)%fdta(jpi,jpj,1,2) ) |
---|
| 320 | ! get number of record in file |
---|
| 321 | CALL iom_open ( TRIM( sn_solub%clname ) , numsolub ) |
---|
| 322 | CALL iom_gettime( numsolub, zsteps, kntime=ntimes_solub) ! get number of record in file |
---|
| 323 | CALL iom_close( numsolub ) |
---|
| 324 | ENDIF |
---|
| 325 | |
---|
| 326 | ! nutrient input from rivers |
---|
| 327 | ! -------------------------- |
---|
| 328 | IF( ln_river ) THEN |
---|
| 329 | ! |
---|
| 330 | slf_river(jr_dic) = sn_riverdic ; slf_river(jr_doc) = sn_riverdoc ; slf_river(jr_din) = sn_riverdin |
---|
| 331 | slf_river(jr_don) = sn_riverdon ; slf_river(jr_dip) = sn_riverdip ; slf_river(jr_dop) = sn_riverdop |
---|
| 332 | slf_river(jr_dsi) = sn_riverdsi |
---|
| 333 | ! |
---|
| 334 | ALLOCATE( rivdic(jpi,jpj), rivalk(jpi,jpj), rivdin(jpi,jpj), rivdip(jpi,jpj), rivdsi(jpi,jpj) ) |
---|
| 335 | ! |
---|
[3475] | 336 | ALLOCATE( sf_river(jpriv), rivinput(jpriv), STAT=ierr1 ) !* allocate and fill sf_river (forcing structure) with sn_river_ |
---|
[3443] | 337 | rivinput(:) = 0.0 |
---|
| 338 | |
---|
| 339 | IF( ierr1 > 0 ) CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_irver structure' ) |
---|
| 340 | ! |
---|
| 341 | CALL fld_fill( sf_river, slf_river, cn_dir, 'p4z_sed_init', 'Input from river ', 'nampissed' ) |
---|
| 342 | DO ifpr = 1, jpriv |
---|
| 343 | ALLOCATE( sf_river(ifpr)%fnow(jpi,jpj,1 ) ) |
---|
| 344 | IF( slf_river(ifpr)%ln_tint ) ALLOCATE( sf_river(ifpr)%fdta(jpi,jpj,1,2) ) |
---|
| 345 | END DO |
---|
[3557] | 346 | IF( Agrif_Root() ) THEN ! Only on the master grid |
---|
| 347 | ! Get total input rivers ; need to compute total river supply in a year |
---|
| 348 | DO ifpr = 1, jpriv |
---|
| 349 | CALL iom_open ( TRIM( slf_river(ifpr)%clname ), numriv ) |
---|
| 350 | CALL iom_gettime( numriv, zsteps, kntime=ntimes_riv) |
---|
| 351 | ALLOCATE( zriver(jpi,jpj,ntimes_riv) ) |
---|
| 352 | DO jm = 1, ntimes_riv |
---|
| 353 | CALL iom_get( numriv, jpdom_data, TRIM( slf_river(ifpr)%clvar ), zriver(:,:,jm), jm ) |
---|
| 354 | END DO |
---|
| 355 | CALL iom_close( numriv ) |
---|
| 356 | ztimes_riv = 1._wp / FLOAT(ntimes_riv) |
---|
| 357 | DO jm = 1, ntimes_riv |
---|
| 358 | rivinput(ifpr) = rivinput(ifpr) + glob_sum( zriver(:,:,jm) * tmask(:,:,1) * ztimes_riv ) |
---|
| 359 | END DO |
---|
| 360 | DEALLOCATE( zriver) |
---|
[3443] | 361 | END DO |
---|
[3557] | 362 | ! N/P and Si releases due to coastal rivers |
---|
| 363 | ! ----------------------------------------- |
---|
| 364 | rivdicinput = (rivinput(jr_dic) + rivinput(jr_doc) ) * 1E3 / 12._wp |
---|
| 365 | rivdininput = (rivinput(jr_din) + rivinput(jr_don) ) * 1E3 / rno3 / 14._wp |
---|
| 366 | rivdipinput = (rivinput(jr_dip) + rivinput(jr_dop) ) * 1E3 / po4r / 31._wp |
---|
| 367 | rivdsiinput = rivinput(jr_dsi) * 1E3 / 28.1_wp |
---|
| 368 | rivalkinput = rivinput(jr_dic) * 1E3 / 12._wp |
---|
| 369 | ! |
---|
| 370 | ENDIF |
---|
[3443] | 371 | ELSE |
---|
| 372 | rivdicinput = 0._wp |
---|
| 373 | rivdininput = 0._wp |
---|
| 374 | rivdipinput = 0._wp |
---|
| 375 | rivdsiinput = 0._wp |
---|
| 376 | rivalkinput = 0._wp |
---|
| 377 | END IF |
---|
| 378 | ! nutrient input from dust |
---|
| 379 | ! ------------------------ |
---|
| 380 | IF( ln_ndepo ) THEN |
---|
| 381 | ! |
---|
| 382 | IF(lwp) WRITE(numout,*) ' initialize the nutrient input by dust from ndeposition.orca.nc' |
---|
| 383 | IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
| 384 | ! |
---|
| 385 | ALLOCATE( nitdep(jpi,jpj) ) ! allocation |
---|
| 386 | ! |
---|
| 387 | ALLOCATE( sf_ndepo(1), STAT=ierr3 ) !* allocate and fill sf_sst (forcing structure) with sn_sst |
---|
| 388 | IF( ierr3 > 0 ) CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_ndepo structure' ) |
---|
| 389 | ! |
---|
| 390 | CALL fld_fill( sf_ndepo, (/ sn_ndepo /), cn_dir, 'p4z_sed_init', 'Nutrient atmospheric depositon ', 'nampissed' ) |
---|
| 391 | ALLOCATE( sf_ndepo(1)%fnow(jpi,jpj,1) ) |
---|
| 392 | IF( sn_ndepo%ln_tint ) ALLOCATE( sf_ndepo(1)%fdta(jpi,jpj,1,2) ) |
---|
| 393 | ! |
---|
[3557] | 394 | IF( Agrif_Root() ) THEN ! Only on the master grid |
---|
| 395 | ! Get total input dust ; need to compute total atmospheric supply of N in a year |
---|
| 396 | CALL iom_open ( TRIM( sn_ndepo%clname ), numdepo ) |
---|
| 397 | CALL iom_gettime( numdepo, zsteps, kntime=ntimes_ndep) |
---|
| 398 | ALLOCATE( zndepo(jpi,jpj,ntimes_ndep) ) |
---|
| 399 | DO jm = 1, ntimes_ndep |
---|
| 400 | CALL iom_get( numdepo, jpdom_data, TRIM( sn_ndepo%clvar ), zndepo(:,:,jm), jm ) |
---|
| 401 | END DO |
---|
| 402 | CALL iom_close( numdepo ) |
---|
| 403 | ztimes_ndep = 1._wp / FLOAT( ntimes_ndep ) |
---|
| 404 | nitdepinput = 0._wp |
---|
| 405 | DO jm = 1, ntimes_ndep |
---|
| 406 | nitdepinput = nitdepinput + glob_sum( zndepo(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) * ztimes_ndep ) |
---|
| 407 | ENDDO |
---|
| 408 | nitdepinput = nitdepinput / rno3 / 14E6 |
---|
| 409 | DEALLOCATE( zndepo) |
---|
| 410 | ENDIF |
---|
[3443] | 411 | ELSE |
---|
| 412 | nitdepinput = 0._wp |
---|
| 413 | ENDIF |
---|
| 414 | |
---|
| 415 | ! coastal and island masks |
---|
| 416 | ! ------------------------ |
---|
| 417 | IF( ln_ironsed ) THEN |
---|
| 418 | ! |
---|
| 419 | IF(lwp) WRITE(numout,*) ' computation of an island mask to enhance coastal supply of iron' |
---|
| 420 | IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
| 421 | ! |
---|
| 422 | ALLOCATE( ironsed(jpi,jpj,jpk) ) ! allocation |
---|
| 423 | ! |
---|
| 424 | CALL iom_open ( TRIM( sn_ironsed%clname ), numiron ) |
---|
| 425 | ALLOCATE( zcmask(jpi,jpj,jpk) ) |
---|
| 426 | CALL iom_get ( numiron, jpdom_data, TRIM( sn_ironsed%clvar ), zcmask(:,:,:), 1 ) |
---|
| 427 | CALL iom_close( numiron ) |
---|
| 428 | ! |
---|
[5385] | 429 | ik50 = 5 ! last level where depth less than 50 m |
---|
| 430 | DO jk = jpkm1, 1, -1 |
---|
| 431 | IF( gdept_1d(jk) > 50. ) ik50 = jk - 1 |
---|
| 432 | END DO |
---|
| 433 | IF (lwp) WRITE(numout,*) |
---|
| 434 | IF (lwp) WRITE(numout,*) ' Level corresponding to 50m depth ', ik50,' ', gdept_1d(ik50+1) |
---|
| 435 | IF (lwp) WRITE(numout,*) |
---|
| 436 | DO jk = 1, ik50 |
---|
[3443] | 437 | DO jj = 2, jpjm1 |
---|
| 438 | DO ji = fs_2, fs_jpim1 |
---|
| 439 | IF( tmask(ji,jj,jk) /= 0. ) THEN |
---|
| 440 | zmaskt = tmask(ji+1,jj,jk) * tmask(ji-1,jj,jk) * tmask(ji,jj+1,jk) & |
---|
| 441 | & * tmask(ji,jj-1,jk) * tmask(ji,jj,jk+1) |
---|
| 442 | IF( zmaskt == 0. ) zcmask(ji,jj,jk ) = MAX( 0.1, zcmask(ji,jj,jk) ) |
---|
| 443 | END IF |
---|
| 444 | END DO |
---|
| 445 | END DO |
---|
| 446 | END DO |
---|
[5385] | 447 | ! |
---|
[3443] | 448 | CALL lbc_lnk( zcmask , 'T', 1. ) ! lateral boundary conditions on cmask (sign unchanged) |
---|
[5385] | 449 | ! |
---|
[3443] | 450 | DO jk = 1, jpk |
---|
| 451 | DO jj = 1, jpj |
---|
| 452 | DO ji = 1, jpi |
---|
[6808] | 453 | zexpide = MIN( 8.,( gdept_n(ji,jj,jk) / 500. )**(-1.5) ) |
---|
[3443] | 454 | zdenitide = -0.9543 + 0.7662 * LOG( zexpide ) - 0.235 * LOG( zexpide )**2 |
---|
| 455 | zcmask(ji,jj,jk) = zcmask(ji,jj,jk) * MIN( 1., EXP( zdenitide ) / 0.5 ) |
---|
| 456 | END DO |
---|
| 457 | END DO |
---|
| 458 | END DO |
---|
| 459 | ! Coastal supply of iron |
---|
| 460 | ! ------------------------- |
---|
| 461 | ironsed(:,:,jpk) = 0._wp |
---|
| 462 | DO jk = 1, jpkm1 |
---|
[6808] | 463 | ironsed(:,:,jk) = sedfeinput * zcmask(:,:,jk) / ( e3t_n(:,:,jk) * rday ) |
---|
[3443] | 464 | END DO |
---|
| 465 | DEALLOCATE( zcmask) |
---|
| 466 | ENDIF |
---|
| 467 | ! |
---|
| 468 | ! Iron from Hydrothermal vents |
---|
| 469 | ! ------------------------ |
---|
| 470 | IF( ln_hydrofe ) THEN |
---|
| 471 | ! |
---|
| 472 | IF(lwp) WRITE(numout,*) ' Input of iron from hydrothermal vents ' |
---|
| 473 | IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
| 474 | ! |
---|
| 475 | ALLOCATE( hydrofe(jpi,jpj,jpk) ) ! allocation |
---|
| 476 | ! |
---|
| 477 | CALL iom_open ( TRIM( sn_hydrofe%clname ), numhydro ) |
---|
| 478 | CALL iom_get ( numhydro, jpdom_data, TRIM( sn_hydrofe%clvar ), hydrofe(:,:,:), 1 ) |
---|
| 479 | CALL iom_close( numhydro ) |
---|
| 480 | ! |
---|
[4521] | 481 | hydrofe(:,:,:) = ( hydrofe(:,:,:) * hratio ) / ( cvol(:,:,:) * ryyss + rtrn ) / 1000._wp |
---|
[3451] | 482 | ! |
---|
[3443] | 483 | ENDIF |
---|
| 484 | ! |
---|
| 485 | IF( ll_sbc ) CALL p4z_sbc( nit000 ) |
---|
| 486 | ! |
---|
| 487 | IF(lwp) THEN |
---|
| 488 | WRITE(numout,*) |
---|
| 489 | WRITE(numout,*) ' Total input of elements from river supply' |
---|
| 490 | WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
| 491 | WRITE(numout,*) ' N Supply : ', rivdininput*rno3*1E3/1E12*14.,' TgN/yr' |
---|
[3475] | 492 | WRITE(numout,*) ' Si Supply : ', rivdsiinput*1E3/1E12*28.1,' TgSi/yr' |
---|
[3443] | 493 | WRITE(numout,*) ' P Supply : ', rivdipinput*1E3*po4r/1E12*31.,' TgP/yr' |
---|
| 494 | WRITE(numout,*) ' Alk Supply : ', rivalkinput*1E3/1E12,' Teq/yr' |
---|
| 495 | WRITE(numout,*) ' DIC Supply : ', rivdicinput*1E3*12./1E12,'TgC/yr' |
---|
| 496 | WRITE(numout,*) |
---|
| 497 | WRITE(numout,*) ' Total input of elements from atmospheric supply' |
---|
| 498 | WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
| 499 | WRITE(numout,*) ' N Supply : ', nitdepinput*rno3*1E3/1E12*14.,' TgN/yr' |
---|
| 500 | WRITE(numout,*) |
---|
| 501 | ENDIF |
---|
| 502 | ! |
---|
| 503 | IF( nn_timing == 1 ) CALL timing_stop('p4z_sbc_init') |
---|
| 504 | ! |
---|
| 505 | END SUBROUTINE p4z_sbc_init |
---|
| 506 | |
---|
| 507 | #else |
---|
| 508 | !!====================================================================== |
---|
| 509 | !! Dummy module : No PISCES bio-model |
---|
| 510 | !!====================================================================== |
---|
| 511 | CONTAINS |
---|
| 512 | SUBROUTINE p4z_sbc ! Empty routine |
---|
| 513 | END SUBROUTINE p4z_sbc |
---|
| 514 | #endif |
---|
| 515 | |
---|
| 516 | !!====================================================================== |
---|
[6808] | 517 | END MODULE p4zsbc |
---|