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 branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC – NEMO

source: branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcnam.F90 @ 7931

Last change on this file since 7931 was 7646, checked in by timgraham, 7 years ago

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

  • Property svn:keywords set to Id
File size: 15.0 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 3.3 , NEMO Consortium (2010)
36   !! $Id$
37   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
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      IF( .NOT.l_offline )   CALL trc_nam_run     ! Parameters of the run                                 
54      !               
55      CALL trc_nam_trc     ! passive tracer informations
56      !                                       
57      IF( ln_rsttr                     )   ln_trcdta     = .FALSE.   ! restart : no need of clim data
58      !
59      IF( ln_trcdmp .OR. ln_trcdmp_clo )   ln_trcdta     = .TRUE.   ! damping : need to have clim data
60      !
61
62      IF(lwp) THEN                   ! control print
63         IF( ln_rsttr ) THEN
64            WRITE(numout,*)
65            WRITE(numout,*) '  Read a restart file for passive tracer : ', TRIM( cn_trcrst_in )
66            WRITE(numout,*)
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            WRITE(numout,*)
72         ENDIF
73         IF( .NOT.ln_trcdta ) THEN
74            WRITE(numout,*)
75            WRITE(numout,*) '  All the passive tracers are initialised with constant values '
76            WRITE(numout,*)
77         ENDIF
78      ENDIF
79      !
80      rdttrc = rdt * FLOAT( nn_dttrc )          ! passive tracer time-step
81      !
82      IF(lwp) THEN                              ! control print
83        WRITE(numout,*) 
84        WRITE(numout,*) '    Passive Tracer  time step    rdttrc  = ', rdttrc
85        WRITE(numout,*) 
86      ENDIF
87      !
88      IF( l_trdtrc )        CALL trc_nam_trd    ! Passive tracer trends
89      !
90   END SUBROUTINE trc_nam
91
92
93   SUBROUTINE trc_nam_run
94      !!---------------------------------------------------------------------
95      !!                     ***  ROUTINE trc_nam  ***
96      !!
97      !! ** Purpose :   read options for the passive tracer run (namelist)
98      !!
99      !!---------------------------------------------------------------------
100      NAMELIST/namtrc_run/ nn_dttrc, ln_rsttr, nn_rsttr, ln_top_euler, &
101        &                  cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out
102      !
103      INTEGER  ::   ios                 ! Local integer output status for namelist read
104      !!---------------------------------------------------------------------
105      !
106      IF(lwp) WRITE(numout,*) 'trc_nam_run : read the passive tracer namelists'
107      IF(lwp) WRITE(numout,*) '~~~~~~~'
108
109      CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
110      CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
111      IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 )
112
113      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables
114      READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901)
115901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp )
116
117      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables
118      READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 )
119902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp )
120      IF(lwm) WRITE ( numont, namtrc_run )
121
122      !  computes the first time step of tracer model
123      nittrc000 = nit000 + nn_dttrc - 1
124
125      IF(lwp) THEN                   ! control print
126         WRITE(numout,*)
127         WRITE(numout,*) ' Namelist : namtrc_run'
128         WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc
129         WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr
130         WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr
131         WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000
132         WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler
133         WRITE(numout,*) ' '
134      ENDIF
135      !
136    END SUBROUTINE trc_nam_run
137
138   SUBROUTINE trc_nam_trc
139      !!---------------------------------------------------------------------
140      !!                     ***  ROUTINE trc_nam  ***
141      !!
142      !! ** Purpose :   read options for the passive tracer run (namelist)
143      !!
144      !!---------------------------------------------------------------------
145      INTEGER  ::   ios, ierr, icfc       ! Local integer output status for namelist read
146      !!
147      NAMELIST/namtrc/jp_bgc, ln_pisces, ln_my_trc, ln_age, ln_cfc11, ln_cfc12, ln_sf6, ln_c14, &
148         &            sn_tracer, ln_trcdta, ln_trcdmp, ln_trcdmp_clo, jp_dia3d, jp_dia2d
149      !!---------------------------------------------------------------------
150      ! Dummy settings to fill tracers data structure
151      !                  !   name   !   title   !   unit   !   init  !   sbc   !   cbc   !   obc  !
152      sn_tracer = PTRACER( 'NONAME' , 'NOTITLE' , 'NOUNIT' , .false. , .false. , .false. , .false.)
153      !
154      IF(lwp) WRITE(numout,*)
155      IF(lwp) WRITE(numout,*) 'trc_nam_trc : read the passive tracer namelists'
156      IF(lwp) WRITE(numout,*) '~~~~~~~'
157
158      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables
159      READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901)
160901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp )
161
162      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables
163      READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 )
164902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp )
165      IF(lwm) WRITE ( numont, namtrc )
166
167      ! Control settings
168      IF( ln_pisces .AND. ln_my_trc )   CALL ctl_stop( 'Choose only ONE BGC model - PISCES or MY_TRC' )
169      IF( .NOT. ln_pisces .AND. .NOT. ln_my_trc )   jp_bgc = 0
170      ll_cfc = ln_cfc11 .OR. ln_cfc12 .OR. ln_sf6
171      !
172      jptra       =  0
173      jp_pisces   =  0    ;   jp_pcs0  =  0    ;   jp_pcs1  = 0
174      jp_my_trc   =  0    ;   jp_myt0  =  0    ;   jp_myt1  = 0
175      jp_cfc      =  0    ;   jp_cfc0  =  0    ;   jp_cfc1  = 0
176      jp_age      =  0    ;   jp_c14   =  0
177      !
178      IF( ln_pisces )  THEN
179         jp_pisces = jp_bgc
180         jp_pcs0   = 1
181         jp_pcs1   = jp_pisces
182      ENDIF
183      IF( ln_my_trc )  THEN
184          jp_my_trc = jp_bgc
185          jp_myt0   = 1
186          jp_myt1   = jp_my_trc
187      ENDIF
188      !
189      jptra  = jp_bgc
190      !
191      IF( ln_age )    THEN
192         jptra     = jptra + 1
193         jp_age    = jptra
194      ENDIF
195      IF( ln_cfc11 )  jp_cfc = jp_cfc + 1
196      IF( ln_cfc12 )  jp_cfc = jp_cfc + 1
197      IF( ln_sf6   )  jp_cfc = jp_cfc + 1
198      IF( ll_cfc )    THEN
199          jptra     = jptra + jp_cfc
200          jp_cfc0   = jptra - jp_cfc + 1
201          jp_cfc1   = jptra
202      ENDIF
203      IF( ln_c14 )    THEN
204           jptra     = jptra + 1
205           jp_c14    = jptra
206      ENDIF
207      !
208      IF( jptra == 0 )   CALL ctl_stop( 'All TOP tracers disabled: change namtrc setting or check if key_top is active' )
209      !
210      IF(lwp) THEN                   ! control print
211         WRITE(numout,*)
212         WRITE(numout,*) ' Namelist : namtrc'
213         WRITE(numout,*) '   Total number of passive tracers              jptra         = ', jptra
214         WRITE(numout,*) '   Total number of BGC tracers                  jp_bgc        = ', jp_bgc
215         WRITE(numout,*) '   Simulating PISCES model                      ln_pisces     = ', ln_pisces
216         WRITE(numout,*) '   Simulating MY_TRC  model                     ln_my_trc     = ', ln_my_trc
217         WRITE(numout,*) '   Simulating water mass age                    ln_age        = ', ln_age
218         WRITE(numout,*) '   Simulating CFC11 passive tracer              ln_cfc11      = ', ln_cfc11
219         WRITE(numout,*) '   Simulating CFC12 passive tracer              ln_cfc12      = ', ln_cfc12
220         WRITE(numout,*) '   Simulating SF6 passive tracer                ln_sf6        = ', ln_sf6
221         WRITE(numout,*) '   Total number of CFCs tracers                 jp_cfc        = ', jp_cfc
222         WRITE(numout,*) '   Simulating C14   passive tracer              ln_c14        = ', ln_c14
223         WRITE(numout,*) '   Read inputs data from file (y/n)             ln_trcdta     = ', ln_trcdta
224         WRITE(numout,*) '   Damping of passive tracer (y/n)              ln_trcdmp     = ', ln_trcdmp
225         WRITE(numout,*) '   Restoring of tracer on closed seas           ln_trcdmp_clo = ', ln_trcdmp_clo
226         WRITE(numout,*) ' '
227         WRITE(numout,*) ' '
228      ENDIF
229      !
230      IF( ll_cfc .OR. ln_c14 ) THEN
231        !                             ! Open namelist files
232        CALL ctl_opn( numtrc_ref, 'namelist_trc_ref'   ,     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
233        CALL ctl_opn( numtrc_cfg, 'namelist_trc_cfg'   ,     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
234        IF(lwm) CALL ctl_opn( numonr, 'output.namelist.trc', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
235        !
236      ENDIF
237
238   END SUBROUTINE trc_nam_trc
239
240   SUBROUTINE trc_nam_trd
241      !!---------------------------------------------------------------------
242      !!                     ***  ROUTINE trc_nam_dia  ***
243      !!
244      !! ** Purpose :   read options for the passive tracer diagnostics
245      !!
246      !! ** Method  : - read passive tracer namelist
247      !!              - read namelist of each defined SMS model
248      !!                ( (PISCES, CFC, MY_TRC )
249      !!---------------------------------------------------------------------
250
251#if defined key_trdmxl_trc  || defined key_trdtrc
252      INTEGER  ::   ios                 ! Local integer output status for namelist read
253      INTEGER ::  ierr
254      !!
255      NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, &
256         &                ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, &
257         &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc
258      !!---------------------------------------------------------------------
259
260      IF(lwp) WRITE(numout,*)
261      IF(lwp) WRITE(numout,*) 'trc_nam_trd : read the passive tracer diagnostics options'
262      IF(lwp) WRITE(numout,*) '~~~~~~~'
263
264      !
265      ALLOCATE( ln_trdtrc(jptra) ) 
266      !
267      REWIND( numnat_ref )              ! Namelist namtrc_trd in reference namelist : Passive tracer trends
268      READ  ( numnat_ref, namtrc_trd, IOSTAT = ios, ERR = 905)
269905   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_trd in reference namelist', lwp )
270
271      REWIND( numnat_cfg )              ! Namelist namtrc_trd in configuration namelist : Passive tracer trends
272      READ  ( numnat_cfg, namtrc_trd, IOSTAT = ios, ERR = 906 )
273906   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_trd in configuration namelist', lwp )
274      IF(lwm) WRITE ( numont, namtrc_trd )
275
276      IF(lwp) THEN
277         WRITE(numout,*)
278         WRITE(numout,*) ' trd_mxl_trc_init : read namelist namtrc_trd                    '
279         WRITE(numout,*) ' ~~~~~~~~~~~~~~~~                                               '
280         WRITE(numout,*) '   * frequency of trends diagnostics   nn_trd_trc             = ', nn_trd_trc
281         WRITE(numout,*) '   * control surface type              nn_ctls_trc            = ', nn_ctls_trc
282         WRITE(numout,*) '   * restart for ML diagnostics        ln_trdmxl_trc_restart  = ', ln_trdmxl_trc_restart
283         WRITE(numout,*) '   * flag to diagnose trends of                                 '
284         WRITE(numout,*) '     instantantaneous or mean ML T/S   ln_trdmxl_trc_instant  = ', ln_trdmxl_trc_instant
285         WRITE(numout,*) '   * unit conversion factor            rn_ucf_trc             = ', rn_ucf_trc
286         DO jn = 1, jptra
287            IF( ln_trdtrc(jn) ) WRITE(numout,*) '    compute ML trends for tracer number :', jn
288         END DO
289      ENDIF
290#endif
291      !
292   END SUBROUTINE trc_nam_trd
293
294#else
295   !!----------------------------------------------------------------------
296   !!  Dummy module :                                     No passive tracer
297   !!----------------------------------------------------------------------
298CONTAINS
299   SUBROUTINE trc_nam                      ! Empty routine   
300   END SUBROUTINE trc_nam
301   SUBROUTINE trc_nam_run                      ! Empty routine   
302   END SUBROUTINE trc_nam_run
303#endif
304
305   !!----------------------------------------------------------------------
306   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
307   !! $Id$
308   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
309   !!======================================================================
310END MODULE trcnam
Note: See TracBrowser for help on using the repository browser.