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.
trcini_medusa.F90 in branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA – NEMO

source: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90 @ 9163

Last change on this file since 9163 was 9114, checked in by frrh, 6 years ago

Apply changes developed under Met Office GMED ticket number 351 in development
branch branches/NERC/dev_r5518_GO6_ScalingCoupledChl.

The command issued to perform the merge is:

svn merge -r 8590:9053 svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/NERC/dev_r5518_GO6_ScalingCoupledChl

File size: 18.8 KB
Line 
1MODULE trcini_medusa
2   !!======================================================================
3   !!                         ***  MODULE trcini_medusa  ***
4   !! TOP :   initialisation of the MEDUSA tracers
5   !!======================================================================
6   !! History :   2.0  !  2007-12  (C. Ethe, G. Madec) Original code
7   !!              -   !  2008-08  (K. Popova) adaptation for MEDUSA
8   !!              -   !  2008-11  (A. Yool) continuing adaptation for MEDUSA
9   !!              -   !  2010-03  (A. Yool) updated for branch inclusion
10   !!              -   !  2011-04  (A. Yool) updated for ROAM project
11   !!----------------------------------------------------------------------
12#if defined key_medusa
13   !!----------------------------------------------------------------------
14   !!   'key_medusa'                                         MEDUSA tracers
15   !!----------------------------------------------------------------------
16   !! trc_ini_medusa   : MEDUSA model initialisation
17   !!----------------------------------------------------------------------
18   USE par_trc         ! TOP parameters
19   USE oce_trc
20   USE trc
21   USE in_out_manager
22   !! AXY (04/11/13): add this in for initialisation stuff
23   USE iom
24   USE par_medusa
25   !! AXY (13/01/12): add this in for sediment variables
26   USE sms_medusa
27   !! AXY (04/11/13): add this in for initialisation stuff
28   USE trcsed_medusa
29   USE sbc_oce, ONLY: lk_oasis
30   USE oce,     ONLY: CO2Flux_out_cpl, DMS_out_cpl, chloro_out_cpl  !! Coupling variable
31
32
33   IMPLICIT NONE
34   PRIVATE
35
36   PUBLIC   trc_ini_medusa   ! called by trcini.F90 module
37
38   !! AXY (25/02/10)
39   LOGICAL, PUBLIC ::                  &
40      bocalccd = .TRUE.
41   !! JPALM (14/09/15)
42   LOGICAL, PUBLIC ::                  &
43      ln_ccd = .TRUE.
44
45   INTEGER ::                          &
46      numccd
47
48   !! AXY (25/02/10)
49   INTEGER ::                          &
50      numriv
51
52   !!----------------------------------------------------------------------
53   !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007)
54   !! $Id$
55   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
56   !!----------------------------------------------------------------------
57
58CONTAINS
59
60   SUBROUTINE trc_ini_medusa
61      !!----------------------------------------------------------------------
62      !!                     ***  trc_ini_medusa  *** 
63      !!
64      !! ** Purpose :   initialization for MEDUSA model
65      !!
66      !! ** Method  : - Read the namcfc namelist and check the parameter values
67      !!----------------------------------------------------------------------
68      !!----------------------------------------------------------------------
69
70      !! vertical array index
71      INTEGER  ::    jk, ierr
72      !! AXY (19/07/12): added jk2 to set up friver_dep array
73      INTEGER            :: jk2
74      !! AXY (19/07/12): added tfthk to set up friver_dep array
75      REAL(wp)           :: fthk, tfthk
76      !! AXY (04/11/13): add in temporary variables for checks
77      REAL(wp)           :: fq0, fq1, fq2
78
79      IF(lwp) WRITE(numout,*)
80      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: initialisation of MEDUSA model'
81      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
82# if defined key_debug_medusa
83            CALL flush(numout)
84# endif
85
86                                           ! Allocate MEDUSA arrays
87      ierr =         sms_medusa_alloc()
88# if defined key_debug_medusa
89            IF (lwp) write (numout,*) '------------------------------'
90            IF (lwp) write (numout,*) 'Jpalm - debug'
91            IF (lwp) write (numout,*) 'in trc_ini_medusa, just after array allocate'
92            IF (lwp) write (numout,*) ' '
93            CALL flush(numout)
94# endif
95
96!!
97!! AXY (19/07/12): setup array to control distribution of river nutrients
98      friver_dep(:,:) = 0.
99      DO jk = 1,jpk
100         tfthk = 0.
101         DO jk2 = 1,jriver_dep
102            fthk  = e3t_1d(jk2)
103            if (jk2 .le. jk) then
104               tfthk = tfthk + fthk
105               friver_dep(jk2,jk) = fthk
106            endif
107         ENDDO
108         DO jk2 = 1,jriver_dep
109            friver_dep(jk2,jk) = friver_dep(jk2,jk) / tfthk
110         ENDDO
111      ENDDO
112!!
113!! Have a look at the result of this for a single depth (jriver_dep + 1)
114      IF(lwp) THEN
115          WRITE(numout,*) '=== River nutrient fraction by depth (for a water column of jpk depth)'
116          DO jk = 1,jpk
117             WRITE(numout,*)     &
118             &   ' cell = ', jk, ', friver_dep value = ', friver_dep(jk,jpk)
119          ENDDO
120          IF(lwp) CALL flush(numout)
121       ENDIF
122
123#if defined key_roam
124!! ROAM 3D and 2D carbonate system fields (calculated on first time
125!! step, then monthly)
126      f3_pH(:,:,:)    = 0.
127      f3_h2co3(:,:,:) = 0.
128      f3_hco3(:,:,:)  = 0.
129      f3_co3(:,:,:)   = 0.
130      f3_omcal(:,:,:) = 0.
131      f3_omarg(:,:,:) = 0.
132!!
133      f2_ccd_cal(:,:) = 0.
134      f2_ccd_arg(:,:) = 0.
135      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: carbonate fields initialised to zero'
136#endif
137      IF(lwp) CALL flush(numout)
138
139      !!----------------------------------------------------------------------
140      !! State variable initial conditions (all mmol / m3)
141      !!----------------------------------------------------------------------
142      !!     
143      !! biological and detrital components are initialised to nominal
144      !! values above 100 m depth and zero below; the latter condition
145      !! is applied since non-linear loss processes allow significant
146      !! concentrations of these components to persist at depth
147      !!
148      trn(:,:,:,jpchn) = 0.
149      trn(:,:,:,jpchd) = 0.
150      trn(:,:,:,jpphn) = 0.
151      trn(:,:,:,jpphd) = 0.
152      trn(:,:,:,jppds) = 0.
153      trn(:,:,:,jpzmi) = 0.
154      trn(:,:,:,jpzme) = 0.
155      trn(:,:,:,jpdet) = 0.
156      !!
157      DO jk = 1,13
158         !! non-diatom chlorophyll         (nominal)
159         trn(:,:,jk,jpchn) = 0.01
160         !!
161         !! diatom chlorophyll             (nominal)
162         trn(:,:,jk,jpchd) = 0.01
163         !!
164         !! non-diatom                     (nominal)
165         trn(:,:,jk,jpphn) = 0.01
166         !!
167         !! diatom                         (nominal)
168         trn(:,:,jk,jpphd) = 0.01
169         !!
170         !! diatom silicon                 (nominal)
171         trn(:,:,jk,jppds) = 0.01
172         !!
173         !! microzooplankton               (nominal)
174         trn(:,:,jk,jpzmi) = 0.01
175         !!
176         !! mesozooplankton                (nominal)
177         trn(:,:,jk,jpzme) = 0.01
178         !!
179         !! detrital nitrogen              (nominal)
180         trn(:,:,jk,jpdet) = 0.01
181      ENDDO
182      !!
183      !! dissolved inorganic nitrogen     (nominal average value; typically initialised from climatology)
184      trn(:,:,:,jpdin) = 30.
185      !!
186      !! dissolved silicic acid           (nominal average value; typically initialised from climatology)
187      trn(:,:,:,jpsil) = 90.
188      !!
189      !! dissolved "total" iron           (nominal; typically initialised from model-derived climatology)
190      trn(:,:,:,jpfer) = 1.0e-4           !! = 0.1 umol Fe / m3
191      !!
192      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: MEDUSA-1 fields initialised to defaults'
193# if defined key_roam
194      !!
195      !! detrital carbon                  (nominal)
196      trn(:,:,:,jpdtc) = 0.
197      DO jk = 1,13
198         trn(:,:,jk,jpdtc) = 0.06625
199      ENDDO
200      !!
201      !! dissolved inorganic carbon (DIC) (nominal average value; typically initialised from climatology)
202      trn(:,:,:,jpdic) = 2330.
203      !!
204      !! total alkalinity                 (nominal average value; typically initialised from climatology)
205      trn(:,:,:,jpalk) = 2450.
206      !!
207      !! dissolved oxygen                 (nominal average value; typically initialised from climatology)
208      trn(:,:,:,jpoxy) = 175.
209      !!
210      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: MEDUSA-2 fields initialised to defaults'
211# endif
212      IF(lwp) CALL flush(numout)
213
214      !!----------------------------------------------------------------------
215      !! Sediment pools initial conditions (all mmol / m2)
216      !!----------------------------------------------------------------------
217      !!     
218      !! these pools store biogenic material that has sunk to the seabed,
219      !! and act as a temporary reservoir
220      zb_sed_n(:,:)  = 0.0  !! organic N
221      zn_sed_n(:,:)  = 0.0
222      za_sed_n(:,:)  = 0.0
223      zb_sed_fe(:,:) = 0.0  !! organic Fe
224      zn_sed_fe(:,:) = 0.0
225      za_sed_fe(:,:) = 0.0
226      zb_sed_si(:,:) = 0.0  !! inorganic Si
227      zn_sed_si(:,:) = 0.0
228      za_sed_si(:,:) = 0.0
229      zb_sed_c(:,:)  = 0.0  !! organic C
230      zn_sed_c(:,:)  = 0.0
231      za_sed_c(:,:)  = 0.0
232      zb_sed_ca(:,:) = 0.0  !! inorganic C
233      zn_sed_ca(:,:) = 0.0
234      za_sed_ca(:,:) = 0.0
235      !!
236      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: benthic fields initialised to zero'
237      IF(lwp) CALL flush(numout)
238     
239      !!----------------------------------------------------------------------
240      !! Averaged properties for DMS calculations (various units)
241      !!----------------------------------------------------------------------
242      !!     
243      !! these store temporally averaged properties for DMS calculations (AXY, 07/07/15)
244      zb_dms_chn(:,:)  = 0.0  !! CHN
245      zn_dms_chn(:,:)  = 0.0
246      za_dms_chn(:,:)  = 0.0
247      zb_dms_chd(:,:)  = 0.0  !! CHD
248      zn_dms_chd(:,:)  = 0.0
249      za_dms_chd(:,:)  = 0.0
250      zb_dms_mld(:,:)  = 0.0  !! MLD
251      zn_dms_mld(:,:)  = 0.0
252      za_dms_mld(:,:)  = 0.0
253      zb_dms_qsr(:,:)  = 0.0  !! QSR
254      zn_dms_qsr(:,:)  = 0.0
255      za_dms_qsr(:,:)  = 0.0
256      zb_dms_din(:,:)  = 0.0  !! DIN
257      zn_dms_din(:,:)  = 0.0
258      za_dms_din(:,:)  = 0.0
259      !!
260      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: average fields for DMS initialised to zero'
261      IF(lwp) CALL flush(numout)
262      !!
263      !!---------------------------------------------------------------------
264      !!JPALM (14-06-2016): init dms and co2 flux for coupling with atm (UKESM)
265      !!---------------------------------------------------------------------
266      !!
267      zb_co2_flx(:,:)  = 0.0  !! CO2 flx
268      zn_co2_flx(:,:)  = 0.0
269      za_co2_flx(:,:)  = 0.0
270      zb_dms_srf(:,:)  = 0.0  !! DMS srf
271      zn_dms_srf(:,:)  = 0.0
272      za_dms_srf(:,:)  = 0.0
273      zn_chl_srf(:,:)  = 2.0E-8 !! Chl cpl - set first as surf
274      !!
275      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: DMS and CO2 flux (UKESM) initialised to zero'
276      IF(lwp) CALL flush(numout)
277      IF (lk_oasis) THEN
278         CO2Flux_out_cpl(:,:) =  zn_co2_flx(:,:)   !! Coupling variable
279         DMS_out_cpl(:,:)     =  zn_dms_srf(:,:)   !! Coupling variable
280         chloro_out_cpl(:,:)  =  zn_chl_srf(:,:) * scl_chl   !! Coupling variable
281      END IF
282      !!
283      !!----------------------------------------------------------------------
284      !! AXY (04/11/13): initialise fields previously done by trc_sed_medusa
285      !!----------------------------------------------------------------------
286      !!     
287      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: initialising dust deposition fields'
288      CALL trc_sed_medusa_sbc( nit000 )
289      !!
290      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: initialising ocean CCD array'
291      CALL trc_ini_medusa_ccd( nit000 )
292      fq0 = MINVAL(ocal_ccd(:,:))
293      fq1 = MAXVAL(ocal_ccd(:,:))
294      if (lwp) write (numout,'(a,f10.3,a,f10.3)') & 
295         & 'CCD: min ', fq0, ' max ', fq1
296      !!
297      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: initialising riverine nutrient arrays'
298      riv_n(:,:)   = 0.0
299      riv_si(:,:)  = 0.0
300      riv_c(:,:)   = 0.0
301      riv_alk(:,:) = 0.0 
302      !!
303      CALL trc_ini_medusa_river( nit000 )
304      fq0 = MINVAL(riv_n(:,:))
305      fq1 = MAXVAL(riv_n(:,:))
306      if (lwp) write (numout,'(a,f10.3,a,f10.3)') & 
307         & 'RIV_N:   min ', fq0, ' max ', fq1
308      fq0 = MINVAL(riv_si(:,:))
309      fq1 = MAXVAL(riv_si(:,:))
310      if (lwp) write (numout,'(a,f10.3,a,f10.3)') & 
311         & 'RIV_SI:  min ', fq0, ' max ', fq1
312      fq0 = MINVAL(riv_c(:,:))
313      fq1 = MAXVAL(riv_c(:,:))
314      if (lwp) write (numout,'(a,f10.3,a,f10.3)') & 
315         & 'RIV_C:   min ', fq0, ' max ', fq1
316      fq0 = MINVAL(riv_alk(:,:))
317      fq1 = MAXVAL(riv_alk(:,:))
318      if (lwp) write (numout,'(a,f10.3,a,f10.3)') & 
319         & 'RIV_ALK: min ', fq0, ' max ', fq1
320      IF(lwp) CALL flush(numout)
321
322      IF(lwp) WRITE(numout,*)
323      IF(lwp) WRITE(numout,*) ' trc_ini_medusa: MEDUSA initialised'
324      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
325      IF(lwp) CALL flush(numout)
326
327   END SUBROUTINE trc_ini_medusa
328
329   !! ======================================================================
330   !! ======================================================================
331   !! ======================================================================
332
333   !! AXY (25/02/10)
334   SUBROUTINE trc_ini_medusa_ccd(kt)
335
336      !!----------------------------------------------------------------------
337      !!                  ***  ROUTINE trc_ini_medusa_ccd  ***
338      !!
339      !! ** Purpose :   Read CCD field
340      !!
341      !! ** Method  :   Read the file
342      !!
343      !! ** input   :   external netcdf files
344      !!
345      !!----------------------------------------------------------------------
346      !! * arguments
347      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
348
349      !!---------------------------------------------------------------------
350
351      !! Open the file
352      !! -------------
353      !!
354      !!!! JPALM -- 14-09-2015 --
355      !!!!       -- to test on ORCA2 with Christian, no file available, so initiate to 0
356      IF (ln_ccd) THEN
357         IF(lwp) WRITE(numout,*) ' '
358         IF(lwp) WRITE(numout,*) ' **** Routine trc_ini_medusa_ccd'
359         CALL iom_open ( 'ccd_ocal_nemo.nc', numccd )
360         IF(lwp) WRITE(numout,*) ' **** trc_ini_medusa_ccd: ccd_ocal_nemo.nc opened'
361
362      !! Read the data
363      !! -------------
364      !!
365         CALL iom_get ( numccd, jpdom_data, 'OCAL_CCD', ocal_ccd )
366         IF(lwp) WRITE(numout,*) ' **** trc_ini_medusa_ccd: data read'
367
368      !! Close the file
369      !! --------------
370      !!
371         CALL iom_close ( numccd )
372         IF(lwp) WRITE(numout,*) ' **** trc_ini_medusa_ccd: ccd_ocal_nemo.nc closed'
373         IF(lwp) CALL flush(numout)
374      ELSE
375         IF(lwp) WRITE(numout,*) ' '
376         IF(lwp) WRITE(numout,*) ' **** Routine trc_ini_medusa_ccd'
377         IF(lwp) WRITE(numout,*) ' **** trc_ini_medusa_ccd: do not read ccd_ocal_nemo.nc'
378         IF(lwp) WRITE(numout,*) ' **** ln_ccd = FALSE and ocal_ccd = 0.0 ---'
379         ocal_ccd(:,:) = 0.0 
380      ENDIF
381 
382   END SUBROUTINE trc_ini_medusa_ccd
383
384   !! ======================================================================
385   !! ======================================================================
386   !! ======================================================================
387
388   !! AXY (26/01/12)
389   SUBROUTINE trc_ini_medusa_river(kt)
390
391      !!----------------------------------------------------------------------
392      !!                  ***  ROUTINE trc_ini_medusa_river  ***
393      !!
394      !! ** Purpose :   Read riverine nutrient fields
395      !!
396      !! ** Method  :   Read the file
397      !!
398      !! ** input   :   external netcdf files
399      !!
400      !!----------------------------------------------------------------------
401      !! * arguments
402      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
403
404      !!---------------------------------------------------------------------
405
406      IF(lwp) THEN
407         WRITE(numout,*) ' '
408         WRITE(numout,*) ' **** Routine trc_ini_medusa_river'
409         WRITE(numout,*) ' '
410      ENDIF
411
412      !! Open and read the files
413      !! -----------------------
414      !!
415      if (jriver_n.gt.0) then
416         if (jriver_n.eq.1) CALL iom_open ( 'river_N_conc_orca100.nc', numriv )
417         if (jriver_n.eq.2) CALL iom_open ( 'river_N_flux_orca100.nc', numriv )
418         CALL iom_get  ( numriv, jpdom_data, 'RIV_N', riv_n )
419         IF(lwp) THEN
420            if (jriver_n.eq.1) WRITE(numout,*) ' **** trc_ini_medusa_river: N CONC data read'
421            if (jriver_n.eq.2) WRITE(numout,*) ' **** trc_ini_medusa_river: N FLUX data read'
422         ENDIF
423         CALL iom_close ( numriv )
424         IF(lwp) WRITE(numout,*) ' **** trc_ini_medusa_river: river N file closed'
425      else
426         IF(lwp) THEN
427            WRITE(numout,*) ' **** trc_ini_medusa_river: N data NOT read'
428         ENDIF
429      endif
430      !!
431      if (jriver_si.gt.0) then
432         if (jriver_si.eq.1) CALL iom_open ( 'river_Si_conc_orca100.nc', numriv )
433         if (jriver_si.eq.2) CALL iom_open ( 'river_Si_flux_orca100.nc', numriv )
434         CALL iom_get  ( numriv, jpdom_data, 'RIV_SI', riv_si )
435         IF(lwp) THEN
436            if (jriver_si.eq.1) WRITE(numout,*) ' **** trc_ini_medusa_river: Si CONC data read'
437            if (jriver_si.eq.2) WRITE(numout,*) ' **** trc_ini_medusa_river: Si FLUX data read'
438         ENDIF
439         CALL iom_close ( numriv )
440         IF(lwp) WRITE(numout,*) ' **** trc_ini_medusa_river: river Si file closed'
441      else
442         IF(lwp) THEN
443            WRITE(numout,*) ' **** trc_ini_medusa_river: Si data NOT read'
444         ENDIF
445      endif
446      !!
447      if (jriver_c.gt.0) then
448         if (jriver_c.eq.1) CALL iom_open ( 'river_C_conc_orca100.nc', numriv )
449         if (jriver_c.eq.2) CALL iom_open ( 'river_C_flux_orca100.nc', numriv )
450         CALL iom_get  ( numriv, jpdom_data, 'RIV_C', riv_c )
451         IF(lwp) THEN
452            if (jriver_c.eq.1) WRITE(numout,*) ' **** trc_ini_medusa_river: C CONC data read'
453            if (jriver_c.eq.2) WRITE(numout,*) ' **** trc_ini_medusa_river: C FLUX data read'
454         ENDIF
455         CALL iom_close ( numriv )
456         IF(lwp) WRITE(numout,*) ' **** trc_ini_medusa_river: river C file closed'
457      else
458         IF(lwp) THEN
459            WRITE(numout,*) ' **** trc_ini_medusa_river: C data NOT read'
460         ENDIF
461      endif
462      !!
463      if (jriver_alk.gt.0) then
464         if (jriver_alk.eq.1) CALL iom_open ( 'river_alk_conc_orca100.nc', numriv )
465         if (jriver_alk.eq.2) CALL iom_open ( 'river_alk_flux_orca100.nc', numriv )
466         CALL iom_get  ( numriv, jpdom_data, 'RIV_ALK', riv_alk )
467         IF(lwp) THEN
468            if (jriver_alk.eq.1) WRITE(numout,*) ' **** trc_ini_medusa_river: alkalinity CONC data read'
469            if (jriver_alk.eq.2) WRITE(numout,*) ' **** trc_ini_medusa_river: alkalinity FLUX data read'
470         ENDIF
471         CALL iom_close ( numriv )
472         IF(lwp) WRITE(numout,*) ' **** trc_ini_medusa_river: river alkalinity file closed'
473      else
474         IF(lwp) THEN
475            WRITE(numout,*) ' **** trc_ini_medusa_river: alkalinity data NOT read'
476         ENDIF
477      endif
478      IF(lwp) CALL flush(numout)
479
480   END SUBROUTINE trc_ini_medusa_river
481   
482#else
483   !!----------------------------------------------------------------------
484   !!   Dummy module                                        No MEDUSA model
485   !!----------------------------------------------------------------------
486CONTAINS
487   SUBROUTINE trc_ini_medusa             ! Empty routine
488   END SUBROUTINE trc_ini_medusa
489#endif
490
491   !!======================================================================
492END MODULE trcini_medusa
Note: See TracBrowser for help on using the repository browser.