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.
trcnam.F90 in NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/TOP – NEMO

source: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/TOP/trcnam.F90 @ 12808

Last change on this file since 12808 was 12489, checked in by davestorkey, 4 years ago

Preparation for new timestepping scheme #2390.
Main changes:

  1. Initial euler timestep now handled in stp and not in TRA/DYN routines.
  2. Renaming of all timestep parameters. In summary, the namelist parameter is now rn_Dt and the current timestep is rDt (and rDt_ice, rDt_trc etc).
  3. Renaming of a few miscellaneous parameters, eg. atfp -> rn_atfp (namelist parameter used everywhere) and rau0 -> rho0.

This version gives bit-comparable results to the previous version of the trunk.

  • Property svn:keywords set to Id
File size: 13.5 KB
Line 
1MODULE trcnam
2   !!======================================================================
3   !!                       ***  MODULE trcnam  ***
4   !! TOP :   Read and print options for the passive tracer run (namelist)
5   !!======================================================================
6   !! History :    -   !  1996-11  (M.A. Foujols, M. Levy)  original code
7   !!              -   !  1998-04  (M.A Foujols, L. Bopp) ahtrb0 for isopycnal mixing
8   !!              -   !  1999-10  (M.A. Foujols, M. Levy) separation of sms
9   !!              -   !  2000-07  (A. Estublier) add TVD and MUSCL : Tests on ndttrc
10   !!              -   !  2000-11  (M.A Foujols, E Kestenare) trcrat, ahtrc0 and aeivtr0
11   !!              -   !  2001-01 (E Kestenare) suppress ndttrc=1 for CEN2 and TVD schemes
12   !!             1.0  !  2005-03 (O. Aumont, A. El Moussaoui) F90
13   !!----------------------------------------------------------------------
14#if defined key_top
15   !!----------------------------------------------------------------------
16   !!   'key_top'                                                TOP models
17   !!----------------------------------------------------------------------
18   !!   trc_nam    :  Read and print options for the passive tracer run (namelist)
19   !!----------------------------------------------------------------------
20   USE oce_trc     ! shared variables between ocean and passive tracers
21   USE trc         ! passive tracers common variables
22   USE trd_oce     !       
23   USE trdtrc_oce  !
24   USE iom         ! I/O manager
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   trc_nam_run  ! called in trcini
30   PUBLIC   trc_nam      ! called in trcini
31
32   TYPE(PTRACER), DIMENSION(jpmaxtrc), PUBLIC  :: sn_tracer  !: type of tracer for saving if not key_iomput
33
34   !!----------------------------------------------------------------------
35   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
36   !! $Id$
37   !! Software governed by the CeCILL license (see ./LICENSE)
38   !!----------------------------------------------------------------------
39CONTAINS
40
41   SUBROUTINE trc_nam
42      !!---------------------------------------------------------------------
43      !!                     ***  ROUTINE trc_nam  ***
44      !!
45      !! ** Purpose :   READ and PRINT options for the passive tracer run (namelist)
46      !!
47      !! ** Method  : - read passive tracer namelist
48      !!              - read namelist of each defined SMS model
49      !!                ( (PISCES, CFC, MY_TRC )
50      !!---------------------------------------------------------------------
51      INTEGER  ::   jn   ! dummy loop indice
52      !!---------------------------------------------------------------------
53      !
54      IF( .NOT.l_offline )   CALL trc_nam_run     ! Parameters of the run                                 
55      !               
56      CALL trc_nam_trc                            ! passive tracer informations
57      !                                       
58      IF( ln_rsttr                     )   ln_trcdta = .FALSE.   ! restart : no need of clim data
59      !
60      IF( ln_trcdmp .OR. ln_trcdmp_clo )   ln_trcdta = .TRUE.    ! damping : need to have clim data
61      !
62      !
63      IF(lwp) THEN                   ! control print
64         IF( ln_rsttr ) THEN
65            WRITE(numout,*)
66            WRITE(numout,*) '   ==>>>   Read a restart file for passive tracer : ', TRIM( cn_trcrst_in )
67         ENDIF
68         IF( ln_trcdta .AND. .NOT.ln_rsttr ) THEN
69            WRITE(numout,*)
70            WRITE(numout,*) '   ==>>>   Some of the passive tracers are initialised from climatologies '
71         ENDIF
72         IF( .NOT.ln_trcdta ) THEN
73            WRITE(numout,*)
74            WRITE(numout,*) '   ==>>>   All the passive tracers are initialised with constant values '
75         ENDIF
76      ENDIF
77      !
78      IF(lwp) THEN                              ! control print
79        WRITE(numout,*) 
80        WRITE(numout,*) '   ==>>>   Passive Tracer time step = rn_Dt = ', rn_Dt
81      ENDIF
82      !
83      IF( l_trdtrc )        CALL trc_nam_trd    ! Passive tracer trends
84      !
85   END SUBROUTINE trc_nam
86
87
88   SUBROUTINE trc_nam_run
89      !!---------------------------------------------------------------------
90      !!                     ***  ROUTINE trc_nam  ***
91      !!
92      !! ** Purpose :   read options for the passive tracer run (namelist)
93      !!
94      !!---------------------------------------------------------------------
95      INTEGER  ::   ios   ! Local integer
96      !!
97      NAMELIST/namtrc_run/ ln_rsttr, nn_rsttr, ln_top_euler, &
98        &                  cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out
99      !!---------------------------------------------------------------------
100      !
101      IF(lwp) WRITE(numout,*)
102      IF(lwp) WRITE(numout,*) 'trc_nam_run : read the passive tracer namelists'
103      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
104      !
105      CALL load_nml( numnat_ref, 'namelist_top_ref' , numout, lwm )
106      CALL load_nml( numnat_cfg, 'namelist_top_cfg' , numout, lwm )
107      IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 )
108      !
109      READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901)
110901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc in reference namelist' )
111      READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 )
112902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc in configuration namelist' )
113      IF(lwm) WRITE( numont, namtrc_run )
114
115      nittrc000 = nit000             ! first time step of tracer model
116
117      IF(lwp) THEN                   ! control print
118         WRITE(numout,*) '   Namelist : namtrc_run'
119         WRITE(numout,*) '      restart  for passive tracer                  ln_rsttr      = ', ln_rsttr
120         WRITE(numout,*) '      control of time step for passive tracer      nn_rsttr      = ', nn_rsttr
121         WRITE(numout,*) '      first time step for pass. trac.              nittrc000     = ', nittrc000
122         WRITE(numout,*) '      Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler
123      ENDIF
124      !
125   END SUBROUTINE trc_nam_run
126
127
128   SUBROUTINE trc_nam_trc
129      !!---------------------------------------------------------------------
130      !!                     ***  ROUTINE trc_nam  ***
131      !!
132      !! ** Purpose :   read options for the passive tracer run (namelist)
133      !!
134      !!---------------------------------------------------------------------
135      INTEGER ::   ios, ierr, icfc       ! Local integer
136      !!
137      NAMELIST/namtrc/jp_bgc, ln_pisces, ln_my_trc, ln_age, ln_cfc11, ln_cfc12, ln_sf6, ln_c14, &
138         &            sn_tracer, ln_trcdta, ln_trcbc, ln_trcdmp, ln_trcdmp_clo, jp_dia3d, jp_dia2d
139      !!---------------------------------------------------------------------
140      ! Dummy settings to fill tracers data structure
141      !                  !   name   !   title   !   unit   !   init  !   sbc   !   cbc   !   obc  !
142      sn_tracer = PTRACER( 'NONAME' , 'NOTITLE' , 'NOUNIT' , .false. , .false. , .false. , .false.)
143      !
144      IF(lwp) WRITE(numout,*)
145      IF(lwp) WRITE(numout,*) 'trc_nam_trc : read the passive tracer namelists'
146      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
147
148      READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901)
149901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc in reference namelist' )
150      READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 )
151902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc in configuration namelist' )
152      IF(lwm) WRITE( numont, namtrc )
153
154      ! Control settings
155      IF( ln_pisces .AND. ln_my_trc )   CALL ctl_stop( 'Choose only ONE BGC model - PISCES or MY_TRC' )
156      IF( .NOT. ln_pisces .AND. .NOT. ln_my_trc )   jp_bgc = 0
157      ll_cfc = ln_cfc11 .OR. ln_cfc12 .OR. ln_sf6
158      !
159      jptra       =  0
160      jp_pisces   =  0    ;   jp_pcs0  =  0    ;   jp_pcs1  = 0
161      jp_my_trc   =  0    ;   jp_myt0  =  0    ;   jp_myt1  = 0
162      jp_cfc      =  0    ;   jp_cfc0  =  0    ;   jp_cfc1  = 0
163      jp_age      =  0    ;   jp_c14   =  0
164      !
165      IF( ln_pisces )  THEN
166         jp_pisces = jp_bgc
167         jp_pcs0   = 1
168         jp_pcs1   = jp_pisces
169      ENDIF
170      IF( ln_my_trc )  THEN
171          jp_my_trc = jp_bgc
172          jp_myt0   = 1
173          jp_myt1   = jp_my_trc
174      ENDIF
175      !
176      jptra  = jp_bgc
177      !
178      IF( ln_age )    THEN
179         jptra     = jptra + 1
180         jp_age    = jptra
181      ENDIF
182      IF( ln_cfc11 )  jp_cfc = jp_cfc + 1
183      IF( ln_cfc12 )  jp_cfc = jp_cfc + 1
184      IF( ln_sf6   )  jp_cfc = jp_cfc + 1
185      IF( ll_cfc )    THEN
186          jptra     = jptra + jp_cfc
187          jp_cfc0   = jptra - jp_cfc + 1
188          jp_cfc1   = jptra
189      ENDIF
190      IF( ln_c14 )    THEN
191           jptra     = jptra + 1
192           jp_c14    = jptra
193      ENDIF
194      !
195      IF( jptra == 0 )   CALL ctl_stop( 'All TOP tracers disabled: change namtrc setting or check if key_top is active' )
196      !
197      IF(lwp) THEN                   ! control print
198         WRITE(numout,*) '   Namelist : namtrc'
199         WRITE(numout,*) '      Total number of passive tracers              jptra         = ', jptra
200         WRITE(numout,*) '      Total number of BGC tracers                  jp_bgc        = ', jp_bgc
201         WRITE(numout,*) '      Simulating PISCES model                      ln_pisces     = ', ln_pisces
202         WRITE(numout,*) '      Simulating MY_TRC  model                     ln_my_trc     = ', ln_my_trc
203         WRITE(numout,*) '      Simulating water mass age                    ln_age        = ', ln_age
204         WRITE(numout,*) '      Simulating CFC11 passive tracer              ln_cfc11      = ', ln_cfc11
205         WRITE(numout,*) '      Simulating CFC12 passive tracer              ln_cfc12      = ', ln_cfc12
206         WRITE(numout,*) '      Simulating SF6 passive tracer                ln_sf6        = ', ln_sf6
207         WRITE(numout,*) '      Total number of CFCs tracers                 jp_cfc        = ', jp_cfc
208         WRITE(numout,*) '      Simulating C14   passive tracer              ln_c14        = ', ln_c14
209         WRITE(numout,*) '      Read inputs data from file (y/n)             ln_trcdta     = ', ln_trcdta
210         WRITE(numout,*) '      Enable surface, lateral or open boundaries conditions (y/n)  ln_trcbc  = ', ln_trcbc
211         WRITE(numout,*) '      Damping of passive tracer (y/n)              ln_trcdmp     = ', ln_trcdmp
212         WRITE(numout,*) '      Restoring of tracer on closed seas           ln_trcdmp_clo = ', ln_trcdmp_clo
213      ENDIF
214      !
215      IF( ll_cfc .OR. ln_c14 ) THEN
216        !                             ! Open namelist files
217        CALL load_nml( numtrc_ref, 'namelist_trc_ref' , numout, lwm )
218        CALL load_nml( numtrc_cfg, 'namelist_trc_cfg' , numout, lwm )
219        IF(lwm) CALL ctl_opn( numonr, 'output.namelist.trc', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
220        !
221      ENDIF
222      !
223   END SUBROUTINE trc_nam_trc
224
225
226   SUBROUTINE trc_nam_trd
227      !!---------------------------------------------------------------------
228      !!                     ***  ROUTINE trc_nam_dia  ***
229      !!
230      !! ** Purpose :   read options for the passive tracer diagnostics
231      !!
232      !! ** Method  : - read passive tracer namelist
233      !!              - read namelist of each defined SMS model
234      !!                ( (PISCES, CFC, MY_TRC )
235      !!---------------------------------------------------------------------
236#if defined key_trdmxl_trc  || defined key_trdtrc
237      INTEGER  ::   ios, ierr                 ! Local integer
238      !!
239      NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, &
240         &                ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, &
241         &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc
242      !!---------------------------------------------------------------------
243      !
244      IF(lwp) WRITE(numout,*)
245      IF(lwp) WRITE(numout,*) 'trc_nam_trd : read the passive tracer diagnostics options'
246      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
247      !
248      ALLOCATE( ln_trdtrc(jptra) ) 
249      !
250      READ  ( numnat_ref, namtrc_trd, IOSTAT = ios, ERR = 905)
251905   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc_trd in reference namelist' )
252      READ  ( numnat_cfg, namtrc_trd, IOSTAT = ios, ERR = 906 )
253906   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_trd in configuration namelist' )
254      IF(lwm) WRITE( numont, namtrc_trd )
255
256      IF(lwp) THEN
257         WRITE(numout,*) '   Namelist : namtrc_trd                    '
258         WRITE(numout,*) '      frequency of trends diagnostics   nn_trd_trc             = ', nn_trd_trc
259         WRITE(numout,*) '      control surface type              nn_ctls_trc            = ', nn_ctls_trc
260         WRITE(numout,*) '      restart for ML diagnostics        ln_trdmxl_trc_restart  = ', ln_trdmxl_trc_restart
261         WRITE(numout,*) '      instantantaneous or mean trends   ln_trdmxl_trc_instant  = ', ln_trdmxl_trc_instant
262         WRITE(numout,*) '      unit conversion factor            rn_ucf_trc             = ', rn_ucf_trc
263         DO jn = 1, jptra
264            IF( ln_trdtrc(jn) ) WRITE(numout,*) '      compute ML trends for tracer number :', jn
265         END DO
266      ENDIF
267#endif
268      !
269   END SUBROUTINE trc_nam_trd
270
271#else
272   !!----------------------------------------------------------------------
273   !!  Dummy module :                                     No passive tracer
274   !!----------------------------------------------------------------------
275CONTAINS
276   SUBROUTINE trc_nam                      ! Empty routine   
277   END SUBROUTINE trc_nam
278   SUBROUTINE trc_nam_run                      ! Empty routine   
279   END SUBROUTINE trc_nam_run
280#endif
281
282   !!======================================================================
283END MODULE trcnam
Note: See TracBrowser for help on using the repository browser.