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

Ignore:
Timestamp:
2018-07-23T11:33:03+02:00 (6 years ago)
Author:
emmafiedler
Message:

Merge with GO6 FOAMv14 package branch r9288

File:
1 edited

Legend:

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

    r7960 r9987  
    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 
     
    2324   USE trcini_pisces   ! PISCES   initialisation 
    2425   USE trcini_c14b     ! C14 bomb initialisation 
     26   USE trcini_age      ! AGE      initialisation 
    2527   USE trcini_my_trc   ! MY_TRC   initialisation 
     28   USE trcini_idtra    ! idealize tracer initialisation 
     29   USE trcini_medusa   ! MEDUSA   initialisation 
    2630   USE trcdta          ! initialisation from files 
    2731   USE daymod          ! calendar manager 
    28    USE zpshde          ! partial step: hor. derivative   (zps_hde routine) 
    2932   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine) 
    3033   USE trcsub          ! variables to substep passive tracers 
     
    6164      INTEGER ::   jk, jn, jl    ! dummy loop indices 
    6265      CHARACTER (len=25) :: charout 
    63       REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrcdta   ! 4D  workspace 
    6466      !!--------------------------------------------------------------------- 
    6567      ! 
     
    100102      IF( lk_cfc     )       CALL trc_ini_cfc          ! CFC     tracers 
    101103      IF( lk_c14b    )       CALL trc_ini_c14b         ! C14 bomb  tracer 
     104      IF( lk_age     )       CALL trc_ini_age          ! AGE       tracer 
    102105      IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC  tracers 
     106      IF( lk_idtra   )       CALL trc_ini_idtra        ! Idealize tracers 
     107      IF( lk_medusa  )       CALL trc_ini_medusa       ! MEDUSA  tracers 
    103108 
    104109      CALL trc_ice_ini                                 ! Tracers in sea ice 
    105110 
    106       IF( lwp ) THEN 
     111      IF( ln_ctl ) THEN 
    107112         ! 
    108          CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp , narea ) 
     113         IF (narea == 1) THEN   
     114            ! The tracer.stat file only contains global tracer sum values, if  
     115            ! it contains anything at all. Hence it only needs to be opened  
     116            ! and written to on the master PE, not on all PEs.   
     117            CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE','FORMATTED',  &  
     118                          'SEQUENTIAL', -1, numout, lwp , narea )  
     119         ENDIF   
    109120         ! 
    110121      ENDIF 
    111122 
    112       IF( ln_trcdta )      CALL trc_dta_init(jptra) 
    113  
     123      IF( ln_trcdta ) THEN 
     124         CALL trc_dta_init(jptra) 
     125      ENDIF 
    114126 
    115127      IF( ln_rsttr ) THEN 
     
    120132        ! 
    121133        IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping 
    122             ! 
    123             CALL wrk_alloc( jpi, jpj, jpk, ztrcdta )    ! Memory allocation 
    124134            ! 
    125135            DO jn = 1, jptra 
    126136               IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    127137                  jl = n_trc_index(jn)  
    128                   CALL trc_dta( nit000, sf_trcdta(jl),rf_trfac(jl) )   ! read tracer data at nit000 
    129                   ztrcdta(:,:,:) = sf_trcdta(jl)%fnow(:,:,:) 
    130                   trn(:,:,:,jn) = ztrcdta(:,:,:) * tmask(:,:,:)   
     138                  CALL trc_dta( nit000, sf_trcdta(jl), rf_trfac(jl) )   ! read tracer data at nit000 
     139                  trn(:,:,:,jn) = sf_trcdta(jl)%fnow(:,:,:)  
    131140                  IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !== deallocate data structure   ==! 
    132141                     !                                                    (data used only for initialisation) 
     
    138147               ENDIF 
    139148            ENDDO 
    140             CALL wrk_dealloc( jpi, jpj, jpk, ztrcdta ) 
     149            ! 
    141150        ENDIF 
    142151        ! 
     
    146155  
    147156      tra(:,:,:,:) = 0._wp 
    148       IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav )   &              ! Partial steps: before horizontal gradient of passive 
    149         &    CALL zps_hde    ( nit000, jptra, trn, gtru, gtrv  )  ! Partial steps: before horizontal gradient 
    150       IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav )   & 
    151         &    CALL zps_hde_isf( nit000, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )       ! tracers at the bottom ocean level 
    152  
    153  
    154157      ! 
    155158      IF( nn_dttrc /= 1 )        CALL trc_sub_ini      ! Initialize variables for substepping passive tracers 
     
    168171         WRITE(numout,*) '          *** Total inital content of all tracers ' 
    169172         WRITE(numout,*) 
     173# if defined key_debug_medusa 
     174         CALL flush(numout) 
     175# endif 
     176         ! 
     177# if defined key_debug_medusa 
     178         WRITE(numout,*) ' litle check :  ', ctrcnm(1) 
     179         CALL flush(numout) 
     180# endif 
    170181         DO jn = 1, jptra 
    171182            WRITE(numout,9000) jn, TRIM( ctrcnm(jn) ), trai(jn) 
     
    180191         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 
    181192      ENDIF 
     193 
     194      IF(lwp) WRITE(numout,*) 
     195      IF(lwp) WRITE(numout,*) 'trc_init : passive tracer set up completed' 
     196      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     197      IF(lwp) CALL flush(numout) 
     198# if defined key_debug_medusa 
     199         CALL trc_rst_stat 
     200         CALL flush(numout) 
     201# endif 
     202 
    1822039000  FORMAT(' tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10) 
    183204      ! 
     
    201222      USE trdmxl_trc    , ONLY:   trd_mxl_trc_alloc 
    202223#endif 
     224# if defined key_medusa 
     225      USE bio_medusa_mod, ONLY:   bio_medusa_alloc 
     226# endif 
     227 
    203228      ! 
    204229      INTEGER :: ierr 
     
    213238      ierr = ierr + trd_mxl_trc_alloc() 
    214239#endif 
     240#if defined key_medusa 
     241      ierr = ierr + bio_medusa_alloc() 
     242#endif 
    215243      ! 
    216244      IF( lk_mpp    )   CALL mpp_sum( ierr ) 
Note: See TracChangeset for help on using the changeset viewer.