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 8280 for branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcini.F90 – NEMO

Ignore:
Timestamp:
2017-07-05T10:28:51+02:00 (7 years ago)
Author:
timgraham
Message:

331: Merge of MEDUSA stable branch and HadGEM3 coupling branches into GO6 package branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r7203 r8280  
    88   !!            2.0  ! 2005-10 (C. Ethe, G. Madec) revised architecture 
    99   !!            4.0  ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation 
     10   !!             -   ! 2014-06 (A. Yool, J. Palmieri) adding MEDUSA-2 
    1011   !!---------------------------------------------------------------------- 
    1112#if defined key_top 
     
    2425   USE trcini_c14b     ! C14 bomb initialisation 
    2526   USE trcini_my_trc   ! MY_TRC   initialisation 
     27   USE trcini_medusa   ! MEDUSA   initialisation 
     28   USE trcini_idtra    ! idealize tracer initialisation 
     29   USE trcini_age      ! AGE      initialisation 
    2630   USE trcdta          ! initialisation from files 
    2731   USE daymod          ! calendar manager 
     
    7680         &   CALL ctl_warn(' Coupling with passive tracers and used of diurnal cycle. & 
    7781         & Computation of a daily mean shortwave for some biogeochemical models) ') 
    78  
     82          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     83          !!!!! CHECK For MEDUSA 
     84          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    7985      IF( nn_cla == 1 )   & 
    8086         &  CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' ) 
     
    97103 
    98104      IF( lk_pisces  )       CALL trc_ini_pisces       ! PISCES  bio-model 
     105      IF( lk_medusa  )       CALL trc_ini_medusa       ! MEDUSA  tracers 
     106      IF( lk_idtra   )       CALL trc_ini_idtra        ! Idealize tracers 
    99107      IF( lk_cfc     )       CALL trc_ini_cfc          ! CFC     tracers 
    100108      IF( lk_c14b    )       CALL trc_ini_c14b         ! C14 bomb  tracer 
     109      IF( lk_age     )       CALL trc_ini_age          ! AGE       tracer 
    101110      IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC  tracers 
    102111 
    103112      CALL trc_ice_ini                                 ! Tracers in sea ice 
    104113 
    105       IF( lwp ) THEN 
     114# if defined key_debug_medusa 
     115         IF (lwp) write (numout,*) '------------------------------' 
     116         IF (lwp) write (numout,*) 'Jpalm - debug' 
     117         IF (lwp) write (numout,*) ' in trc_init' 
     118         IF (lwp) write (numout,*) ' sms init OK' 
     119         IF (lwp) write (numout,*) ' next: open tracer.stat' 
     120         IF (lwp) write (numout,*) ' ' 
     121         CALL flush(numout) 
     122# endif 
     123 
     124      IF( ln_ctl ) THEN 
    106125         ! 
    107          CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp , narea ) 
     126         IF (narea == 1) THEN   
     127            ! The tracer.stat file only contains global tracer sum values, if  
     128            ! it contains anything at all. Hence it only needs to be opened  
     129            ! and written to on the master PE, not on all PEs.   
     130            CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE','FORMATTED',  &  
     131                          'SEQUENTIAL', -1, numout, lwp , narea )  
     132         ENDIF   
    108133         ! 
    109134      ENDIF 
    110135 
    111       IF( ln_trcdta )      CALL trc_dta_init(jptra) 
    112  
     136# if defined key_debug_medusa 
     137         IF (lwp) write (numout,*) '------------------------------' 
     138         IF (lwp) write (numout,*) 'Jpalm - debug' 
     139         IF (lwp) write (numout,*) ' in trc_init' 
     140         IF (lwp) write (numout,*) 'open tracer.stat -- OK' 
     141         IF (lwp) write (numout,*) ' ' 
     142         CALL flush(numout) 
     143# endif 
     144 
     145 
     146      IF( ln_trcdta ) THEN 
     147#if defined key_medusa 
     148         IF(lwp) WRITE(numout,*) 'AXY: calling trc_dta_init' 
     149         IF(lwp) CALL flush(numout) 
     150#endif 
     151         CALL trc_dta_init(jptra) 
     152      ENDIF 
    113153 
    114154      IF( ln_rsttr ) THEN 
    115155        ! 
     156#if defined key_medusa 
     157        IF(lwp) WRITE(numout,*) 'AXY: calling trc_rst_read' 
     158        IF(lwp) CALL flush(numout) 
     159#endif 
    116160        CALL trc_rst_read              ! restart from a file 
    117161        ! 
    118162      ELSE 
     163        ! 
     164# if defined key_debug_medusa 
     165         IF (lwp) write (numout,*) '------------------------------' 
     166         IF (lwp) write (numout,*) 'Jpalm - debug' 
     167         IF (lwp) write (numout,*) ' Init from file -- will call trc_dta' 
     168         IF (lwp) write (numout,*) ' ' 
     169         CALL flush(numout) 
     170# endif 
    119171        ! 
    120172        IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping 
     
    137189        ENDIF 
    138190        ! 
     191# if defined key_debug_medusa 
     192         IF (lwp) write (numout,*) '------------------------------' 
     193         IF (lwp) write (numout,*) 'Jpalm - debug' 
     194         IF (lwp) write (numout,*) ' in trc_init' 
     195         IF (lwp) write (numout,*) ' before trb = trn' 
     196         IF (lwp) write (numout,*) ' ' 
     197         CALL flush(numout) 
     198# endif 
     199        ! 
    139200        trb(:,:,:,:) = trn(:,:,:,:) 
     201        !  
     202# if defined key_debug_medusa 
     203         IF (lwp) write (numout,*) '------------------------------' 
     204         IF (lwp) write (numout,*) 'Jpalm - debug' 
     205         IF (lwp) write (numout,*) ' in trc_init' 
     206         IF (lwp) write (numout,*) ' trb = trn -- OK' 
     207         IF (lwp) write (numout,*) ' ' 
     208         CALL flush(numout) 
     209# endif 
    140210        !  
    141211      ENDIF 
     
    146216      IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav )   & 
    147217        &    CALL zps_hde_isf( nit000, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )       ! tracers at the bottom ocean level 
    148  
    149  
     218      ! 
     219# if defined key_debug_medusa 
     220         IF (lwp) write (numout,*) '------------------------------' 
     221         IF (lwp) write (numout,*) 'Jpalm - debug' 
     222         IF (lwp) write (numout,*) ' in trc_init' 
     223         IF (lwp) write (numout,*) ' partial step -- OK' 
     224         IF (lwp) write (numout,*) ' ' 
     225         CALL flush(numout) 
     226# endif 
    150227      ! 
    151228      IF( nn_dttrc /= 1 )        CALL trc_sub_ini      ! Initialize variables for substepping passive tracers 
    152229      ! 
    153  
     230# if defined key_debug_medusa 
     231         IF (lwp) write (numout,*) '------------------------------' 
     232         IF (lwp) write (numout,*) 'Jpalm - debug' 
     233         IF (lwp) write (numout,*) ' in trc_init' 
     234         IF (lwp) write (numout,*) ' before initiate tracer contents' 
     235         IF (lwp) write (numout,*) ' ' 
     236         CALL flush(numout) 
     237# endif 
     238      ! 
    154239      trai(:) = 0._wp                                                   ! initial content of all tracers 
    155240      DO jn = 1, jptra 
     
    164249         WRITE(numout,*) '          *** Total inital content of all tracers ' 
    165250         WRITE(numout,*) 
     251# if defined key_debug_medusa 
     252         CALL flush(numout) 
     253# endif 
     254         ! 
     255# if defined key_debug_medusa 
     256         WRITE(numout,*) ' litle check :  ', ctrcnm(1) 
     257         CALL flush(numout) 
     258# endif 
    166259         DO jn = 1, jptra 
    167260            WRITE(numout,9000) jn, TRIM( ctrcnm(jn) ), trai(jn) 
     
    176269         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 
    177270      ENDIF 
     271 
     272      IF(lwp) WRITE(numout,*) 
     273      IF(lwp) WRITE(numout,*) 'trc_init : passive tracer set up completed' 
     274      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     275      IF(lwp) CALL flush(numout) 
     276# if defined key_debug_medusa 
     277         CALL trc_rst_stat 
     278         CALL flush(numout) 
     279# endif 
     280 
    1782819000  FORMAT(' tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10) 
    179282      ! 
Note: See TracChangeset for help on using the changeset viewer.