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 6140 for trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90 – NEMO

Ignore:
Timestamp:
2015-12-21T12:35:23+01:00 (8 years ago)
Author:
timgraham
Message:

Merge of branches/2015/dev_merge_2015 back into trunk. Merge excludes NEMOGCM/TOOLS/OBSTOOLS/ for now due to issues with the change of file type. Will sort these manually with further commits.

Branch merged as follows:
In the working copy of branch ran:
svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk@HEAD
Small conflicts due to bug fixes applied to trunk since the dev_merge_2015 was copied. Bug fixes were applied to the branch as well so these were easy to resolve.
Branch committed at this stage

In working copy run:
svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
to switch working copy

Run:
svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2015/dev_merge_2015
to merge the branch into the trunk and then commit - no conflicts at this stage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r5836 r6140  
    4343 
    4444   !! * Substitutions 
    45 #  include "domzgr_substitute.h90" 
    4645#  include "vectopt_loop_substitute.h90" 
    4746   !!---------------------------------------------------------------------- 
     
    8281      !!              - save the trends ('key_trdmxl_trc') 
    8382      !!---------------------------------------------------------------------- 
    84       !! 
    85       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    86       !! 
    87       INTEGER  ::   ji, jj, jk, jn, jl       ! dummy loop indices 
    88       REAL(wp) ::   ztra                 ! temporary scalars 
    89       CHARACTER (len=22) :: charout 
     83      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     84      ! 
     85      INTEGER ::   ji, jj, jk, jn, jl   ! dummy loop indices 
     86      CHARACTER (len=22) ::   charout 
    9087      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrtrd 
    91       REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrcdta   ! 3D  workspace 
     88      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrcdta   ! 3D  workspace 
    9289      !!---------------------------------------------------------------------- 
    9390      ! 
     
    105102            ! 
    106103            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    107                 
     104               ! 
    108105               jl = n_trc_index(jn)  
    109106               CALL trc_dta( kt, sf_trcdta(jl),rf_trfac(jl) )   ! read tracer data at nit000 
    110107               ztrcdta(:,:,:) = sf_trcdta(jl)%fnow(:,:,:) 
    111  
     108               ! 
    112109               SELECT CASE ( nn_zdmp_tr ) 
    113110               ! 
     
    116113                     DO jj = 2, jpjm1 
    117114                        DO ji = fs_2, fs_jpim1   ! vector opt. 
    118                            ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    119                            tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
     115                           tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    120116                        END DO 
    121117                     END DO 
    122118                  END DO 
    123                ! 
     119                  ! 
    124120               CASE ( 1 )                !==  no damping in the turbocline (avt > 5 cm2/s)  ==! 
    125121                  DO jk = 1, jpkm1 
     
    127123                        DO ji = fs_2, fs_jpim1   ! vector opt. 
    128124                           IF( avt(ji,jj,jk) <= 5.e-4_wp )  THEN  
    129                               ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    130                               tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
     125                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    131126                           ENDIF 
    132127                        END DO 
    133128                     END DO 
    134129                  END DO 
    135                ! 
     130                  ! 
    136131               CASE ( 2 )               !==  no damping in the mixed layer   ==!  
    137132                  DO jk = 1, jpkm1 
    138133                     DO jj = 2, jpjm1 
    139134                        DO ji = fs_2, fs_jpim1   ! vector opt. 
    140                            IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN 
    141                               ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    142                               tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
     135                           IF( gdept_n(ji,jj,jk) >= hmlp (ji,jj) ) THEN 
     136                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    143137                           END IF 
    144138                        END DO 
    145139                     END DO 
    146140                  END DO 
    147                 
     141                   
    148142               END SELECT 
    149143               !  
     
    162156      IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd ) 
    163157      !                                          ! print mean trends (used for debugging) 
    164       IF( ln_ctl )   THEN 
    165          WRITE(charout, FMT="('dmp ')") ;  CALL prt_ctl_trc_info(charout) 
    166                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
     158      IF( ln_ctl ) THEN 
     159         WRITE(charout, FMT="('dmp ')") 
     160         CALL prt_ctl_trc_info(charout) 
     161         CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    167162      ENDIF 
    168163      ! 
     
    170165      ! 
    171166   END SUBROUTINE trc_dmp 
     167 
    172168 
    173169   SUBROUTINE trc_dmp_ini 
     
    180176      !!              called by trc_dmp at the first timestep (nittrc000) 
    181177      !!---------------------------------------------------------------------- 
    182       ! 
    183       INTEGER ::  ios                 ! Local integer output status for namelist read 
    184       INTEGER :: imask  !local file handle 
    185       ! 
     178      INTEGER ::   ios, imask  ! local integers 
     179      !! 
    186180      NAMELIST/namtrc_dmp/ nn_zdmp_tr , cn_resto_tr 
    187181      !!---------------------------------------------------------------------- 
    188  
     182      ! 
    189183      IF( nn_timing == 1 )  CALL timing_start('trc_dmp_init') 
    190184      ! 
    191  
    192185      REWIND( numnat_ref )              ! Namelist namtrc_dmp in reference namelist : Passive tracers newtonian damping 
    193186      READ  ( numnat_ref, namtrc_dmp, IOSTAT = ios, ERR = 909) 
     
    233226   END SUBROUTINE trc_dmp_ini 
    234227 
     228 
    235229   SUBROUTINE trc_dmp_clo( kt ) 
    236230      !!--------------------------------------------------------------------- 
     
    245239      !!                nctsi2(), nctsj2() : north-east Closed sea limits (i,j) 
    246240      !!---------------------------------------------------------------------- 
    247       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    248       ! 
    249       INTEGER :: ji , jj, jk, jn, jl, jc                     ! dummy loop indicesa 
    250       INTEGER :: isrow                                      ! local index 
    251       REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrcdta       ! 3D  workspace 
    252  
    253       !!---------------------------------------------------------------------- 
    254  
     241      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     242      ! 
     243      INTEGER ::   ji , jj, jk, jn, jl, jc   ! dummy loop indicesa 
     244      INTEGER ::   isrow                     ! local index 
     245      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrcdta   ! 3D  workspace 
     246      !!---------------------------------------------------------------------- 
     247      ! 
    255248      IF( kt == nit000 ) THEN 
    256249         ! initial values 
     
    364357   END SUBROUTINE trc_dmp_clo 
    365358 
    366  
    367359#else 
    368360   !!---------------------------------------------------------------------- 
     
    376368#endif 
    377369 
    378  
    379370   !!====================================================================== 
    380371END MODULE trcdmp 
Note: See TracChangeset for help on using the changeset viewer.