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/TRP – NEMO

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

Merge with GO6 FOAMv14 package branch r9288

Location:
branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/TOP_SRC/TRP
Files:
8 edited

Legend:

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

    r7960 r9987  
    2626   USE traadv_mle      ! ML eddy induced velocity  (tra_adv_mle    routine) 
    2727   USE ldftra_oce      ! lateral diffusion coefficient on tracers 
     28   USE trd_oce 
     29   USE trdtra 
    2830   USE prtctl_trc      ! Print control 
    2931 
     
    7173      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    7274      ! 
    73       INTEGER ::   jk  
     75      INTEGER ::   jk, jn  
    7476      CHARACTER (len=22) ::   charout 
    7577      REAL(wp), POINTER, DIMENSION(:,:,:) :: zun, zvn, zwn  ! effective velocity 
     78      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   ztrtrd 
    7679      !!---------------------------------------------------------------------- 
    7780      ! 
     
    111114      IF( ln_mle    )   CALL tra_adv_mle( kt, nittrc000, zun, zvn, zwn, 'TRC' )    ! add the mle transport (if necessary) 
    112115      ! 
     116      IF( l_trdtrc )  THEN 
     117         CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) 
     118         ztrtrd(:,:,:,:)  = tra(:,:,:,:) 
     119      ENDIF 
     120      ! 
    113121      SELECT CASE ( nadv )                            !==  compute advection trend and add it to general trend  ==! 
    114122      CASE ( 1 )   ;    CALL tra_adv_cen2  ( kt, nittrc000, 'TRC',       zun, zvn, zwn, trb, trn, tra, jptra )   !  2nd order centered 
     
    140148         ! 
    141149      END SELECT 
     150      ! 
     151      IF( l_trdtrc )   THEN                      ! save the advective trends for further diagnostics 
     152        DO jn = 1, jptra 
     153           ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn) 
     154           CALL trd_tra( kt, 'TRC', jn, jptra_totad, ztrtrd(:,:,:,jn) ) 
     155        END DO 
     156        CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) 
     157      ENDIF 
    142158 
    143159      !                                              ! print mean trends (used for debugging) 
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90

    r7960 r9987  
    5353      INTEGER, INTENT( in ) ::   kt   ! ocean time-step  
    5454      CHARACTER (len=22) :: charout 
    55       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   ztrtrd 
     55      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrtrd 
    5656      !!---------------------------------------------------------------------- 
    5757      ! 
     
    6464 
    6565      IF( l_trdtrc )  THEN 
    66          CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends 
     66         ALLOCATE(ztrtrd( 1:jpi, 1:jpj, 1:jpk, 1:jptra )) ! temporary save of trends 
    6767         ztrtrd(:,:,:,:)  = tra(:,:,:,:) 
    6868      ENDIF 
     
    9595           CALL trd_tra( kt, 'TRC', jn, jptra_bbl, ztrtrd(:,:,:,jn) ) 
    9696        END DO 
    97         CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends 
     97        DEALLOCATE(ztrtrd ) ! temporary save of trends 
    9898      ENDIF 
    9999      ! 
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r7960 r9987  
    3535   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1) 
    3636 
    37    INTEGER, PARAMETER           ::   npncts   = 5        ! number of closed sea 
     37   INTEGER, PARAMETER           ::   npncts   = 8        ! number of closed sea 
    3838   INTEGER, DIMENSION(npncts)   ::   nctsi1, nctsj1      ! south-west closed sea limits (i,j) 
    3939   INTEGER, DIMENSION(npncts)   ::   nctsi2, nctsj2      ! north-east closed sea limits (i,j) 
     
    107107                
    108108               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(:,:,:) 
     109               CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
    111110 
    112111               SELECT CASE ( nn_zdmp_tr ) 
     
    208207            ! 
    209208                                                        ! Caspian Sea 
    210             nctsi1(1)   = 332  ; nctsj1(1)   = 243 - isrow 
    211             nctsi2(1)   = 344  ; nctsj2(1)   = 275 - isrow 
     209            nctsi1(1)   = 333  ; nctsj1(1)   = 243 - isrow 
     210            nctsi2(1)   = 342  ; nctsj2(1)   = 274 - isrow 
     211            !                                           ! Lake Superior 
     212            nctsi1(2)   = 198  ; nctsj1(2)   = 258 - isrow 
     213            nctsi2(2)   = 204  ; nctsj2(2)   = 262 - isrow 
     214            !                                           ! Lake Michigan 
     215            nctsi1(3)   = 201  ; nctsj1(3)   = 250 - isrow 
     216            nctsi2(3)   = 203  ; nctsj2(3)   = 256 - isrow 
     217            !                                           ! Lake Huron 
     218            nctsi1(4)   = 204  ; nctsj1(4)   = 252 - isrow 
     219            nctsi2(4)   = 209  ; nctsj2(4)   = 256 - isrow 
     220            !                                           ! Lake Erie 
     221            nctsi1(5)   = 206  ; nctsj1(5)   = 249 - isrow 
     222            nctsi2(5)   = 209  ; nctsj2(5)   = 251 - isrow 
     223            !                                           ! Lake Ontario 
     224            nctsi1(6)   = 210  ; nctsj1(6)   = 252 - isrow 
     225            nctsi2(6)   = 212  ; nctsj2(6)   = 252 - isrow 
     226            !                                           ! Victoria Lake 
     227            nctsi1(7)   = 321  ; nctsj1(7)   = 180 - isrow 
     228            nctsi2(7)   = 322  ; nctsj2(7)   = 189 - isrow 
     229            !                                           ! Baltic Sea 
     230            nctsi1(8)   = 297  ; nctsj1(8)   = 270 - isrow 
     231            nctsi2(8)   = 308  ; nctsj2(8)   = 293 - isrow 
    212232            !                                         
    213233            !                                           ! ======================= 
     
    283303            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    284304                jl = n_trc_index(jn) 
    285                 CALL trc_dta( kt, sf_trcdta(jl),rf_trfac(jl) )   ! read tracer data at nit000 
    286                 ztrcdta(:,:,:) = sf_trcdta(jl)%fnow(:,:,:) 
     305                CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
    287306                DO jc = 1, npncts 
    288307                   DO jk = 1, jpkm1 
    289308                      DO jj = nctsj1(jc), nctsj2(jc) 
    290309                         DO ji = nctsi1(jc), nctsi2(jc) 
    291                             trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk) * tmask(ji,jj,jk) 
     310                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk) 
    292311                            trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 
    293312                         ENDDO 
     
    317336      IF( nn_timing == 1 )  CALL timing_start('trc_dmp_init') 
    318337      ! 
     338      !Allocate arrays 
     339      IF( trc_dmp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trc_dmp_init: unable to allocate arrays' ) 
    319340 
    320341      IF( lzoom )   nn_zdmp_tr = 0           ! restoring to climatology at closed north or south boundaries 
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90

    r7960 r9987  
    5656      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
    5757      !! 
    58       INTEGER            :: jn 
     58      INTEGER            :: ji, jj, jk, jn 
     59      REAL(wp)           :: zdep 
    5960      CHARACTER (len=22) :: charout 
    60       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   ztrtrd 
     61      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrtrd 
    6162      !!---------------------------------------------------------------------- 
    6263      ! 
     
    6667 
    6768      rldf = rldf_rat 
    68  
     69      ! 
     70      r_fact_lap(:,:,:) = 1. 
     71      DO jk= 1, jpk 
     72         DO jj = 1, jpj 
     73            DO ji = 1, jpi 
     74               IF( fsdept(ji,jj,jk) > 200. .AND. gphit(ji,jj) < 5. .AND. gphit(ji,jj) > -5. ) THEN 
     75                  zdep = MAX( fsdept(ji,jj,jk) - 1000., 0. ) / 1000. 
     76                  r_fact_lap(ji,jj,jk) = MAX( 1., rn_fact_lap * EXP( -zdep ) ) 
     77               ENDIF 
     78            END DO 
     79         END DO 
     80      END DO 
     81      ! 
    6982      IF( l_trdtrc )  THEN 
    70          CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) 
     83         ALLOCATE( ztrtrd ( 1:jpi, 1:jpj, 1:jpk, 1:jptra) ) 
    7184         ztrtrd(:,:,:,:)  = tra(:,:,:,:) 
    7285      ENDIF 
     
    107120           CALL trd_tra( kt, 'TRC', jn, jptra_ldf, ztrtrd(:,:,:,jn) ) 
    108121        END DO 
    109         CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) 
     122        DEALLOCATE( ztrtrd ) 
    110123      ENDIF 
    111124      !                                          ! print mean trends (used for debugging) 
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90

    r7960 r9987  
    4040   REAL(wp), PUBLIC ::   rn_ahtrc_0          !: diffusivity coefficient for passive tracer (m2/s) 
    4141   REAL(wp), PUBLIC ::   rn_ahtrb_0          !: background diffusivity coefficient for passive tracer (m2/s) 
     42   REAL(wp), PUBLIC ::   rn_fact_lap         !: Enhanced zonal diffusivity coefficent in the equatorial domain 
    4243 
    4344   !                                        !!: ** Treatment of Negative concentrations ( nam_trcrad ) 
     
    7475      NAMELIST/namtrc_ldf/ ln_trcldf_lap  ,     & 
    7576         &                 ln_trcldf_bilap, ln_trcldf_level,     & 
    76          &                 ln_trcldf_hor  , ln_trcldf_iso  , rn_ahtrc_0, rn_ahtrb_0 
     77         &                 ln_trcldf_hor  , ln_trcldf_iso  , rn_ahtrc_0, rn_ahtrb_0,   & 
     78         &                 rn_fact_lap 
     79 
    7780      NAMELIST/namtrc_zdf/ ln_trczdf_exp  , nn_trczdf_exp 
    7881      NAMELIST/namtrc_rad/ ln_trcrad 
     
    127130         WRITE(numout,*) '      diffusivity coefficient                                 rn_ahtrc_0 = ', rn_ahtrc_0 
    128131         WRITE(numout,*) '      background hor. diffusivity                             rn_ahtrb_0 = ', rn_ahtrb_0 
     132         WRITE(numout,*) '      enhanced zonal diffusivity                             rn_fact_lap = ', rn_fact_lap 
    129133      ENDIF 
    130134 
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90

    r7960 r9987  
    102102      ENDIF 
    103103 
     104#if defined key_agrif 
     105      CALL Agrif_trc                   ! AGRIF zoom boundaries 
     106#endif 
    104107      ! Update after tracer on domain lateral boundaries 
    105108      DO jn = 1, jptra 
     
    110113#if defined key_bdy 
    111114!!      CALL bdy_trc( kt )               ! BDY open boundaries 
    112 #endif 
    113 #if defined key_agrif 
    114       CALL Agrif_trc                   ! AGRIF zoom boundaries 
    115115#endif 
    116116 
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90

    r7960 r9987  
    102102         IF(lwp) WRITE(numout,*) '~~~~~~~ ' 
    103103 
    104          IF( ln_rsttr .AND.    &                     ! Restart: read in restart  file 
    105             iom_varid( numrtr, 'sbc_'//TRIM(ctrcnm(1))//'_b', ldstop = .FALSE. ) > 0 ) THEN 
    106             IF(lwp) WRITE(numout,*) '          nittrc000-nn_dttrc surface tracer content forcing fields red in the restart file' 
    107             zfact = 0.5_wp 
    108             DO jn = 1, jptra 
    109                CALL iom_get( numrtr, jpdom_autoglo, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc_b(:,:,jn) )   ! before tracer content sbc 
    110             END DO 
    111          ELSE                                         ! No restart or restart not found: Euler forward time stepping 
     104         !! JPALM -- 12-01-2016 -- problem after restart, maybe because of this... 
     105         !!                     -- set sbc_trc_b to 0 after restart, first, to check. 
     106         !!------------------------------------------------------------------------------ 
     107        ! IF( ln_rsttr .AND. .NOT.ln_top_euler .AND.   &                     ! Restart: read in restart  file 
     108        !    iom_varid( numrtr, 'sbc_'//TRIM(ctrcnm(1))//'_b', ldstop = .FALSE. ) > 0 ) THEN 
     109        !    IF(lwp) WRITE(numout,*) '          nittrc000-nn_dttrc surface tracer content forcing fields red in the restart file' 
     110        !    zfact = 0.5_wp 
     111        !    DO jn = 1, jptra 
     112        !       CALL iom_get( numrtr, jpdom_autoglo, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc_b(:,:,jn) )   ! before tracer content sbc 
     113        !    END DO 
     114        ! ELSE                                         ! No restart or restart not found: Euler forward time stepping 
    112115           zfact = 1._wp 
    113116           sbc_trc_b(:,:,:) = 0._wp 
    114         ENDIF 
     117        ! ENDIF 
    115118      ELSE                                         ! Swap of forcing fields 
    116119         IF( ln_top_euler ) THEN 
     
    170173            END DO 
    171174         ENDIF 
     175         ! 
     176         CALL lbc_lnk( sbc_trc(:,:,jn), 'T', 1. ) 
    172177         !                                       Concentration dilution effect on tracers due to evaporation & precipitation  
    173178         DO jj = 2, jpj 
     
    188193      !                                           Write in the tracer restar  file 
    189194      !                                          ******************************* 
    190       IF( lrst_trc ) THEN 
     195      IF( lrst_trc .AND. .NOT.ln_top_euler ) THEN 
    191196         IF(lwp) WRITE(numout,*) 
    192197         IF(lwp) WRITE(numout,*) 'sbc : ocean surface tracer content forcing fields written in tracer restart file ',   & 
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90

    r7960 r9987  
    2727   USE trcsbc          ! surface boundary condition          (trc_sbc routine) 
    2828   USE zpshde          ! partial step: hor. derivative       (zps_hde routine) 
     29# if defined key_debug_medusa 
     30   USE trcrst 
     31# endif 
     32 
    2933 
    3034#if defined key_agrif 
     
    6569         ! 
    6670                                CALL trc_sbc( kstp )            ! surface boundary condition 
     71# if defined key_debug_medusa 
     72         IF(lwp) WRITE(numout,*) ' MEDUSA trc_trp after trc_sbc at kt =', kstp 
     73         CALL trc_rst_tra_stat 
     74         CALL flush(numout) 
     75# endif 
    6776         IF( lk_trabbl )        CALL trc_bbl( kstp )            ! advective (and/or diffusive) bottom boundary layer scheme 
    6877         IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends 
    69          IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only 
    7078                                CALL trc_adv( kstp )            ! horizontal & vertical advection  
     79         IF( ln_zps ) THEN 
     80           IF( ln_isfcav ) THEN ; CALL zps_hde_isf( kstp, jptra, trb, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! both top & bottom 
     81           ELSE                 ; CALL zps_hde    ( kstp, jptra, trb, gtru, gtrv )                                      !  only bottom 
     82           ENDIF 
     83         ENDIF 
    7184                                CALL trc_ldf( kstp )            ! lateral mixing 
    7285         IF( .NOT. lk_offline .AND. lk_zdfkpp )    & 
     
    7790                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields 
    7891                                CALL trc_nxt( kstp )            ! tracer fields at next time step      
     92# if defined key_debug_medusa 
     93         IF(lwp) WRITE(numout,*) ' MEDUSA trc_trp after trc_nxt at kt =', kstp 
     94         CALL trc_rst_tra_stat 
     95         CALL flush(numout) 
     96# endif 
    7997         IF( ln_trcrad )        CALL trc_rad( kstp )            ! Correct artificial negative concentrations 
     98         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only 
    8099 
    81100#if defined key_agrif 
     
    83102#endif 
    84103 
    85          IF( ln_zps  .AND. .NOT. ln_isfcav)        & 
    86             &            CALL zps_hde    ( kstp, jptra, trn, gtru, gtrv )   ! Partial steps: now horizontal gradient of passive 
    87          IF( ln_zps .AND.        ln_isfcav)        & 
    88             &            CALL zps_hde_isf( kstp, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! Partial steps: now horizontal gradient of passive 
    89                                                                 ! tracers at the bottom ocean level 
    90          ! 
    91104      ELSE                                               ! 1D vertical configuration 
    92105                                CALL trc_sbc( kstp )            ! surface boundary condition 
     
    100113      ! 
    101114      IF( nn_timing == 1 )   CALL timing_stop('trc_trp') 
     115      ! 
     1169400  FORMAT(a25,i4,D23.16) 
    102117      ! 
    103118   END SUBROUTINE trc_trp 
Note: See TracChangeset for help on using the changeset viewer.