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 7646 for trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90 – NEMO

Ignore:
Timestamp:
2017-02-06T10:25:03+01:00 (7 years ago)
Author:
timgraham
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r6701 r7646  
    2424   USE trcrst 
    2525   USE lib_mpp         ! distribued memory computing library 
    26    USE sbc_oce 
    2726   USE trcice          ! tracers in sea ice 
    28    USE trcbc,   only : trc_bc_init ! generalized Boundary Conditions 
     27   USE trcbc,   only : trc_bc_ini ! generalized Boundary Conditions 
    2928  
    3029   IMPLICIT NONE 
     
    5857      IF(lwp) WRITE(numout,*) 'trc_init : initial set up of the passive tracers' 
    5958      IF(lwp) WRITE(numout,*) '~~~~~~~' 
    60  
    61       ! 
     59      ! 
     60      CALL trc_ini_ctl   ! control  
     61      CALL trc_nam       ! read passive tracers namelists 
    6262      CALL top_alloc()   ! allocate TOP arrays 
    6363      ! 
    64       CALL trc_ini_ctl   ! control  
    65       ! 
    66       CALL trc_nam       ! read passive tracers namelists 
     64      IF(.NOT.ln_trcdta )   ln_trc_ini(:) = .FALSE. 
    6765      ! 
    6866      IF(lwp) WRITE(numout,*) 
    69       ! 
    70       IF( ln_rsttr .AND. .NOT. lk_offline ) CALL trc_rst_cal( nit000, 'READ' )   ! calendar 
    71       ! 
     67      IF( ln_rsttr .AND. .NOT. l_offline ) CALL trc_rst_cal( nit000, 'READ' )   ! calendar 
    7268      IF(lwp) WRITE(numout,*) 
    7369      ! 
    7470      CALL trc_ini_sms   ! SMS 
    75       ! 
     71      CALL trc_ini_inv   ! Inventories 
    7672      CALL trc_ini_trp   ! passive tracers transport 
    77       ! 
    7873      CALL trc_ice_ini   ! Tracers in sea ice 
    7974      ! 
    80       IF( lwp )  & 
    81          &  CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp , narea ) 
     75      IF(lwp) CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp , narea ) 
    8276      ! 
    8377      CALL trc_ini_state  !  passive tracers initialisation : from a restart or from clim 
    84       ! 
    85       IF( nn_dttrc /= 1 )        CALL trc_sub_ini      ! Initialize variables for substepping passive tracers 
    86       ! 
    87       CALL trc_ini_inv   ! Inventories 
     78      IF( nn_dttrc /= 1 ) & 
     79      CALL trc_sub_ini    ! Initialize variables for substepping passive tracers 
    8880      ! 
    8981      IF( nn_timing == 1 )   CALL timing_stop('trc_init') 
     
    10193      ! Define logical parameter ton control dirunal cycle in TOP 
    10294      l_trcdm2dc = ln_dm2dc .OR. ( ln_cpl .AND. ncpl_qsr_freq /= 1 ) 
    103       l_trcdm2dc = l_trcdm2dc  .AND. .NOT. lk_offline 
     95      l_trcdm2dc = l_trcdm2dc  .AND. .NOT. l_offline 
    10496      IF( l_trcdm2dc .AND. lwp )   CALL ctl_warn( 'Coupling with passive tracers and used of diurnal cycle.',   & 
    10597         &                           'Computation of a daily mean shortwave for some biogeochemical models ' ) 
     
    120112         cvol(:,:,jk) = e1e2t(:,:) * e3t_n(:,:,jk) * tmask(:,:,jk) 
    121113      END DO 
    122       IF( lk_degrad )   cvol(:,:,:) = cvol(:,:,:) * facvol(:,:,:)    ! degrad option: reduction by facvol 
    123114      !                                                              ! total volume of the ocean  
    124115      areatot = glob_sum( cvol(:,:,:) ) 
     
    131122      IF(lwp) THEN               ! control print 
    132123         WRITE(numout,*) 
    133          WRITE(numout,*) 
    134          WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra 
    135          WRITE(numout,*) '          *** Total volume of ocean                = ', areatot 
    136          WRITE(numout,*) '          *** Total inital content of all tracers ' 
     124         WRITE(numout,*) '  *** Total number of passive tracer jptra = ', jptra 
     125         WRITE(numout,*) '  *** Total volume of ocean                = ', areatot 
     126         WRITE(numout,*) '  *** Total inital content of all tracers ' 
    137127         WRITE(numout,*) 
    138128         DO jn = 1, jptra 
     
    148138         CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 
    149139      ENDIF 
    150 9000  FORMAT(' tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10) 
     1409000  FORMAT('  tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10) 
    151141      ! 
    152142   END SUBROUTINE trc_ini_inv 
     
    158148      !! ** Purpose :   SMS initialisation 
    159149      !!---------------------------------------------------------------------- 
    160       USE trcini_cfc      ! CFC      initialisation 
    161       USE trcini_pisces   ! PISCES   initialisation 
    162       USE trcini_c14b     ! C14 bomb initialisation 
    163       USE trcini_my_trc   ! MY_TRC   initialisation 
    164       !!---------------------------------------------------------------------- 
    165       IF( lk_pisces  )       CALL trc_ini_pisces       ! PISCES  bio-model 
    166       IF( lk_cfc     )       CALL trc_ini_cfc          ! CFC     tracers 
    167       IF( lk_c14b    )       CALL trc_ini_c14b         ! C14 bomb  tracer 
    168       IF( lk_my_trc  )       CALL trc_ini_my_trc       ! MY_TRC  tracers 
     150      USE trcini_pisces  ! PISCES   initialisation 
     151      USE trcini_cfc     ! CFC      initialisation 
     152      USE trcini_c14     ! C14  initialisation 
     153      USE trcini_age     ! age initialisation 
     154      USE trcini_my_trc  ! MY_TRC   initialisation 
     155      ! 
     156      INTEGER :: jn 
     157      !!---------------------------------------------------------------------- 
     158      ! 
     159      ! Pass sn_tracer fields to specialized arrays  
     160      DO jn = 1, jp_bgc 
     161         ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname ) 
     162         ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname ) 
     163         ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  ) 
     164         ln_trc_ini(jn) =       sn_tracer(jn)%llinit 
     165         ln_trc_sbc(jn) =       sn_tracer(jn)%llsbc 
     166         ln_trc_cbc(jn) =       sn_tracer(jn)%llcbc 
     167         ln_trc_obc(jn) =       sn_tracer(jn)%llobc 
     168      END DO 
     169      !     
     170      IF( ln_pisces  )   CALL trc_ini_pisces     !  PISCES model 
     171      IF( ln_my_trc  )   CALL trc_ini_my_trc     !  MY_TRC model 
     172      IF( ll_cfc     )   CALL trc_ini_cfc        !  CFC's 
     173      IF( ln_c14     )   CALL trc_ini_c14        !  C14 model 
     174      IF( ln_age     )   CALL trc_ini_age        !  AGE 
     175      ! 
     176      IF(lwp) THEN                   ! control print 
     177         WRITE(numout,*) 
     178         WRITE(numout,*) ' trc_init: Summary for selected passive tracers' 
     179         WRITE(numout,*) ' ~~~~~~~~~~~~~~' 
     180         WRITE(numout,*) ' ID     NAME     INI  SBC  CBC  OBC' 
     181         DO jn = 1, jptra 
     182            WRITE(numout,9001) jn, TRIM(ctrcnm(jn)), ln_trc_ini(jn), ln_trc_sbc(jn),ln_trc_cbc(jn),ln_trc_obc(jn) 
     183         END DO 
     184      ENDIF 
     1859001  FORMAT(1x,i3,1x,a10,3x,l2,3x,l2,3x,l2,3x,l2) 
    169186      ! 
    170187   END SUBROUTINE trc_ini_sms 
     
    207224      ! 
    208225      ! Initialisation of tracers Initial Conditions 
    209       IF( ln_trcdta )      CALL trc_dta_init(jptra) 
     226      IF( ln_trcdta )      CALL trc_dta_ini(jptra) 
    210227 
    211228      ! Initialisation of tracers Boundary Conditions 
    212       IF( lk_my_trc )     CALL trc_bc_init(jptra) 
     229      IF( ln_my_trc )     CALL trc_bc_ini(jptra) 
    213230 
    214231      IF( ln_rsttr ) THEN 
     
    217234        ! 
    218235      ELSE 
    219         ! 
    220         IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping 
    221             ! 
     236        ! Initialisation of tracer from a file that may also be used for damping 
     237        IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN 
     238            ! update passive tracers arrays with input data read from file 
    222239            DO jn = 1, jptra 
    223                IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
     240               IF( ln_trc_ini(jn) ) THEN 
    224241                  jl = n_trc_index(jn)  
    225                   CALL trc_dta( nit000, sf_trcdta(jl), rf_trfac(jl) )   ! read tracer data at nit000 
    226                   trn(:,:,:,jn) = sf_trcdta(jl)%fnow(:,:,:)  
     242                  CALL trc_dta( nit000, sf_trcdta(jl), rf_trfac(jl), trn(:,:,:,jn) ) 
    227243                  ! 
    228                   IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !== deallocate data structure   ==! 
    229                      !                                                    (data used only for initialisation) 
     244                  ! deallocate data structure if data are not used for damping 
     245                  IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN 
    230246                     IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only used to initialize the run' 
    231                                                   DEALLOCATE( sf_trcdta(jl)%fnow )     !  arrays in the structure 
     247                                                  DEALLOCATE( sf_trcdta(jl)%fnow ) 
    232248                     IF( sf_trcdta(jl)%ln_tint )  DEALLOCATE( sf_trcdta(jl)%fdta ) 
    233249                     ! 
Note: See TracChangeset for help on using the changeset viewer.