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 7351 for branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90 – NEMO

Ignore:
Timestamp:
2016-11-28T17:04:10+01:00 (7 years ago)
Author:
emanuelaclementi
Message:

ticket #1805 step 3: /2016/dev_INGV_UKMO_2016 aligned to the trunk at revision 7161

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r5836 r7351  
    3838   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1) 
    3939 
    40    INTEGER, PARAMETER           ::   npncts   = 5        ! number of closed sea 
     40   INTEGER, PARAMETER           ::   npncts   = 8        ! number of closed sea 
    4141   INTEGER, DIMENSION(npncts)   ::   nctsi1, nctsj1      ! south-west closed sea limits (i,j) 
    4242   INTEGER, DIMENSION(npncts)   ::   nctsi2, nctsj2      ! north-east closed sea limits (i,j) 
    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)  
    109                CALL trc_dta( kt, sf_trcdta(jl),rf_trfac(jl) )   ! read tracer data at nit000 
    110                ztrcdta(:,:,:) = sf_trcdta(jl)%fnow(:,:,:) 
    111  
     106               CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
     107               ! 
    112108               SELECT CASE ( nn_zdmp_tr ) 
    113109               ! 
     
    116112                     DO jj = 2, jpjm1 
    117113                        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 
     114                           tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    120115                        END DO 
    121116                     END DO 
    122117                  END DO 
    123                ! 
     118                  ! 
    124119               CASE ( 1 )                !==  no damping in the turbocline (avt > 5 cm2/s)  ==! 
    125120                  DO jk = 1, jpkm1 
     
    127122                        DO ji = fs_2, fs_jpim1   ! vector opt. 
    128123                           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 
     124                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    131125                           ENDIF 
    132126                        END DO 
    133127                     END DO 
    134128                  END DO 
    135                ! 
     129                  ! 
    136130               CASE ( 2 )               !==  no damping in the mixed layer   ==!  
    137131                  DO jk = 1, jpkm1 
    138132                     DO jj = 2, jpjm1 
    139133                        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 
     134                           IF( gdept_n(ji,jj,jk) >= hmlp (ji,jj) ) THEN 
     135                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    143136                           END IF 
    144137                        END DO 
    145138                     END DO 
    146139                  END DO 
    147                 
     140                   
    148141               END SELECT 
    149142               !  
     
    162155      IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd ) 
    163156      !                                          ! 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' ) 
     157      IF( ln_ctl ) THEN 
     158         WRITE(charout, FMT="('dmp ')") 
     159         CALL prt_ctl_trc_info(charout) 
     160         CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    167161      ENDIF 
    168162      ! 
     
    170164      ! 
    171165   END SUBROUTINE trc_dmp 
     166 
    172167 
    173168   SUBROUTINE trc_dmp_ini 
     
    180175      !!              called by trc_dmp at the first timestep (nittrc000) 
    181176      !!---------------------------------------------------------------------- 
    182       ! 
    183       INTEGER ::  ios                 ! Local integer output status for namelist read 
    184       INTEGER :: imask  !local file handle 
    185       ! 
     177      INTEGER ::   ios, imask  ! local integers 
     178      !! 
    186179      NAMELIST/namtrc_dmp/ nn_zdmp_tr , cn_resto_tr 
    187180      !!---------------------------------------------------------------------- 
    188  
    189       IF( nn_timing == 1 )  CALL timing_start('trc_dmp_init') 
    190       ! 
    191  
     181      ! 
     182      IF( nn_timing == 1 )  CALL timing_start('trc_dmp_ini') 
     183      ! 
    192184      REWIND( numnat_ref )              ! Namelist namtrc_dmp in reference namelist : Passive tracers newtonian damping 
    193185      READ  ( numnat_ref, namtrc_dmp, IOSTAT = ios, ERR = 909) 
     
    207199         WRITE(numout,*) '      Restoration coeff file    cn_resto_tr = ', cn_resto_tr 
    208200      ENDIF 
     201      !                          ! Allocate arrays 
     202      IF( trc_dmp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trc_dmp_ini: unable to allocate arrays' ) 
    209203      ! 
    210204      IF( lzoom .AND. .NOT.lk_c1d )   nn_zdmp_tr = 0           ! restoring to climatology at closed north or south boundaries 
     
    233227   END SUBROUTINE trc_dmp_ini 
    234228 
     229 
    235230   SUBROUTINE trc_dmp_clo( kt ) 
    236231      !!--------------------------------------------------------------------- 
     
    247242      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    248243      ! 
    249       INTEGER :: ji , jj, jk, jn, jl, jc                     ! dummy loop indicesa 
     244      INTEGER :: ji , jj, jk, jn, jl, jc                    ! dummy loop indicesa 
    250245      INTEGER :: isrow                                      ! local index 
    251246      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrcdta       ! 3D  workspace 
     
    270265            ! 
    271266                                                        ! Caspian Sea 
    272             nctsi1(1)   = 332  ; nctsj1(1)   = 243 - isrow 
    273             nctsi2(1)   = 344  ; nctsj2(1)   = 275 - isrow 
     267            nctsi1(1)   = 333  ; nctsj1(1)   = 243 - isrow 
     268            nctsi2(1)   = 342  ; nctsj2(1)   = 274 - isrow 
     269            !                                           ! Lake Superior 
     270            nctsi1(2)   = 198  ; nctsj1(2)   = 258 - isrow 
     271            nctsi2(2)   = 204  ; nctsj2(2)   = 262 - isrow 
     272            !                                           ! Lake Michigan 
     273            nctsi1(3)   = 201  ; nctsj1(3)   = 250 - isrow 
     274            nctsi2(3)   = 203  ; nctsj2(3)   = 256 - isrow 
     275            !                                           ! Lake Huron 
     276            nctsi1(4)   = 204  ; nctsj1(4)   = 252 - isrow 
     277            nctsi2(4)   = 209  ; nctsj2(4)   = 256 - isrow 
     278            !                                           ! Lake Erie 
     279            nctsi1(5)   = 206  ; nctsj1(5)   = 249 - isrow 
     280            nctsi2(5)   = 209  ; nctsj2(5)   = 251 - isrow 
     281            !                                           ! Lake Ontario 
     282            nctsi1(6)   = 210  ; nctsj1(6)   = 252 - isrow 
     283            nctsi2(6)   = 212  ; nctsj2(6)   = 252 - isrow 
     284            !                                           ! Victoria Lake 
     285            nctsi1(7)   = 321  ; nctsj1(7)   = 180 - isrow 
     286            nctsi2(7)   = 322  ; nctsj2(7)   = 189 - isrow 
     287            !                                           ! Baltic Sea 
     288            nctsi1(8)   = 297  ; nctsj1(8)   = 270 - isrow 
     289            nctsi2(8)   = 308  ; nctsj2(8)   = 293 - isrow 
    274290            !                                         
    275291            !                                           ! ======================= 
     
    345361            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    346362                jl = n_trc_index(jn) 
    347                 CALL trc_dta( kt, sf_trcdta(jl),rf_trfac(jl) )   ! read tracer data at nit000 
    348                 ztrcdta(:,:,:) = sf_trcdta(jl)%fnow(:,:,:) 
     363                CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
    349364                DO jc = 1, npncts 
    350365                   DO jk = 1, jpkm1 
    351366                      DO jj = nctsj1(jc), nctsj2(jc) 
    352367                         DO ji = nctsi1(jc), nctsi2(jc) 
    353                             trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk) * tmask(ji,jj,jk) 
     368                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk) 
    354369                            trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 
    355370                         ENDDO 
     
    364379   END SUBROUTINE trc_dmp_clo 
    365380 
    366  
     381  
    367382#else 
    368383   !!---------------------------------------------------------------------- 
     
    376391#endif 
    377392 
    378  
    379393   !!====================================================================== 
    380394END MODULE trcdmp 
Note: See TracChangeset for help on using the changeset viewer.