New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
seddta.F90 in NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/TOP/PISCES/SED – NEMO

source: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/TOP/PISCES/SED/seddta.F90 @ 10345

Last change on this file since 10345 was 10345, checked in by smasson, 5 years ago

dev_r10164_HPC09_ESIWACE_PREP_MERGE: merge with trunk@10344, see #2133

  • Property svn:keywords set to Id
File size: 9.6 KB
Line 
1MODULE seddta
2   !!======================================================================
3   !!                     ***  MODULE  seddta  ***
4   !! Sediment data  :  read sediment input data from a file
5   !!=====================================================================
6
7   !! * Modules used
8   USE sed
9   USE sedarr
10   USE phycst, ONLY : rday
11   USE iom
12   USE lib_mpp         ! distribued memory computing library
13
14   IMPLICIT NONE
15   PRIVATE
16
17   !! * Routine accessibility
18   PUBLIC sed_dta   !
19
20   !! *  Module variables
21   REAL(wp) ::  rsecday  ! number of second per a day
22   REAL(wp) ::  conv2    ! [kg/m2/month]-->[g/cm2/s] ( 1 month has 30 days )
23
24   !! $Id$
25CONTAINS
26
27   !!---------------------------------------------------------------------------
28   !!   sed_dta  : read the NetCDF data file in online version using module iom
29   !!---------------------------------------------------------------------------
30
31   SUBROUTINE sed_dta( kt )
32      !!----------------------------------------------------------------------
33      !!                   ***  ROUTINE sed_dta  ***
34      !!                   
35      !! ** Purpose :   Reads data from a netcdf file and
36      !!                initialization of rain and pore water (k=1) components
37      !!
38      !!
39      !!   History :
40      !!        !  04-10  (N. Emprin, M. Gehlen )  Original code
41      !!        !  06-04  (C. Ethe)  Re-organization ; Use of iom
42      !!----------------------------------------------------------------------
43
44      !! Arguments
45      INTEGER, INTENT(in) ::  kt    ! time-step
46
47      !! * Local declarations
48      INTEGER  ::  ji, jj, js, jw, ikt
49
50      REAL(wp), DIMENSION(jpoce) :: zdtap, zdtag
51      REAL(wp), DIMENSION(jpi,jpj) :: zwsbio4, zwsbio3, zwscal
52      REAL(wp) :: zf0, zf1, zf2, zkapp, zratio, zdep
53
54      !----------------------------------------------------------------------
55
56      ! Initialization of sediment variable
57      ! Spatial dimension is merged, and unity converted if needed
58      !-------------------------------------------------------------
59
60      IF( ln_timing )  CALL timing_start('sed_dta')
61
62      IF (lwp) THEN
63         WRITE(numsed,*)
64         WRITE(numsed,*) ' sed_dta : Bottom layer fields'
65         WRITE(numsed,*) ' ~~~~~~'
66         WRITE(numsed,*) ' Data from SMS model'
67         WRITE(numsed,*)
68      ENDIF
69
70
71      ! open file
72      IF( kt == nitsed000 ) THEN
73         IF (lwp) WRITE(numsed,*) ' sed_dta : Sediment fields'
74         dtsed = r2dttrc
75         rsecday = 60.* 60. * 24.
76!         conv2   = 1.0e+3 / ( 1.0e+4 * rsecday * 30. )
77         conv2 = 1.0e+3 /  1.0e+4 
78         rdtsed(2:jpksed) = dtsed / ( denssol * por1(2:jpksed) )
79      ENDIF
80
81      ! Initialization of temporaries arrays 
82      zdtap(:)    = 0. 
83      zdtag(:)    = 0. 
84
85      ! reading variables
86      IF (lwp) WRITE(numsed,*)
87      IF (lwp) WRITE(numsed,*) ' sed_dta : Bottom layer fields at time  kt = ', kt
88      ! reading variables
89      !
90      !    Sinking speeds of detritus is increased with depth as shown
91      !    by data and from the coagulation theory
92      !    -----------------------------------------------------------
93      IF (ln_sediment_offline) THEN
94         DO jj = 1, jpj
95            DO ji = 1, jpi
96               ikt = mbkt(ji,jj)
97               zwsbio4(ji,jj) = wsbio2 / rday
98               zwsbio3(ji,jj) = wsbio  / rday
99               zwscal (ji,jj) = wsbio2 / rday
100            END DO
101         END DO
102      ELSE
103         DO jj = 1, jpj
104            DO ji = 1, jpi
105               ikt = mbkt(ji,jj)
106               zdep = e3t_n(ji,jj,ikt) / r2dttrc
107               zwsbio4(ji,jj) = MIN( 0.99 * zdep, wsbio4(ji,jj,ikt) / rday )
108               zwscal (ji,jj) = MIN( 0.99 * zdep, wscal (ji,jj,ikt) / rday )
109               zwsbio3(ji,jj) = MIN( 0.99 * zdep, wsbio3(ji,jj,ikt) / rday )
110            END DO
111         END DO
112      ENDIF
113
114      trc_data(:,:,:) = 0.
115      DO jj = 1,jpj
116         DO ji = 1, jpi
117            ikt = mbkt(ji,jj)
118            IF ( tmask(ji,jj,ikt) == 1 ) THEN
119               trc_data(ji,jj,1)   = trb(ji,jj,ikt,jpsil)
120               trc_data(ji,jj,2)   = trb(ji,jj,ikt,jpoxy)
121               trc_data(ji,jj,3)   = trb(ji,jj,ikt,jpdic)
122               trc_data(ji,jj,4)   = trb(ji,jj,ikt,jpno3) / 7.625
123               trc_data(ji,jj,5)   = trb(ji,jj,ikt,jppo4) / 122.
124               trc_data(ji,jj,6)   = trb(ji,jj,ikt,jptal)
125               trc_data(ji,jj,7)   = trb(ji,jj,ikt,jpnh4) / 7.625
126               trc_data(ji,jj,8)   = 0.0
127               trc_data(ji,jj,9)   = 28.0E-3
128               trc_data(ji,jj,10)  = trb(ji,jj,ikt,jpfer)
129               trc_data(ji,jj,11 ) = MIN(trb(ji,jj,ikt,jpgsi), 1E-4) * zwsbio4(ji,jj) * 1E3
130               trc_data(ji,jj,12 ) = MIN(trb(ji,jj,ikt,jppoc), 1E-4) * zwsbio3(ji,jj) * 1E3
131               trc_data(ji,jj,13 ) = MIN(trb(ji,jj,ikt,jpgoc), 1E-4) * zwsbio4(ji,jj) * 1E3
132               trc_data(ji,jj,14)  = MIN(trb(ji,jj,ikt,jpcal), 1E-4) * zwscal (ji,jj) * 1E3
133               trc_data(ji,jj,15)  = tsn(ji,jj,ikt,jp_tem)
134               trc_data(ji,jj,16)  = tsn(ji,jj,ikt,jp_sal)
135               trc_data(ji,jj,17 ) = ( trb(ji,jj,ikt,jpsfe) * zwsbio3(ji,jj) + trb(ji,jj,ikt,jpbfe)  &
136               &                     * zwsbio4(ji,jj)  ) * 1E3 / ( trc_data(ji,jj,12 ) + trc_data(ji,jj,13 ) + rtrn )
137               trc_data(ji,jj,17 ) = MIN(1E-3, trc_data(ji,jj,17 ) )
138            ENDIF
139         ENDDO
140      ENDDO
141
142      ! Pore water initial concentration [mol/l] in  k=1
143      !-------------------------------------------------
144      DO jw = 1, jpwat
145         CALL pack_arr ( jpoce,  pwcp_dta(1:jpoce,jw), trc_data(1:jpi,1:jpj,jw), iarroce(1:jpoce) )
146      END DO
147      !  Solid components :
148      !-----------------------
149      !  Sinking fluxes for OPAL in mol.m-2.s-1 ; conversion in mol.cm-2.s-1
150      CALL pack_arr ( jpoce, rainrm_dta(1:jpoce,jsopal), trc_data(1:jpi,1:jpj,11), iarroce(1:jpoce) ) 
151      rainrm_dta(1:jpoce,jsopal) = rainrm_dta(1:jpoce,jsopal) * 1e-4
152      !  Sinking fluxes for POC in mol.m-2.s-1 ; conversion in mol.cm-2.s-1
153      CALL pack_arr ( jpoce, zdtap(1:jpoce), trc_data(1:jpi,1:jpj,12) , iarroce(1:jpoce) )     
154      CALL pack_arr ( jpoce, zdtag(1:jpoce), trc_data(1:jpi,1:jpj,13) , iarroce(1:jpoce) )
155      DO ji = 1, jpoce
156!        zkapp  = MIN( (1.0 - 0.02 ) * reac_poc, 3731.0 * max(100.0, zkbot(ji) )**(-1.011) / ( 365.0 * 24.0 * 3600.0 ) )
157!        zkapp   = MIN( 0.98 * reac_poc, 100.0 * max(100.0, zkbot(ji) )**(-0.6) / ( 365.0 * 24.0 * 3600.0 ) )
158!        zratio = ( ( 1.0 - 0.02 ) * reac_poc + 0.02 * reac_poc * 0. - zkapp) / ( ( 0.02 - 1.0 ) * reac_poc / 100. - 0.02 * reac_poc * 0. + zkapp )
159!        zf1    = ( 0.02 * (reac_poc - reac_poc * 0.) + zkapp - reac_poc ) / ( reac_poc / 100. - reac_poc )
160!        zf1    = MIN(0.98, MAX(0., zf1 ) )
161         zf1    = 0.48
162         zf0    = 1.0 - 0.02 - zf1
163         zf2    = 0.02
164         rainrm_dta(ji,jspoc) =   ( zdtap(ji) +  zdtag(ji) ) * 1e-4 * zf0
165         rainrm_dta(ji,jspos) =   ( zdtap(ji) +  zdtag(ji) ) * 1e-4 * zf1
166         rainrm_dta(ji,jspor) =   ( zdtap(ji) +  zdtag(ji) ) * 1e-4 * zf2
167      END DO
168      !  Sinking fluxes for Calcite in mol.m-2.s-1 ; conversion in mol.cm-2.s-1
169      CALL pack_arr ( jpoce,  rainrm_dta(1:jpoce,jscal), trc_data(1:jpi,1:jpj,14), iarroce(1:jpoce) )
170      rainrm_dta(1:jpoce,jscal) = rainrm_dta(1:jpoce,jscal) * 1e-4
171      ! vector temperature [°C] and salinity
172      CALL pack_arr ( jpoce,  temp(1:jpoce), trc_data(1:jpi,1:jpj,15), iarroce(1:jpoce) )
173      CALL pack_arr ( jpoce,  salt(1:jpoce), trc_data(1:jpi,1:jpj,16), iarroce(1:jpoce) )
174     
175      ! Clay rain rate in [mol/(cm**2.s)]
176      ! inputs data in [kg.m-2.sec-1] ---> 1e+3/(1e+4) [g.cm-2.s-1]   
177      ! divided after by molecular weight g.mol-1     
178      CALL pack_arr ( jpoce,  rainrm_dta(1:jpoce,jsclay), dust(1:jpi,1:jpj), iarroce(1:jpoce) )
179      rainrm_dta(1:jpoce,jsclay) = rainrm_dta(1:jpoce,jsclay) * conv2 / mol_wgt(jsclay)   &
180      &                            + wacc(1:jpoce) * por1(2) * denssol / mol_wgt(jsclay) / ( rsecday * 365.0 )
181      rainrm_dta(1:jpoce,jsclay) = rainrm_dta(1:jpoce,jsclay) * 0.965
182      rainrm_dta(1:jpoce,jsfeo)  = rainrm_dta(1:jpoce,jsclay) * mol_wgt(jsclay) / mol_wgt(jsfeo) * 0.035 / 0.965
183!    rainrm_dta(1:jpoce,jsclay) = 1.0E-4 * conv2 / mol_wgt(jsclay)
184
185      ! Iron monosulphide rain rates. Set to 0
186      rainrm_dta(1:jpoce,jsfes)  = 0. 
187
188      ! Fe/C ratio in sinking particles that fall to the sediments
189      CALL pack_arr ( jpoce,  fecratio(1:jpoce), trc_data(1:jpi,1:jpj,17), iarroce(1:jpoce) )
190
191      sedligand(:,1) = 1.E-9
192
193      ! sediment pore water at 1st layer (k=1)
194      DO jw = 1, jpwat
195         pwcp(1:jpoce,1,jw) = pwcp_dta(1:jpoce,jw)
196      ENDDO
197
198      !  rain
199      DO js = 1, jpsol
200         rainrm(1:jpoce,js) = rainrm_dta(1:jpoce,js)
201      ENDDO
202
203      ! Calculation of raintg of each sol. comp.: rainrm in [g/(cm**2.s)]
204      DO js = 1, jpsol
205         rainrg(1:jpoce,js) = rainrm(1:jpoce,js) *  mol_wgt(js)
206      ENDDO
207
208      ! Calculation of raintg = total massic flux rained in each cell (sum of sol. comp.)
209      raintg(:) = 0.
210      DO js = 1, jpsol
211         raintg(1:jpoce) = raintg(1:jpoce) + rainrg(1:jpoce,js)
212      ENDDO
213
214      ! computation of dzdep = total thickness of solid material rained [cm] in each cell
215      dzdep(1:jpoce) = raintg(1:jpoce) * rdtsed(2) 
216
217      IF( lk_iomput ) THEN
218          IF( iom_use("sflxclay" ) ) CALL iom_put( "sflxclay", dust(:,:) * conv2 * 1E4 )
219          IF( iom_use("sflxcal" ) )  CALL iom_put( "sflxcal", trc_data(:,:,13) )
220          IF( iom_use("sflxbsi" ) )  CALL iom_put( "sflxbsi", trc_data(:,:,10) )
221          IF( iom_use("sflxpoc" ) )  CALL iom_put( "sflxpoc", trc_data(:,:,11) + trc_data(:,:,12) )
222      ENDIF
223
224      IF( ln_timing )  CALL timing_stop('sed_dta')
225     
226   END SUBROUTINE sed_dta
227
228END MODULE seddta
Note: See TracBrowser for help on using the repository browser.