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.
Changeset 8338 for branches/UKMO – NEMO

Changeset 8338 for branches/UKMO


Ignore:
Timestamp:
2017-07-14T16:25:28+02:00 (7 years ago)
Author:
marc
Message:

Taking the latest version of trcnam.F90 from nemo_v3_6_STABLE branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_allow_trends/NEMOGCM/NEMO/TOP_SRC/trcnam.F90

    r8280 r8338  
    1111   !!              -   !  2001-01 (E Kestenare) suppress ndttrc=1 for CEN2 and TVD schemes 
    1212   !!             1.0  !  2005-03 (O. Aumont, A. El Moussaoui) F90 
    13    !!              -   !  2014-06  (A. Yool, J. Palmieri) adding MEDUSA-2 
    1413   !!---------------------------------------------------------------------- 
    1514#if defined key_top 
     
    2524   USE trcnam_cfc        ! CFC SMS namelist 
    2625   USE trcnam_c14b       ! C14 SMS namelist 
     26   USE trcnam_age        ! AGE SMS namelist 
    2727   USE trcnam_my_trc     ! MY_TRC SMS namelist 
    28    USE trcnam_medusa     ! MEDUSA namelist 
    29    USE trcnam_idtra      ! Idealise tracer namelist 
    30    USE trcnam_age        ! AGE SMS namelist 
    3128   USE trd_oce        
    3229   USE trdtrc_oce 
     
    4340   !!---------------------------------------------------------------------- 
    4441   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    45    !! $Id$ 
     42   !! $Id: trcnam.F90 7873 2017-04-05 09:24:00Z cetlod $ 
    4643   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    4744   !!---------------------------------------------------------------------- 
     
    5855      !! ** Method  : - read passive tracer namelist  
    5956      !!              - read namelist of each defined SMS model 
    60       !!                ( (PISCES, CFC, MY_TRC, MEDUSA, IDTRA, Age ) 
    61       !!--------------------------------------------------------------------- 
    62       INTEGER  ::   jn, jk                     ! dummy loop indice 
     57      !!                ( (PISCES, CFC, MY_TRC ) 
     58      !!--------------------------------------------------------------------- 
     59      INTEGER  ::   jn                  ! dummy loop indice 
    6360      !                                        !   Parameters of the run  
    6461      IF( .NOT. lk_offline ) CALL trc_nam_run 
    6562       
    6663      !                                        !  passive tracer informations 
    67 # if defined key_debug_medusa 
    68       CALL flush(numout) 
    69       IF (lwp) write (numout,*) '------------------------------' 
    70       IF (lwp) write (numout,*) 'Jpalm - debug' 
    71       IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_trc' 
    72       IF (lwp) write (numout,*) ' ' 
    73 # endif 
    74       ! 
    75       CALL trc_nam_trc 
     64                             CALL trc_nam_trc 
    7665       
    7766      !                                        !   Parameters of additional diagnostics 
    78 # if defined key_debug_medusa 
    79       CALL flush(numout) 
    80       IF (lwp) write (numout,*) '------------------------------' 
    81       IF (lwp) write (numout,*) 'Jpalm - debug' 
    82       IF (lwp) write (numout,*) 'CALL trc_nam_trc -- OK' 
    83       IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_dia' 
    84       IF (lwp) write (numout,*) ' ' 
    85 # endif 
    86       ! 
    87  
    88       CALL trc_nam_dia 
     67      IF( .NOT. lk_iomput)   CALL trc_nam_dia 
    8968 
    9069      !                                        !   namelist of transport 
    91 # if defined key_debug_medusa 
    92       CALL flush(numout) 
    93       IF (lwp) write (numout,*) '------------------------------' 
    94       IF (lwp) write (numout,*) 'Jpalm - debug' 
    95       IF (lwp) write (numout,*) 'CALL trc_nam_dia -- OK' 
    96       IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_trp' 
    97       IF (lwp) write (numout,*) ' ' 
    98 # endif 
    99       ! 
    100       CALL trc_nam_trp 
    101       ! 
    102 # if defined key_debug_medusa 
    103       CALL flush(numout) 
    104       IF (lwp) write (numout,*) '------------------------------' 
    105       IF (lwp) write (numout,*) 'Jpalm - debug' 
    106       IF (lwp) write (numout,*) 'CALL trc_nam_trp -- OK' 
    107       IF (lwp) write (numout,*) 'continue trc_nam ' 
    108       IF (lwp) write (numout,*) ' ' 
    109       CALL flush(numout) 
    110 # endif 
    111       ! 
     70                             CALL trc_nam_trp 
    11271 
    11372 
     
    13190         END DO 
    13291         WRITE(numout,*) ' ' 
    133 # if defined key_debug_medusa 
    134       CALL flush(numout) 
    135 # endif 
    13692      ENDIF 
    13793 
     
    152108            WRITE(numout,*) 
    153109         ENDIF 
    154 # if defined key_debug_medusa 
    155       CALL flush(numout) 
    156 # endif 
    157       ENDIF 
    158  
    159 # if defined key_debug_medusa 
    160        DO jk = 1, jpk 
    161           WRITE(numout,*) '  level number: ', jk, 'rdttrc: ',rdttrc(jk),'rdttra: ', rdttra(jk),'nn_dttrc: ', nn_dttrc 
    162        END DO 
    163       CALL flush(numout) 
    164 # endif 
     110      ENDIF 
     111 
    165112       
    166113      rdttrc(:) = rdttra(:) * FLOAT( nn_dttrc )   ! vertical profile of passive tracer time-step 
     
    170117        WRITE(numout,*) '    Passive Tracer  time step    rdttrc  = ', rdttrc(1) 
    171118        WRITE(numout,*)  
    172 # if defined key_debug_medusa 
    173       CALL flush(numout) 
    174 # endif 
    175       ENDIF 
    176  
     119      ENDIF 
     120 
     121 
     122      ! Call the ice module for tracers 
     123      ! ------------------------------- 
     124      CALL trc_nam_ice 
     125 
     126      ! namelist of SMS 
     127      ! ---------------       
     128      IF( lk_pisces  ) THEN   ;   CALL trc_nam_pisces      ! PISCES  bio-model 
     129      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used' 
     130      ENDIF 
     131 
     132      IF( lk_cfc     ) THEN   ;   CALL trc_nam_cfc         ! CFC     tracers 
     133      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used' 
     134      ENDIF 
     135 
     136      IF( lk_c14b    ) THEN  ;   CALL trc_nam_c14b         ! C14 bomb     tracers 
     137      ELSE                   ;   IF(lwp) WRITE(numout,*) '          C14 not used' 
     138      ENDIF 
     139 
     140      IF( lk_age     ) THEN  ;   CALL trc_nam_age         ! AGE     tracer 
     141      ELSE                   ;   IF(lwp) WRITE(numout,*) '          AGE not used' 
     142      ENDIF 
     143 
     144      IF( lk_my_trc  ) THEN  ;   CALL trc_nam_my_trc      ! MY_TRC  tracers 
     145      ELSE                   ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used' 
     146      ENDIF 
     147      ! 
     148   END SUBROUTINE trc_nam 
     149 
     150   SUBROUTINE trc_nam_run 
     151      !!--------------------------------------------------------------------- 
     152      !!                     ***  ROUTINE trc_nam  *** 
     153      !! 
     154      !! ** Purpose :   read options for the passive tracer run (namelist)  
     155      !! 
     156      !!--------------------------------------------------------------------- 
     157      NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, & 
     158        &                  cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out 
     159 
     160 
     161      INTEGER  ::   ios                 ! Local integer output status for namelist read 
     162 
     163      !!--------------------------------------------------------------------- 
     164 
     165 
     166      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
     167      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     168 
     169      CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     170      CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     171      IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 ) 
     172 
     173      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
     174      READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901) 
     175901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
     176 
     177      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
     178      READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 ) 
     179902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
     180      IF(lwm) WRITE ( numont, namtrc_run ) 
     181 
     182      !  computes the first time step of tracer model 
     183      nittrc000 = nit000 + nn_dttrc - 1 
     184 
     185      IF(lwp) THEN                   ! control print 
     186         WRITE(numout,*) 
     187         WRITE(numout,*) ' Namelist : namtrc_run' 
     188         WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc 
     189         WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr 
     190         WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr 
     191         WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000 
     192         WRITE(numout,*) '   frequency of outputs for passive tracers     nn_writetrc   = ', nn_writetrc  
     193         WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler 
     194         WRITE(numout,*) ' ' 
     195      ENDIF 
     196      ! 
     197    END SUBROUTINE trc_nam_run 
     198 
     199   SUBROUTINE trc_nam_ice 
     200      !!--------------------------------------------------------------------- 
     201      !!                     ***  ROUTINE trc_nam_ice *** 
     202      !! 
     203      !! ** Purpose :   Read the namelist for the ice effect on tracers 
     204      !! 
     205      !! ** Method  : - 
     206      !! 
     207      !!--------------------------------------------------------------------- 
     208      ! --- Variable declarations --- ! 
     209      INTEGER :: jn      ! dummy loop indices 
     210      INTEGER :: ios     ! Local integer output status for namelist read 
     211 
     212      ! --- Namelist declarations --- ! 
     213      TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer 
     214      NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer 
     215 
     216      IF(lwp) THEN 
     217         WRITE(numout,*) 
     218         WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice' 
     219         WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 
     220      ENDIF 
     221 
     222      IF( nn_timing == 1 )  CALL timing_start('trc_nam_ice') 
     223 
     224      ! 
     225      REWIND( numnat_ref )              ! Namelist namtrc_ice in reference namelist : Passive tracer input data 
     226      READ  ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901) 
     227 901  IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp ) 
     228 
     229      REWIND( numnat_cfg )              ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients 
     230      READ  ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 ) 
     231 902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp ) 
     232 
     233      IF( lwp ) THEN 
     234         WRITE(numout,*) ' ' 
     235         WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr 
     236         WRITE(numout,*) ' ' 
     237      ENDIF 
     238 
     239      ! Assign namelist stuff 
     240      DO jn = 1, jptra 
     241         trc_ice_ratio(jn)  = sn_tri_tracer(jn)%trc_ratio 
     242         trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr 
     243         cn_trc_o      (jn) = sn_tri_tracer(jn)%ctrc_o 
     244      END DO 
     245 
     246      IF( nn_timing == 1 )   CALL timing_stop('trc_nam_ice') 
     247      ! 
     248   END SUBROUTINE trc_nam_ice 
     249 
     250   SUBROUTINE trc_nam_trc 
     251      !!--------------------------------------------------------------------- 
     252      !!                     ***  ROUTINE trc_nam  *** 
     253      !! 
     254      !! ** Purpose :   read options for the passive tracer run (namelist)  
     255      !! 
     256      !!--------------------------------------------------------------------- 
     257      TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer  ! type of tracer for saving if not key_iomput 
     258      !! 
     259      NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo 
     260   
     261      INTEGER  ::   ios                 ! Local integer output status for namelist read 
     262      INTEGER  ::   jn                  ! dummy loop indice 
     263      !!--------------------------------------------------------------------- 
     264      IF(lwp) WRITE(numout,*) 
     265      IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
     266      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     267 
     268 
     269      REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
     270      READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) 
     271901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
     272 
     273      REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
     274      READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) 
     275902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
     276      IF(lwm) WRITE ( numont, namtrc ) 
     277 
     278      DO jn = 1, jptra 
     279         ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname ) 
     280         ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname ) 
     281         ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  ) 
     282         ln_trc_ini(jn) =       sn_tracer(jn)%llinit 
     283         ln_trc_wri(jn) =       sn_tracer(jn)%llsave 
     284      END DO 
     285       
     286    END SUBROUTINE trc_nam_trc 
     287 
     288 
     289   SUBROUTINE trc_nam_dia 
     290      !!--------------------------------------------------------------------- 
     291      !!                     ***  ROUTINE trc_nam_dia  *** 
     292      !! 
     293      !! ** Purpose :   read options for the passive tracer diagnostics 
     294      !! 
     295      !! ** Method  : - read passive tracer namelist  
     296      !!              - read namelist of each defined SMS model 
     297      !!                ( (PISCES, CFC, MY_TRC ) 
     298      !!--------------------------------------------------------------------- 
     299      INTEGER ::  ierr 
     300#if defined key_trdmxl_trc  || defined key_trdtrc 
     301      NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 
     302         &                ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, & 
     303         &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 
     304#endif 
     305      NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 
     306 
     307      INTEGER  ::   jn         
     308      INTEGER  ::   ios                 ! Local integer output status for namelist read 
     309      !!--------------------------------------------------------------------- 
     310 
     311      IF(lwp) WRITE(numout,*)  
     312      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
     313      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     314 
     315      IF(lwp) WRITE(numout,*) 
     316      IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
     317      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     318 
     319      REWIND( numnat_ref )              ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics 
     320      READ  ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903) 
     321903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp ) 
     322 
     323      REWIND( numnat_cfg )              ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics 
     324      READ  ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 ) 
     325904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp ) 
     326      IF(lwm) WRITE ( numont, namtrc_dia ) 
     327 
     328      IF(lwp) THEN 
     329         WRITE(numout,*) 
     330         WRITE(numout,*) 
     331         WRITE(numout,*) ' Namelist : namtrc_dia' 
     332         WRITE(numout,*) '    save additionnal diagnostics arrays         ln_diatrc   = ', ln_diatrc 
     333         WRITE(numout,*) '    save additionnal biology diagnostics arrays ln_diabio   = ', ln_diabio 
     334         WRITE(numout,*) '    frequency of outputs for additional arrays  nn_writedia = ', nn_writedia 
     335         WRITE(numout,*) '    frequency of outputs for biological trends  nn_writebio = ', nn_writebio 
     336         WRITE(numout,*) ' ' 
     337      ENDIF 
     338 
     339      IF( ln_diatrc ) THEN  
     340         ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d),  & 
     341           &       ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) ,  &  
     342           &       ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) ,  STAT = ierr )  
     343         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 
     344         ! 
     345         trc2d(:,:,:  ) = 0._wp  ;   ctrc2d(:) = ' '   ;   ctrc2l(:) = ' '    ;    ctrc2u(:) = ' '  
     346         trc3d(:,:,:,:) = 0._wp  ;   ctrc3d(:) = ' '   ;   ctrc3l(:) = ' '    ;    ctrc3u(:) = ' '  
     347         ! 
     348      ENDIF 
     349 
     350      IF( ln_diabio .OR. l_trdtrc ) THEN 
     351         ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 
     352           &       ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr )  
     353         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 
     354         ! 
     355         trbio(:,:,:,:) = 0._wp  ;   ctrbio(:) = ' '   ;   ctrbil(:) = ' '    ;    ctrbiu(:) = ' '  
     356         ! 
     357      ENDIF 
    177358 
    178359#if defined key_trdmxl_trc || defined key_trdtrc 
     
    200381               IF( ln_trdtrc(jn) ) WRITE(numout,*) '    compute ML trends for tracer number :', jn 
    201382            END DO 
    202          WRITE(numout,*) ' ' 
    203          CALL flush(numout) 
    204383         ENDIF 
    205384#endif 
    206  
    207 # if defined key_debug_medusa 
    208       CALL flush(numout) 
    209       IF (lwp) write (numout,*) '------------------------------' 
    210       IF (lwp) write (numout,*) 'Jpalm - debug' 
    211       IF (lwp) write (numout,*) 'just before ice module for tracers call : ' 
    212       IF (lwp) write (numout,*) ' ' 
    213 # endif 
    214       ! 
    215  
    216       ! Call the ice module for tracers 
    217       ! ------------------------------- 
    218       CALL trc_nam_ice 
    219  
    220 # if defined key_debug_medusa 
    221       CALL flush(numout) 
    222       IF (lwp) write (numout,*) '------------------------------' 
    223       IF (lwp) write (numout,*) 'Jpalm - debug' 
    224       IF (lwp) write (numout,*) 'Will now read SMS namelists : ' 
    225       IF (lwp) write (numout,*) ' ' 
    226 # endif 
    227       ! 
    228  
    229       ! namelist of SMS 
    230       ! ---------------       
    231       IF( lk_pisces  ) THEN   ;   CALL trc_nam_pisces      ! PISCES  bio-model 
    232       ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used' 
    233       ENDIF 
    234       ! 
    235 # if defined key_debug_medusa 
    236       CALL flush(numout) 
    237       IF (lwp) write (numout,*) '------------------------------' 
    238       IF (lwp) write (numout,*) 'Jpalm - debug' 
    239       IF (lwp) write (numout,*) 'CALL trc_nam_pisces  -- OK' 
    240       IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_medusa' 
    241       IF (lwp) write (numout,*) ' ' 
    242 # endif 
    243       ! 
    244       IF( lk_medusa  ) THEN   ;   CALL trc_nam_medusa      ! MEDUSA  tracers 
    245       ELSE                    ;   IF(lwp) WRITE(numout,*) '          MEDUSA not used' 
    246       ENDIF 
    247       ! 
    248 # if defined key_debug_medusa 
    249       CALL flush(numout) 
    250       IF (lwp) write (numout,*) '------------------------------' 
    251       IF (lwp) write (numout,*) 'Jpalm - debug' 
    252       IF (lwp) write (numout,*) 'CALL trc_nam_medusa -- OK' 
    253       IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_idtra' 
    254       IF (lwp) write (numout,*) ' ' 
    255 # endif 
    256       ! 
    257       IF( lk_idtra   ) THEN   ;   CALL trc_nam_idtra       ! Idealize tracers 
    258       ELSE                    ;   IF(lwp) WRITE(numout,*) '          Idealize tracers not used' 
    259       ENDIF 
    260       ! 
    261 # if defined key_debug_medusa 
    262       CALL flush(numout) 
    263       IF (lwp) write (numout,*) '------------------------------' 
    264       IF (lwp) write (numout,*) 'Jpalm - debug' 
    265       IF (lwp) write (numout,*) 'CALL trc_nam_idtra -- OK' 
    266       IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_cfc' 
    267       IF (lwp) write (numout,*) ' ' 
    268 # endif 
    269       ! 
    270       IF( lk_cfc     ) THEN   ;   CALL trc_nam_cfc         ! CFC     tracers 
    271       ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used' 
    272       ENDIF 
    273       ! 
    274 # if defined key_debug_medusa 
    275       CALL flush(numout) 
    276       IF (lwp) write (numout,*) '------------------------------' 
    277       IF (lwp) write (numout,*) 'Jpalm - debug' 
    278       IF (lwp) write (numout,*) 'CALL trc_nam_cfc -- OK' 
    279       IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_c14' 
    280       IF (lwp) write (numout,*) ' ' 
    281 # endif 
    282       ! 
    283       IF( lk_c14b     ) THEN   ;   CALL trc_nam_c14b         ! C14 bomb     tracers 
    284       ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used' 
    285       ENDIF 
    286       ! 
    287 # if defined key_debug_medusa 
    288       CALL flush(numout) 
    289       IF (lwp) write (numout,*) '------------------------------' 
    290       IF (lwp) write (numout,*) 'Jpalm - debug' 
    291       IF (lwp) write (numout,*) 'CALL trc_nam_c14 -- OK' 
    292       IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_age' 
    293       IF (lwp) write (numout,*) ' ' 
    294 # endif 
    295       ! 
    296       IF( lk_age     ) THEN  ;   CALL trc_nam_age         ! AGE     tracer 
    297       ELSE                   ;   IF(lwp) WRITE(numout,*) '          AGE not used' 
    298       ENDIF 
    299       ! 
    300 # if defined key_debug_medusa 
    301       CALL flush(numout) 
    302       IF (lwp) write (numout,*) '------------------------------' 
    303       IF (lwp) write (numout,*) 'Jpalm - debug' 
    304       IF (lwp) write (numout,*) 'CALL trc_nam_age -- OK' 
    305       IF (lwp) write (numout,*) 'in trc_nam - CALL trc_nam -- OK' 
    306       IF (lwp) write (numout,*) ' ' 
    307 # endif 
    308       ! 
    309       IF( lk_my_trc  ) THEN   ;   CALL trc_nam_my_trc      ! MY_TRC  tracers 
    310       ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used' 
    311       ENDIF 
    312         
    313       IF(lwp)   CALL flush(numout) 
    314    END SUBROUTINE trc_nam 
    315  
    316    SUBROUTINE trc_nam_run 
    317       !!--------------------------------------------------------------------- 
    318       !!                     ***  ROUTINE trc_nam  *** 
    319       !! 
    320       !! ** Purpose :   read options for the passive tracer run (namelist)  
    321       !! 
    322       !!--------------------------------------------------------------------- 
    323       NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, & 
    324         &                  cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out 
    325  
    326  
    327       INTEGER  ::   ios                 ! Local integer output status for namelist read 
    328  
    329       !!--------------------------------------------------------------------- 
    330  
    331  
    332       IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
    333       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    334  
    335       CALL ctl_opn( numnat_ref, 'namelist_top_ref'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    336       CALL ctl_opn( numnat_cfg, 'namelist_top_cfg'   , 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    337       IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 ) 
    338  
    339       REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
    340       READ  ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901) 
    341 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
    342  
    343       REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
    344       READ  ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 ) 
    345 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
    346       IF(lwm) WRITE ( numont, namtrc_run ) 
    347  
    348       !  computes the first time step of tracer model 
    349       nittrc000 = nit000 + nn_dttrc - 1 
    350  
    351       IF(lwp) THEN                   ! control print 
    352          WRITE(numout,*) 
    353          WRITE(numout,*) ' Namelist : namtrc_run' 
    354          WRITE(numout,*) '   time step freq. for passive tracer           nn_dttrc      = ', nn_dttrc 
    355          WRITE(numout,*) '   restart  for passive tracer                  ln_rsttr      = ', ln_rsttr 
    356          WRITE(numout,*) '   control of time step for passive tracer      nn_rsttr      = ', nn_rsttr 
    357          WRITE(numout,*) '   first time step for pass. trac.              nittrc000     = ', nittrc000 
    358          WRITE(numout,*) '   frequency of outputs for passive tracers     nn_writetrc   = ', nn_writetrc  
    359          WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler 
    360          WRITE(numout,*) ' ' 
    361         CALL flush(numout) 
    362       ENDIF 
    363       ! 
    364     END SUBROUTINE trc_nam_run 
    365  
    366    SUBROUTINE trc_nam_ice 
    367       !!--------------------------------------------------------------------- 
    368       !!                     ***  ROUTINE trc_nam_ice *** 
    369       !! 
    370       !! ** Purpose :   Read the namelist for the ice effect on tracers 
    371       !! 
    372       !! ** Method  : - 
    373       !! 
    374       !!--------------------------------------------------------------------- 
    375       ! --- Variable declarations --- ! 
    376       INTEGER :: jn      ! dummy loop indices 
    377       INTEGER :: ios     ! Local integer output status for namelist read 
    378  
    379       ! --- Namelist declarations --- ! 
    380       TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer 
    381       NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer 
    382  
    383       IF(lwp) THEN 
    384          WRITE(numout,*) 
    385          WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice' 
    386          WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 
    387       ENDIF 
    388  
    389       IF( nn_timing == 1 )  CALL timing_start('trc_nam_ice') 
    390  
    391       ! 
    392       REWIND( numnat_ref )              ! Namelist namtrc_ice in reference namelist : Passive tracer input data 
    393       READ  ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901) 
    394  901  IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp ) 
    395  
    396       REWIND( numnat_cfg )              ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients 
    397       READ  ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 ) 
    398  902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp ) 
    399  
    400       IF( lwp ) THEN 
    401          WRITE(numout,*) ' ' 
    402          WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr 
    403          WRITE(numout,*) ' ' 
    404       ENDIF 
    405  
    406       ! Assign namelist stuff 
    407       DO jn = 1, jptra 
    408          trc_ice_ratio(jn)  = sn_tri_tracer(jn)%trc_ratio 
    409          trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr 
    410          cn_trc_o      (jn) = sn_tri_tracer(jn)%ctrc_o 
    411       END DO 
    412  
    413       IF( nn_timing == 1 )   CALL timing_stop('trc_nam_ice') 
    414       ! 
    415    END SUBROUTINE trc_nam_ice 
    416  
    417    SUBROUTINE trc_nam_trc 
    418       !!--------------------------------------------------------------------- 
    419       !!                     ***  ROUTINE trc_nam  *** 
    420       !! 
    421       !! ** Purpose :   read options for the passive tracer run (namelist)  
    422       !! 
    423       !!--------------------------------------------------------------------- 
    424       TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer  ! type of tracer for saving if not key_iomput 
    425       !! 
    426       NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo 
    427    
    428       INTEGER  ::   ios                 ! Local integer output status for namelist read 
    429       INTEGER  ::   jn                  ! dummy loop indice 
    430       !!--------------------------------------------------------------------- 
    431       IF(lwp) WRITE(numout,*) 
    432       IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 
    433       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    434  
    435  
    436       REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables 
    437       READ  ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) 
    438 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 
    439  
    440       REWIND( numnat_cfg )              ! Namelist namtrc in configuration namelist : Passive tracer variables 
    441       READ  ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) 
    442 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 
    443       IF(lwm) WRITE ( numont, namtrc ) 
    444  
    445       DO jn = 1, jptra 
    446          ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname ) 
    447          ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname ) 
    448          ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  ) 
    449          ln_trc_ini(jn) =       sn_tracer(jn)%llinit 
    450          ln_trc_wri(jn) =       sn_tracer(jn)%llsave 
    451       END DO 
    452       IF(lwp)  CALL flush(numout)       
    453  
    454     END SUBROUTINE trc_nam_trc 
    455  
    456  
    457    SUBROUTINE trc_nam_dia 
    458       !!--------------------------------------------------------------------- 
    459       !!                     ***  ROUTINE trc_nam_dia  *** 
    460       !! 
    461       !! ** Purpose :   read options for the passive tracer diagnostics 
    462       !! 
    463       !! ** Method  : - read passive tracer namelist  
    464       !!              - read namelist of each defined SMS model 
    465       !!                ( (PISCES, CFC, MY_TRC ) 
    466       !!--------------------------------------------------------------------- 
    467       INTEGER ::  ierr 
    468 #if defined key_trdmxl_trc  || defined key_trdtrc 
    469       NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 
    470          &                ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, & 
    471          &                cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 
    472 #endif 
    473       NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 
    474  
    475       INTEGER  ::   ios                 ! Local integer output status for namelist read 
    476       !!--------------------------------------------------------------------- 
    477  
    478       IF(lwp) WRITE(numout,*)  
    479       IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
    480       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    481  
    482       IF(lwp) WRITE(numout,*) 
    483       IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 
    484       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    485  
    486       REWIND( numnat_ref )              ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics 
    487       READ  ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903) 
    488 903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp ) 
    489  
    490       REWIND( numnat_cfg )              ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics 
    491       READ  ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 ) 
    492 904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp ) 
    493       IF(lwm) WRITE ( numont, namtrc_dia ) 
    494  
    495       IF(lwp) THEN 
    496          WRITE(numout,*) 
    497          WRITE(numout,*) 
    498          WRITE(numout,*) ' Namelist : namtrc_dia' 
    499          WRITE(numout,*) '    save additionnal diagnostics arrays         ln_diatrc   = ', ln_diatrc 
    500          WRITE(numout,*) '    save additionnal biology diagnostics arrays ln_diabio   = ', ln_diabio 
    501          WRITE(numout,*) '    frequency of outputs for additional arrays  nn_writedia = ', nn_writedia 
    502          WRITE(numout,*) '    frequency of outputs for biological trends  nn_writebio = ', nn_writebio 
    503          WRITE(numout,*) ' ' 
    504          CALL flush(numout) 
    505       ENDIF 
    506 !! 
    507 !! JPALM -- 17-07-2015 -- 
    508 !! MEDUSA is not yet up-to-date with the iom server. 
    509 !! we use it for the main tracer, but not fully with diagnostics. 
    510 !! will have to adapt it properly when visiting Christian Ethee 
    511 !! for now, we change  
    512 !! IF( ln_diatrc .AND. .NOT. lk_iomput ) THEN 
    513 !! to : 
    514 !! 
    515       IF( ( ln_diatrc .AND. .NOT. lk_iomput ) .OR. ( ln_diatrc .AND. lk_medusa ) ) THEN  
    516          ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d),  & 
    517            &       ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) ,  &  
    518            &       ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) ,  STAT = ierr )  
    519          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 
    520          ! 
    521          trc2d(:,:,:  ) = 0._wp  ;   ctrc2d(:) = ' '   ;   ctrc2l(:) = ' '    ;    ctrc2u(:) = ' '  
    522          trc3d(:,:,:,:) = 0._wp  ;   ctrc3d(:) = ' '   ;   ctrc3l(:) = ' '    ;    ctrc3u(:) = ' '  
    523          ! 
    524       !! ELSE IF  ( lk_iomput .AND. lk_medusa .AND. .NOT. ln_diatrc) THEN 
    525       !!    CALL trc_nam_iom_medusa 
    526       ENDIF 
    527  
    528       IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN 
    529          ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 
    530            &       ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr )  
    531          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 
    532          ! 
    533          trbio(:,:,:,:) = 0._wp  ;   ctrbio(:) = ' '   ;   ctrbil(:) = ' '    ;    ctrbiu(:) = ' '  
    534          ! 
    535       ENDIF 
    536385      ! 
    537386   END SUBROUTINE trc_nam_dia 
     
    550399   !!---------------------------------------------------------------------- 
    551400   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    552    !! $Id$ 
     401   !! $Id: trcnam.F90 7873 2017-04-05 09:24:00Z cetlod $ 
    553402   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    554403   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.