Changeset 10963
- Timestamp:
- 2019-05-10T16:15:43+02:00 (6 years ago)
- Location:
- NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/MY_TRC/trcsms_my_trc.F90
r10425 r10963 32 32 CONTAINS 33 33 34 SUBROUTINE trc_sms_my_trc( kt )34 SUBROUTINE trc_sms_my_trc( kt, Kmm, Krhs ) 35 35 !!---------------------------------------------------------------------- 36 36 !! *** trc_sms_my_trc *** … … 42 42 ! 43 43 INTEGER, INTENT(in) :: kt ! ocean time-step index 44 INTEGER, INTENT(in) :: Kmm, Krhs ! time level indices 44 45 INTEGER :: jn ! dummy loop index 45 46 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrmyt … … 54 55 IF( l_trdtrc ) ALLOCATE( ztrmyt(jpi,jpj,jpk) ) 55 56 56 CALL trc_bc ( kt ) ! tracers: surface and lateral Boundary Conditions57 CALL trc_bc ( kt, Kmm, Krhs ) ! tracers: surface and lateral Boundary Conditions 57 58 58 59 ! add here the call to BGC model -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/P4Z/p4zsms.F90
r10425 r10963 46 46 CONTAINS 47 47 48 SUBROUTINE p4z_sms( kt )48 SUBROUTINE p4z_sms( kt, Kmm ) 49 49 !!--------------------------------------------------------------------- 50 50 !! *** ROUTINE p4z_sms *** … … 59 59 ! 60 60 INTEGER, INTENT( in ) :: kt ! ocean time-step index 61 INTEGER, INTENT( in ) :: Kmm ! time level index 61 62 !! 62 63 INTEGER :: ji, jj, jk, jnt, jn, jl … … 155 156 IF( ln_sediment ) THEN 156 157 ! 157 CALL sed_model( kt ) ! Main program of Sediment model158 CALL sed_model( kt, Kmm ) ! Main program of Sediment model 158 159 ! 159 160 IF( ln_top_euler ) THEN -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/SED/sedmodel.F90
r10222 r10963 16 16 CONTAINS 17 17 18 SUBROUTINE sed_model ( kt )18 SUBROUTINE sed_model ( kt, Kmm ) 19 19 !!--------------------------------------------------------------------- 20 20 !! *** ROUTINE sed_model *** … … 30 30 !!---------------------------------------------------------------------- 31 31 INTEGER, INTENT(in) :: kt ! number of iteration 32 INTEGER, INTENT(in) :: Kmm ! time level indices 32 33 33 34 … … 35 36 36 37 IF( kt == nittrc000 ) CALL sed_initrc ! Initialization of sediment model 37 CALL sed_stp( kt ) ! Time stepping of Sediment model38 CALL sed_stp( kt, Kmm ) ! Time stepping of Sediment model 38 39 39 40 IF( ln_timing ) CALL timing_stop('sed_model') -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/SED/sedstp.F90
r10222 r10963 29 29 CONTAINS 30 30 31 SUBROUTINE sed_stp ( kt )31 SUBROUTINE sed_stp ( kt, Kmm ) 32 32 !!--------------------------------------------------------------------- 33 33 !! *** ROUTINE sed_stp *** … … 45 45 !!---------------------------------------------------------------------- 46 46 INTEGER, INTENT(in) :: kt ! number of iteration 47 INTEGER, INTENT(in) :: Kmm ! time level indices 47 48 INTEGER :: ji,jk,js,jn,jw 48 49 !!---------------------------------------------------------------------- … … 52 53 IF( lrst_sed ) CALL sed_rst_cal ( kt, 'WRITE' ) ! calenda 53 54 54 IF(ln_sediment_offline) CALL trc_dmp_sed ( kt )55 IF(ln_sediment_offline) CALL trc_dmp_sed ( kt, Kmm ) 55 56 56 57 dtsed = r2dttrc -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/SED/trcdmp_sed.F90
r10225 r10963 54 54 55 55 56 SUBROUTINE trc_dmp_sed( kt )56 SUBROUTINE trc_dmp_sed( kt, Kmm ) 57 57 !!---------------------------------------------------------------------- 58 58 !! *** ROUTINE trc_dmp_sed *** … … 74 74 !!---------------------------------------------------------------------- 75 75 INTEGER, INTENT(in) :: kt ! ocean time-step index 76 INTEGER, INTENT(in) :: Kmm ! time level index 76 77 ! 77 78 INTEGER :: ji, jj, jk, jn, jl, ikt ! dummy loop indices … … 90 91 ! 91 92 jl = n_trc_index(jn) 92 CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta ) ! read tracer data at nit00093 CALL trc_dta( kt, Kmm, sf_trcdta(jl), rf_trfac(jl), ztrcdta ) ! read tracer data at nit000 93 94 ! 94 95 DO jj = 1, jpj -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/trcsms_pisces.F90
r10068 r10963 25 25 CONTAINS 26 26 27 SUBROUTINE trc_sms_pisces( kt )27 SUBROUTINE trc_sms_pisces( kt, Kmm ) 28 28 !!--------------------------------------------------------------------- 29 29 !! *** ROUTINE trc_sms_pisces *** … … 35 35 ! 36 36 INTEGER, INTENT( in ) :: kt ! ocean time-step index 37 INTEGER, INTENT( in ) :: Kmm ! time level index 37 38 !!--------------------------------------------------------------------- 38 39 ! 39 IF( ln_p4z .OR. ln_p5z ) THEN ; CALL p4z_sms( kt ) ! PISCES40 IF( ln_p4z .OR. ln_p5z ) THEN ; CALL p4z_sms( kt, Kmm ) ! PISCES 40 41 ELSE ; CALL p2z_sms( kt ) ! LOBSTER 41 42 ENDIF -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/TRP/trcdmp.F90
r10946 r10963 106 106 ! 107 107 jl = n_trc_index(jn) 108 CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta ) ! read tracer data at nit000108 CALL trc_dta( kt, Kmm, sf_trcdta(jl), rf_trfac(jl), ztrcdta ) ! read tracer data at nit000 109 109 ! 110 110 SELECT CASE ( nn_zdmp_tr ) … … 225 225 226 226 227 SUBROUTINE trc_dmp_clo( kt )227 SUBROUTINE trc_dmp_clo( kt, Kmm ) 228 228 !!--------------------------------------------------------------------- 229 229 !! *** ROUTINE trc_dmp_clo *** … … 238 238 !!---------------------------------------------------------------------- 239 239 INTEGER, INTENT( in ) :: kt ! ocean time-step index 240 INTEGER, INTENT( in ) :: Kmm ! time level indices 240 241 ! 241 242 INTEGER :: ji , jj, jk, jn, jl, jc ! dummy loop indicesa … … 355 356 IF( ln_trc_ini(jn) ) THEN ! update passive tracers arrays with input data read from file 356 357 jl = n_trc_index(jn) 357 CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta ) ! read tracer data at nit000358 CALL trc_dta( kt, Kmm, sf_trcdta(jl), rf_trfac(jl), ztrcdta ) ! read tracer data at nit000 358 359 DO jc = 1, npncts 359 360 DO jk = 1, jpkm1 -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/TRP/trcnxt.F90
r10954 r10963 100 100 CALL lbc_lnk( 'trcnxt', tra(:,:,:,:), 'T', 1. ) 101 101 102 IF( ln_bdy ) CALL trc_bdy( kt )102 IF( ln_bdy ) CALL trc_bdy( kt, Kbb, Kmm, Krhs ) 103 103 104 104 IF( l_trdtrc ) THEN ! trends: store now fields before the Asselin filter application -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/TRP/trctrp.F90
r10954 r10963 64 64 IF( ln_trabbl ) CALL trc_bbl ( kt, Kbb, Kmm, Krhs ) ! advective (and/or diffusive) bottom boundary layer scheme 65 65 IF( ln_trcdmp ) CALL trc_dmp ( kt, Kmm, Krhs ) ! internal damping trends 66 IF( ln_bdy ) CALL trc_bdy_dmp( kt )! BDY damping trends66 IF( ln_bdy ) CALL trc_bdy_dmp( kt, Kbb, Krhs ) ! BDY damping trends 67 67 CALL trc_adv ( kt, Kbb, Kmm, tr, Krhs ) ! horizontal & vertical advection 68 68 ! ! Partial top/bottom cell: GRADh( trb ) … … 79 79 CALL trc_zdf( kt, Kbb, Kmm, Krhs, tr, Kaa ) ! vert. mixing & after tracer ==> after 80 80 CALL trc_nxt ( kt, Kbb, Kmm, Krhs ) ! tracer fields at next time step 81 IF( ln_trcrad ) CALL trc_rad ( kt, Kmm, Krhs ) ! Correct artificial negative concentrations82 IF( ln_trcdmp_clo ) CALL trc_dmp_clo( kt ) ! internal damping trends on closed seas only81 IF( ln_trcrad ) CALL trc_rad ( kt, Kmm, Krhs ) ! Correct artificial negative concentrations 82 IF( ln_trcdmp_clo ) CALL trc_dmp_clo( kt, Kmm ) ! internal damping trends on closed seas only 83 83 84 84 ! -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/oce_trc.F90
r10880 r10963 34 34 35 35 !* ocean fields: here now and after fields * 36 USE oce , ONLY : un => un !: i-horizontal velocity (m s-1) 37 USE oce , ONLY : vn => vn !: j-horizontal velocity (m s-1) 38 USE oce , ONLY : wn => wn !: vertical velocity (m s-1) 39 USE oce , ONLY : tsn => tsn !: 4D array contaning ( tn, sn ) 40 USE oce , ONLY : tsb => tsb !: 4D array contaning ( tb, sb ) 41 USE oce , ONLY : tsa => tsa !: 4D array contaning ( ta, sa ) 42 USE oce , ONLY : rhop => rhop !: potential volumic mass (kg m-3) 43 USE oce , ONLY : rhd => rhd !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 44 USE oce , ONLY : hdivn => hdivn !: horizontal divergence (1/s) 45 USE oce , ONLY : sshn => sshn !: sea surface height at t-point [m] 46 USE oce , ONLY : sshb => sshb !: sea surface height at t-point [m] 47 USE oce , ONLY : ssha => ssha !: sea surface height at t-point [m] 48 USE oce , ONLY : rab_n => rab_n !: local thermal/haline expension ratio at T-points 36 USE oce , ONLY : tsn => tsn !: 4D array contaning ( tn, sn ) !TEMPORARY 37 USE oce , ONLY : tsb => tsb !: 4D array contaning ( tb, sb ) !TEMPORARY 38 USE oce , ONLY : tsa => tsa !: 4D array contaning ( ta, sa ) !TEMPORARY 39 USE oce , ONLY : sshn => sshn !: sea surface height at t-point [m] !TEMPORARY 40 USE oce , ONLY : sshb => sshb !: sea surface height at t-point [m] !TEMPORARY 41 USE oce , ONLY : ssha => ssha !: sea surface height at t-point [m] !TEMPORARY 42 USE oce , ONLY : un => un !: 4D array !TEMPORARY 43 USE oce , ONLY : vn => vn !: 4D array !TEMPORARY 44 USE oce , ONLY : wn => wn !: 4D array !TEMPORARY 45 USE oce , ONLY : uu => uu !: i-horizontal velocity (m s-1) 46 USE oce , ONLY : vv => vv !: j-horizontal velocity (m s-1) 47 USE oce , ONLY : ww => ww !: vertical velocity (m s-1) 48 USE oce , ONLY : ts => ts !: 4D array contaning ( tn, sn ) 49 USE oce , ONLY : rhop => rhop !: potential volumic mass (kg m-3) 50 USE oce , ONLY : rhd => rhd !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 51 USE oce , ONLY : hdiv => hdiv !: horizontal divergence (1/s) 52 USE oce , ONLY : ssh => ssh !: sea surface height at t-point [m] 53 USE oce , ONLY : rab_n => rab_n !: local thermal/haline expension ratio at T-points 49 54 50 55 !* surface fluxes * -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcbc.F90
r10068 r10963 55 55 CONTAINS 56 56 57 SUBROUTINE trc_bc_ini( ntrc )57 SUBROUTINE trc_bc_ini( ntrc, Kmm ) 58 58 !!---------------------------------------------------------------------- 59 59 !! *** ROUTINE trc_bc_ini *** … … 64 64 !! - allocates passive tracer BC data structure 65 65 !!---------------------------------------------------------------------- 66 INTEGER,INTENT(in) :: ntrc ! number of tracers 66 INTEGER, INTENT(in) :: ntrc ! number of tracers 67 INTEGER, INTENT(in) :: Kmm ! time level index 67 68 ! 68 69 INTEGER :: jl, jn , ib, ibd, ii, ij, ik ! dummy loop indices … … 267 268 ii = idx_bdy(ib)%nbi(ibd,igrd) 268 269 ij = idx_bdy(ib)%nbj(ibd,igrd) 269 trcdta_bdy(jn,ib)%trc(ibd,ik) = tr n(ii,ij,ik,jn) * tmask(ii,ij,ik)270 trcdta_bdy(jn,ib)%trc(ibd,ik) = tr(ii,ij,ik,jn,Kmm) * tmask(ii,ij,ik) 270 271 END DO 271 272 END DO … … 333 334 334 335 335 SUBROUTINE trc_bc(kt, jit)336 SUBROUTINE trc_bc(kt, Kmm, Krhs, jit) 336 337 !!---------------------------------------------------------------------- 337 338 !! *** ROUTINE trc_bc *** … … 344 345 USE fldread 345 346 !! 346 INTEGER, INTENT(in) :: kt ! ocean time-step index 347 INTEGER, INTENT(in), OPTIONAL :: jit ! subcycle time-step index (for timesplitting option) 347 INTEGER, INTENT(in) :: kt ! ocean time-step index 348 INTEGER, INTENT(in) :: Kmm, Krhs ! time level indices 349 INTEGER, INTENT(in), OPTIONAL :: jit ! subcycle time-step index (for timesplitting option) 348 350 !! 349 351 INTEGER :: ji, jj, jk, jn, jl ! Loop index … … 412 414 DO jk = 1, nk_rnf(ji,jj) 413 415 zrnf = (rnf(ji,jj) + rnf_b(ji,jj)) * 0.5_wp * r1_rau0 / h_rnf(ji,jj) 414 tr a(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + (trn(ji,jj,jk,jn) * zrnf)416 tr(ji,jj,jk,jn,Krhs) = tr(ji,jj,jk,jn,Krhs) + (tr(ji,jj,jk,jn,Kmm) * zrnf) 415 417 END DO 416 418 END DO … … 425 427 DO jj = 2, jpj 426 428 DO ji = fs_2, fs_jpim1 ! vector opt. 427 zfact = 1. / ( e3t _n(ji,jj,1) * rn_bc_time )428 tr a(ji,jj,1,jn) = tra(ji,jj,1,jn) + rf_trsfac(jl) * sf_trcsbc(jl)%fnow(ji,jj,1) * zfact429 zfact = 1. / ( e3t(ji,jj,1,Kmm) * rn_bc_time ) 430 tr(ji,jj,1,jn,Krhs) = tr(ji,jj,1,jn,Krhs) + rf_trsfac(jl) * sf_trcsbc(jl)%fnow(ji,jj,1) * zfact 429 431 END DO 430 432 END DO … … 438 440 DO jk = 1, nk_rnf(ji,jj) 439 441 zfact = rn_rfact / ( e1e2t(ji,jj) * h_rnf(ji,jj) * rn_bc_time ) 440 tr a(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + rf_trcfac(jl) * sf_trccbc(jl)%fnow(ji,jj,1) * zfact442 tr(ji,jj,jk,jn,Krhs) = tr(ji,jj,jk,jn,Krhs) + rf_trcfac(jl) * sf_trccbc(jl)%fnow(ji,jj,1) * zfact 441 443 END DO 442 444 END DO … … 455 457 !!---------------------------------------------------------------------- 456 458 CONTAINS 457 SUBROUTINE trc_bc_ini( ntrc ) ! Empty routine 458 INTEGER,INTENT(IN) :: ntrc ! number of tracers 459 SUBROUTINE trc_bc_ini( ntrc, Kmm ) ! Empty routine 460 INTEGER, INTENT(IN) :: ntrc ! number of tracers 461 INTEGER, INTENT(in) :: Kmm ! time level index 459 462 WRITE(*,*) 'trc_bc_ini: You should not have seen this print! error?', kt 460 463 END SUBROUTINE trc_bc_ini 461 SUBROUTINE trc_bc( kt ) ! Empty routine 464 SUBROUTINE trc_bc( kt, Kmm, Krhs ) ! Empty routine 465 INTEGER, INTENT(in) :: Kmm, Krhs ! time level indices 462 466 WRITE(*,*) 'trc_bc: You should not have seen this print! error?', kt 463 467 END SUBROUTINE trc_bc -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcbdy.F90
r10425 r10963 37 37 CONTAINS 38 38 39 SUBROUTINE trc_bdy( kt )39 SUBROUTINE trc_bdy( kt, Kbb, Kmm, Krhs ) 40 40 !!---------------------------------------------------------------------- 41 41 !! *** SUBROUTINE trc_bdy *** … … 44 44 !! 45 45 !!---------------------------------------------------------------------- 46 INTEGER, INTENT( in ) :: kt ! Main time step counter 46 INTEGER, INTENT( in ) :: kt ! Main time step counter 47 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs ! time level indices 47 48 !! 48 49 INTEGER :: ib_bdy ,jn ,igrd ! Loop indeces … … 63 64 SELECT CASE( TRIM(trcdta_bdy(jn,ib_bdy)%cn_obc) ) 64 65 CASE('none' ) ; CYCLE 65 CASE('frs' ) ; CALL bdy_frs( idx_bdy(ib_bdy), tra(:,:,:,jn), ztrc*zfac )66 CASE('specified' ) ; CALL bdy_spe( idx_bdy(ib_bdy), tra(:,:,:,jn), ztrc*zfac )67 CASE('neumann' ) ; CALL bdy_nmn( idx_bdy(ib_bdy), igrd , tra(:,:,:,jn) )68 CASE('orlanski' ) ; CALL bdy_orl( idx_bdy(ib_bdy), tr b(:,:,:,jn), tra(:,:,:,jn), ztrc*zfac, ll_npo=.false. )69 CASE('orlanski_npo') ; CALL bdy_orl( idx_bdy(ib_bdy), tr b(:,:,:,jn), tra(:,:,:,jn), ztrc*zfac, ll_npo=.true. )66 CASE('frs' ) ; CALL bdy_frs( idx_bdy(ib_bdy), tr(:,:,:,jn,Krhs), ztrc*zfac ) 67 CASE('specified' ) ; CALL bdy_spe( idx_bdy(ib_bdy), tr(:,:,:,jn,Krhs), ztrc*zfac ) 68 CASE('neumann' ) ; CALL bdy_nmn( idx_bdy(ib_bdy), igrd , tr(:,:,:,jn,Krhs) ) 69 CASE('orlanski' ) ; CALL bdy_orl( idx_bdy(ib_bdy), tr(:,:,:,jn,Kbb), tr(:,:,:,jn,Krhs), ztrc*zfac, ll_npo=.false. ) 70 CASE('orlanski_npo') ; CALL bdy_orl( idx_bdy(ib_bdy), tr(:,:,:,jn,Kbb), tr(:,:,:,jn,Krhs), ztrc*zfac, ll_npo=.true. ) 70 71 CASE DEFAULT ; CALL ctl_stop( 'trc_bdy : unrecognised option for open boundaries for passive tracers' ) 71 72 END SELECT 72 73 ! Boundary points should be updated 73 CALL lbc_bdy_lnk( 'trcbdy', tr a(:,:,:,jn), 'T', 1., ib_bdy )74 CALL lbc_bdy_lnk( 'trcbdy', tr(:,:,:,jn,Krhs), 'T', 1., ib_bdy ) 74 75 ! 75 76 END DO … … 81 82 82 83 83 SUBROUTINE trc_bdy_dmp( kt )84 SUBROUTINE trc_bdy_dmp( kt, Kbb, Krhs ) 84 85 !!---------------------------------------------------------------------- 85 86 !! *** SUBROUTINE trc_bdy_dmp *** … … 90 91 !!---------------------------------------------------------------------- 91 92 INTEGER, INTENT(in) :: kt 93 INTEGER, INTENT(in) :: Kbb, Krhs ! time level indices 92 94 !! 93 95 INTEGER :: jn ! Tracer index … … 110 112 zwgt = idx_bdy(ib_bdy)%nbd(ib,igrd) 111 113 DO ik = 1, jpkm1 112 zta = zwgt * ( trcdta_bdy(jn, ib_bdy)%trc(ib,ik) - tr b(ii,ij,ik,jn) ) * tmask(ii,ij,ik)113 tr a(ii,ij,ik,jn) = tra(ii,ij,ik,jn) + zta114 zta = zwgt * ( trcdta_bdy(jn, ib_bdy)%trc(ib,ik) - tr(ii,ij,ik,jn,Kbb) ) * tmask(ii,ij,ik) 115 tr(ii,ij,ik,jn,Krhs) = tr(ii,ij,ik,jn,Krhs) + zta 114 116 END DO 115 117 END DO -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcdta.F90
r10222 r10963 154 154 155 155 156 SUBROUTINE trc_dta( kt, sf_trcdta, ptrcfac, ptrcdta)156 SUBROUTINE trc_dta( kt, Kmm, sf_trcdta, ptrcfac, ptrcdta) 157 157 !!---------------------------------------------------------------------- 158 158 !! *** ROUTINE trc_dta *** … … 167 167 !!---------------------------------------------------------------------- 168 168 INTEGER , INTENT(in ) :: kt ! ocean time-step 169 INTEGER , INTENT(in ) :: Kmm ! time level index 169 170 TYPE(FLD), DIMENSION(1) , INTENT(inout) :: sf_trcdta ! array of information on the field to read 170 171 REAL(wp) , INTENT(in ) :: ptrcfac ! multiplication factor … … 194 195 DO ji = 1, jpi 195 196 DO jk = 1, jpk ! determines the intepolated T-S profiles at each (i,j) points 196 zl = gdept _n(ji,jj,jk)197 zl = gdept(ji,jj,jk,Kmm) 197 198 IF( zl < gdept_1d(1 ) ) THEN ! above the first level of data 198 199 ztp(jk) = ptrcdta(ji,jj,1) -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcini.F90
r10905 r10963 83 83 ENDIF 84 84 ! 85 CALL trc_ini_state ! passive tracers initialisation : from a restart or from clim85 CALL trc_ini_state( Kbb, Kmm, Kaa ) ! passive tracers initialisation : from a restart or from clim 86 86 IF( nn_dttrc /= 1 ) & 87 CALL trc_sub_ini ! Initialize variables for substepping passive tracers88 ! 89 CALL trc_ini_inv ! Inventories87 CALL trc_sub_ini( Kmm ) ! Initialize variables for substepping passive tracers 88 ! 89 CALL trc_ini_inv( Kmm ) ! Inventories 90 90 ! 91 91 IF( ln_timing ) CALL timing_stop('trc_init') … … 110 110 111 111 112 SUBROUTINE trc_ini_inv 112 SUBROUTINE trc_ini_inv( Kmm ) 113 113 !!---------------------------------------------------------------------- 114 114 !! *** ROUTINE trc_ini_stat *** 115 115 !! ** Purpose : passive tracers inventories at initialsation phase 116 116 !!---------------------------------------------------------------------- 117 INTEGER :: jk, jn ! dummy loop indices 117 INTEGER, INTENT(in) :: Kmm ! time level index 118 INTEGER :: jk, jn ! dummy loop indices 118 119 CHARACTER (len=25) :: charout 119 120 !!---------------------------------------------------------------------- … … 125 126 ! ! masked grid volume 126 127 DO jk = 1, jpk 127 cvol(:,:,jk) = e1e2t(:,:) * e3t _n(:,:,jk) * tmask(:,:,jk)128 cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 128 129 END DO 129 130 ! ! total volume of the ocean … … 132 133 trai(:) = 0._wp ! initial content of all tracers 133 134 DO jn = 1, jptra 134 trai(jn) = trai(jn) + glob_sum( 'trcini', tr n(:,:,:,jn) * cvol(:,:,:) )135 trai(jn) = trai(jn) + glob_sum( 'trcini', tr(:,:,:,jn,Kmm) * cvol(:,:,:) ) 135 136 END DO 136 137 … … 151 152 WRITE(charout, FMT="('ini ')") 152 153 CALL prt_ctl_trc_info( charout ) 153 CALL prt_ctl_trc( tab4d=tr n, mask=tmask, clinfo=ctrcnm )154 CALL prt_ctl_trc( tab4d=tr(:,:,:,:,Kmm), mask=tmask, clinfo=ctrcnm ) 154 155 ENDIF 155 156 9000 FORMAT(' tracer nb : ',i2,' name :',a10,' initial content :',e18.10) … … 229 230 230 231 231 SUBROUTINE trc_ini_state 232 SUBROUTINE trc_ini_state( Kbb, Kmm, Kaa ) 232 233 !!---------------------------------------------------------------------- 233 234 !! *** ROUTINE trc_ini_state *** … … 238 239 USE trcdta ! initialisation from files 239 240 ! 240 INTEGER :: jn, jl ! dummy loop indices 241 !!---------------------------------------------------------------------- 242 ! 243 IF( ln_trcdta ) CALL trc_dta_ini( jptra ) ! set initial tracers values 244 ! 245 IF( ln_my_trc ) CALL trc_bc_ini ( jptra ) ! set tracers Boundary Conditions 241 INTEGER, INTENT(in) :: Kbb, Kmm, Kaa ! time level index 242 INTEGER :: jn, jl ! dummy loop indices 243 !!---------------------------------------------------------------------- 244 ! 245 IF( ln_trcdta ) CALL trc_dta_ini( jptra ) ! set initial tracers values 246 ! 247 IF( ln_my_trc ) CALL trc_bc_ini ( jptra, Kmm ) ! set tracers Boundary Conditions 246 248 ! 247 249 ! 248 250 IF( ln_rsttr ) THEN ! restart from a file 249 251 ! 250 CALL trc_rst_read 252 CALL trc_rst_read( Kbb, Kmm ) 251 253 ! 252 254 ELSE ! Initialisation of tracer from a file that may also be used for damping … … 257 259 IF( ln_trc_ini(jn) ) THEN 258 260 jl = n_trc_index(jn) 259 CALL trc_dta( nit000, sf_trcdta(jl), rf_trfac(jl), trn(:,:,:,jn) )261 CALL trc_dta( nit000, Kmm, sf_trcdta(jl), rf_trfac(jl), tr(:,:,:,jn,Kmm) ) 260 262 ! 261 263 ! deallocate data structure if data are not used for damping … … 271 273 ENDIF 272 274 ! 273 tr b(:,:,:,:) = trn(:,:,:,:)275 tr(:,:,:,:,Kbb) = tr(:,:,:,:,Kmm) 274 276 ! 275 277 ENDIF 276 278 ! 277 tr a(:,:,:,:) = 0._wp278 ! ! Partial top/bottom cell: GRADh(tr n)279 tr(:,:,:,:,Kaa) = 0._wp 280 ! ! Partial top/bottom cell: GRADh(tr(Kmm)) 279 281 END SUBROUTINE trc_ini_state 280 282 -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcrst.F90
r10425 r10963 94 94 END SUBROUTINE trc_rst_opn 95 95 96 SUBROUTINE trc_rst_read 96 SUBROUTINE trc_rst_read( Kbb, Kmm ) 97 97 !!---------------------------------------------------------------------- 98 98 !! *** trc_rst_opn *** … … 100 100 !! ** purpose : read passive tracer fields in restart files 101 101 !!---------------------------------------------------------------------- 102 INTEGER, INTENT( in ) :: Kbb, Kmm ! time level indices 102 103 INTEGER :: jn 103 104 … … 110 111 ! READ prognostic variables and computes diagnostic variable 111 112 DO jn = 1, jptra 112 CALL iom_get( numrtr, jpdom_autoglo, 'TRN'//ctrcnm(jn), tr n(:,:,:,jn) )113 END DO 114 115 DO jn = 1, jptra 116 CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), tr b(:,:,:,jn) )113 CALL iom_get( numrtr, jpdom_autoglo, 'TRN'//ctrcnm(jn), tr(:,:,:,jn,Kmm) ) 114 END DO 115 116 DO jn = 1, jptra 117 CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb) ) 117 118 END DO 118 119 ! … … 121 122 END SUBROUTINE trc_rst_read 122 123 123 SUBROUTINE trc_rst_wri( kt )124 SUBROUTINE trc_rst_wri( kt, Kbb, Kmm, Krhs ) 124 125 !!---------------------------------------------------------------------- 125 126 !! *** trc_rst_wri *** … … 127 128 !! ** purpose : write passive tracer fields in restart files 128 129 !!---------------------------------------------------------------------- 129 INTEGER, INTENT( in ) :: kt ! ocean time-step index 130 INTEGER, INTENT( in ) :: kt ! ocean time-step index 131 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs ! time level indices 130 132 !! 131 133 INTEGER :: jn … … 136 138 ! -------------------- 137 139 DO jn = 1, jptra 138 CALL iom_rstput( kt, nitrst, numrtw, 'TRN'//ctrcnm(jn), tr n(:,:,:,jn) )139 END DO 140 141 DO jn = 1, jptra 142 CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), tr b(:,:,:,jn) )140 CALL iom_rstput( kt, nitrst, numrtw, 'TRN'//ctrcnm(jn), tr(:,:,:,jn,Kmm) ) 141 END DO 142 143 DO jn = 1, jptra 144 CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb) ) 143 145 END DO 144 146 ! … … 146 148 147 149 IF( kt == nitrst ) THEN 148 CALL trc_rst_stat ! statistics150 CALL trc_rst_stat( Kmm, Krhs ) ! statistics 149 151 CALL iom_close( numrtw ) ! close the restart file (only at last time step) 150 152 #if ! defined key_trdmxl_trc … … 297 299 298 300 299 SUBROUTINE trc_rst_stat 301 SUBROUTINE trc_rst_stat( Kmm, Krhs ) 300 302 !!---------------------------------------------------------------------- 301 303 !! *** trc_rst_stat *** … … 303 305 !! ** purpose : Compute tracers statistics 304 306 !!---------------------------------------------------------------------- 307 INTEGER, INTENT( in ) :: Kmm, Krhs ! time level indices 305 308 INTEGER :: jk, jn 306 309 REAL(wp) :: ztraf, zmin, zmax, zmean, zdrift … … 315 318 ! 316 319 DO jk = 1, jpk 317 zvol(:,:,jk) = e1e2t(:,:) * e3t _a(:,:,jk) * tmask(:,:,jk)318 END DO 319 ! 320 DO jn = 1, jptra 321 ztraf = glob_sum( 'trcrst', tr n(:,:,:,jn) * zvol(:,:,:) )322 zmin = MINVAL( tr n(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) )323 zmax = MAXVAL( tr n(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) )320 zvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Krhs) * tmask(:,:,jk) 321 END DO 322 ! 323 DO jn = 1, jptra 324 ztraf = glob_sum( 'trcrst', tr(:,:,:,jn,Kmm) * zvol(:,:,:) ) 325 zmin = MINVAL( tr(:,:,:,jn,Kmm), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 326 zmax = MAXVAL( tr(:,:,:,jn,Kmm), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 324 327 IF( lk_mpp ) THEN 325 328 CALL mpp_min( 'trcrst', zmin ) ! min over the global domain … … 341 344 !!---------------------------------------------------------------------- 342 345 CONTAINS 343 SUBROUTINE trc_rst_read ! Empty routines 346 SUBROUTINE trc_rst_read( Kbb, Kmm) ! Empty routines 347 INTEGER, INTENT( in ) :: Kbb, Kmm ! time level indices 344 348 END SUBROUTINE trc_rst_read 345 SUBROUTINE trc_rst_wri( kt ) 346 INTEGER, INTENT ( in ) :: kt 349 SUBROUTINE trc_rst_wri( kt, Kbb, Kmm, Krhs ) 350 INTEGER, INTENT( in ) :: kt 351 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs ! time level indices 347 352 WRITE(*,*) 'trc_rst_wri: You should not have seen this print! error?', kt 348 353 END SUBROUTINE trc_rst_wri -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcsms.F90
r10068 r10963 34 34 CONTAINS 35 35 36 SUBROUTINE trc_sms( kt )36 SUBROUTINE trc_sms( kt, Kmm , Krhs ) 37 37 !!--------------------------------------------------------------------- 38 38 !! *** ROUTINE trc_sms *** … … 42 42 !! ** Method : - call the main routine of of each defined tracer model 43 43 !! ------------------------------------------------------------------------------------- 44 INTEGER, INTENT( in ) :: kt ! ocean time-step index 44 INTEGER, INTENT( in ) :: kt ! ocean time-step index 45 INTEGER, INTENT( in ) :: Kmm, Krhs ! time level indices 45 46 !! 46 47 CHARACTER (len=25) :: charout … … 49 50 IF( ln_timing ) CALL timing_start('trc_sms') 50 51 ! 51 IF( ln_pisces ) CALL trc_sms_pisces ( kt ) ! main program of PISCES52 IF( ln_pisces ) CALL trc_sms_pisces ( kt, Kmm ) ! main program of PISCES 52 53 IF( ll_cfc ) CALL trc_sms_cfc ( kt ) ! surface fluxes of CFC 53 54 IF( ln_c14 ) CALL trc_sms_c14 ( kt ) ! surface fluxes of C14 54 55 IF( ln_age ) CALL trc_sms_age ( kt ) ! Age tracer 55 IF( ln_my_trc ) CALL trc_sms_my_trc ( kt ) ! MY_TRC tracers56 IF( ln_my_trc ) CALL trc_sms_my_trc ( kt, Kmm, Krhs ) ! MY_TRC tracers 56 57 57 58 IF(ln_ctl) THEN ! print mean trends (used for debugging) 58 59 WRITE(charout, FMT="('sms ')") 59 60 CALL prt_ctl_trc_info( charout ) 60 CALL prt_ctl_trc( tab4d=tr n, mask=tmask, clinfo=ctrcnm )61 CALL prt_ctl_trc( tab4d=tr(:,:,:,:,Kmm), mask=tmask, clinfo=ctrcnm ) 61 62 ENDIF 62 63 ! -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcstp.F90
r10922 r10963 77 77 IF( .NOT.ln_linssh ) THEN ! update ocean volume due to ssh temporal evolution 78 78 DO jk = 1, jpk 79 cvol(:,:,jk) = e1e2t(:,:) * e3t _n(:,:,jk) * tmask(:,:,jk)79 cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 80 80 END DO 81 81 IF ( ln_ctl .OR. kt == nitrst .OR. ( ln_check_mass .AND. kt == nitend ) & … … 87 87 IF( l_trcdm2dc ) CALL trc_mean_qsr( kt ) 88 88 ! 89 IF( nn_dttrc /= 1 ) CALL trc_sub_stp( kt, K mm) ! averaging physical variables for sub-stepping89 IF( nn_dttrc /= 1 ) CALL trc_sub_stp( kt, Kbb, Kmm, Krhs ) ! averaging physical variables for sub-stepping 90 90 ! 91 91 IF( MOD( kt , nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step … … 96 96 ENDIF 97 97 ! 98 tr a(:,:,:,:) = 0.e098 tr(:,:,:,:,Krhs) = 0.e0 99 99 ! 100 100 CALL trc_rst_opn ( kt ) ! Open tracer restart file 101 101 IF( lrst_trc ) CALL trc_rst_cal ( kt, 'WRITE' ) ! calendar 102 CALL trc_wri ( kt ) ! output of passive tracers with iom I/O manager103 CALL trc_sms ( kt ) ! tracers: sinks and sources104 CALL trc_trp ( kt, Kbb, Kmm, Krhs, Kaa ) 102 CALL trc_wri ( kt ) ! output of passive tracers with iom I/O manager 103 CALL trc_sms ( kt, Kmm, Krhs ) ! tracers: sinks and sources 104 CALL trc_trp ( kt, Kbb, Kmm, Krhs, Kaa ) ! transport of passive tracers 105 105 IF( kt == nittrc000 ) THEN 106 106 CALL iom_close( numrtr ) ! close input tracer restart file 107 107 IF(lwm) CALL FLUSH( numont ) ! flush namelist output 108 108 ENDIF 109 IF( lrst_trc ) CALL trc_rst_wri ( kt ) ! write tracer restart file110 IF( lk_trdmxl_trc ) CALL trd_mxl_trc ( kt ) ! trends: Mixed-layer111 ! 112 IF( nn_dttrc /= 1 ) CALL trc_sub_reset( kt ) ! resetting physical variables when sub-stepping109 IF( lrst_trc ) CALL trc_rst_wri ( kt, Kbb, Kmm, Krhs ) ! write tracer restart file 110 IF( lk_trdmxl_trc ) CALL trd_mxl_trc ( kt ) ! trends: Mixed-layer 111 ! 112 IF( nn_dttrc /= 1 ) CALL trc_sub_reset( kt, Kbb, Kmm, Krhs ) ! resetting physical variables when sub-stepping 113 113 ! 114 114 ENDIF … … 117 117 ztrai = 0._wp ! content of all tracers 118 118 DO jn = 1, jptra 119 ztrai = ztrai + glob_sum( 'trcstp', tr n(:,:,:,jn) * cvol(:,:,:) )119 ztrai = ztrai + glob_sum( 'trcstp', tr(:,:,:,jn,Kmm) * cvol(:,:,:) ) 120 120 END DO 121 121 IF( lwm ) WRITE(numstr,9300) kt, ztrai / areatot -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcsub.F90
r10922 r10963 43 43 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_tm , un_temp !: i-horizontal velocity average [m/s] 44 44 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vn_tm , vn_temp !: j-horizontal velocity average [m/s] 45 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wn_temp !: hold current values of avt, u n, vn, wn45 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wn_temp !: hold current values of avt, uu(Kmm), vv(Kmm), ww 46 46 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_tm , tsn_temp !: t/s average [m/s] 47 47 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_tm , avs_temp !: vertical diffusivity coeff. at w-point [m2/s] … … 59 59 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: wndm_tm , wndm_temp !: 10m wind average [m] 60 60 ! 61 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb_hold !: hold sshbfrom the beginning of each sub-stepping[m]61 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb_hold !: hold ssh(Kbb) from the beginning of each sub-stepping[m] 62 62 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb_temp, ssha_temp 63 63 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn_temp, rotn_temp … … 82 82 CONTAINS 83 83 84 SUBROUTINE trc_sub_stp( kt, K mm)84 SUBROUTINE trc_sub_stp( kt, Kbb, Kmm, Krhs ) 85 85 !!------------------------------------------------------------------- 86 86 !! *** ROUTINE trc_stp *** … … 91 91 !! on TOP steps, calculate averages. 92 92 !!------------------------------------------------------------------- 93 INTEGER, INTENT( in ) :: kt ! ocean time-step index94 INTEGER, INTENT( in ) :: K mm! ocean time-level index93 INTEGER, INTENT( in ) :: kt ! ocean time-step index 94 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs ! ocean time-level index 95 95 ! 96 96 INTEGER :: ji, jj, jk ! dummy loop indices … … 105 105 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 106 106 ! 107 sshb_hold (:,:) = ssh n (:,:)107 sshb_hold (:,:) = ssh (:,:,Kmm) 108 108 emp_b_hold (:,:) = emp_b (:,:) 109 109 ! … … 114 114 IF( MOD( kt , nn_dttrc ) /= 0 ) THEN 115 115 ! 116 un_tm (:,:,:) = un_tm (:,:,:) + u n (:,:,:) * e3u_n(:,:,:)117 vn_tm (:,:,:) = vn_tm (:,:,:) + v n (:,:,:) * e3v_n(:,:,:)118 tsn_tm (:,:,:,jp_tem) = tsn_tm (:,:,:,jp_tem) + ts n (:,:,:,jp_tem) * e3t_n(:,:,:)119 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + ts n (:,:,:,jp_sal) * e3t_n(:,:,:)120 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t_n(:,:,:)121 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w_n(:,:,:)116 un_tm (:,:,:) = un_tm (:,:,:) + uu (:,:,:,Kmm) * e3u(:,:,:,Kmm) 117 vn_tm (:,:,:) = vn_tm (:,:,:) + vv (:,:,:,Kmm) * e3v(:,:,:,Kmm) 118 tsn_tm (:,:,:,jp_tem) = tsn_tm (:,:,:,jp_tem) + ts (:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm) 119 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + ts (:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm) 120 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t(:,:,:,Kmm) 121 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w(:,:,:,Kmm) 122 122 IF( l_ldfslp ) THEN 123 123 uslp_tm (:,:,:) = uslp_tm (:,:,:) + uslp (:,:,:) … … 137 137 ENDIF 138 138 ! 139 sshn_tm (:,:) = sshn_tm (:,:) + ssh n (:,:)139 sshn_tm (:,:) = sshn_tm (:,:) + ssh (:,:,Kmm) 140 140 rnf_tm (:,:) = rnf_tm (:,:) + rnf (:,:) 141 141 h_rnf_tm (:,:) = h_rnf_tm (:,:) + h_rnf (:,:) … … 149 149 ELSE ! It is time to substep 150 150 ! 1. set temporary arrays to hold physics/dynamical variables 151 un_temp (:,:,:) = u n (:,:,:)152 vn_temp (:,:,:) = v n (:,:,:)153 wn_temp (:,:,:) = w n(:,:,:)154 tsn_temp (:,:,:,:) = ts n (:,:,:,:)151 un_temp (:,:,:) = uu (:,:,:,Kmm) 152 vn_temp (:,:,:) = vv (:,:,:,Kmm) 153 wn_temp (:,:,:) = ww (:,:,:) 154 tsn_temp (:,:,:,:) = ts (:,:,:,:,Kmm) 155 155 rhop_temp (:,:,:) = rhop (:,:,:) 156 156 avs_temp (:,:,:) = avs (:,:,:) … … 169 169 ENDIF 170 170 ENDIF 171 sshn_temp (:,:) = ssh n (:,:)172 sshb_temp (:,:) = ssh b (:,:)173 ssha_temp (:,:) = ssh a (:,:)171 sshn_temp (:,:) = ssh (:,:,Kmm) 172 sshb_temp (:,:) = ssh (:,:,Kbb) 173 ssha_temp (:,:) = ssh (:,:,Krhs) 174 174 rnf_temp (:,:) = rnf (:,:) 175 175 h_rnf_temp (:,:) = h_rnf (:,:) … … 182 182 wndm_temp (:,:) = wndm (:,:) 183 183 ! ! Variables reset in trc_sub_ssh 184 hdivn_temp (:,:,:) = hdiv n(:,:,:)184 hdivn_temp (:,:,:) = hdiv (:,:,:) 185 185 ! 186 186 ! 2. Create averages and reassign variables 187 un_tm (:,:,:) = un_tm (:,:,:) + u n (:,:,:) * e3u_n(:,:,:)188 vn_tm (:,:,:) = vn_tm (:,:,:) + v n (:,:,:) * e3v_n(:,:,:)189 tsn_tm (:,:,:,jp_tem) = tsn_tm (:,:,:,jp_tem) + ts n (:,:,:,jp_tem) * e3t_n(:,:,:)190 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + ts n (:,:,:,jp_sal) * e3t_n(:,:,:)191 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t_n(:,:,:)192 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w_n(:,:,:)187 un_tm (:,:,:) = un_tm (:,:,:) + uu (:,:,:,Kmm) * e3u(:,:,:,Kmm) 188 vn_tm (:,:,:) = vn_tm (:,:,:) + vv (:,:,:,Kmm) * e3v(:,:,:,Kmm) 189 tsn_tm (:,:,:,jp_tem) = tsn_tm (:,:,:,jp_tem) + ts (:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm) 190 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + ts (:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm) 191 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t(:,:,:,Kmm) 192 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w(:,:,:,Kmm) 193 193 IF( l_ldfslp ) THEN 194 194 uslp_tm (:,:,:) = uslp_tm (:,:,:) + uslp (:,:,:) … … 207 207 ENDIF 208 208 ENDIF 209 sshn_tm (:,:) = sshn_tm (:,:) + ssh n (:,:)209 sshn_tm (:,:) = sshn_tm (:,:) + ssh (:,:,Kmm) 210 210 rnf_tm (:,:) = rnf_tm (:,:) + rnf (:,:) 211 211 h_rnf_tm (:,:) = h_rnf_tm (:,:) + h_rnf (:,:) … … 217 217 wndm_tm (:,:) = wndm_tm (:,:) + wndm (:,:) 218 218 ! 219 ssh n (:,:)= sshn_tm (:,:) * r1_ndttrcp1220 ssh b (:,:)= sshb_hold (:,:)219 ssh (:,:,Kmm) = sshn_tm (:,:) * r1_ndttrcp1 220 ssh (:,:,Kbb) = sshb_hold (:,:) 221 221 rnf (:,:) = rnf_tm (:,:) * r1_ndttrcp1 222 222 h_rnf (:,:) = h_rnf_tm (:,:) * r1_ndttrcp1 223 223 hmld (:,:) = hmld_tm (:,:) * r1_ndttrcp1 224 224 ! variables that are initialized after averages 225 emp_b (:,:) = emp_b_hold (:,:)225 emp_b (:,:) = emp_b_hold (:,:) 226 226 IF( kt == nittrc000 ) THEN 227 227 wndm (:,:) = wndm_tm (:,:) * r1_ndttrc … … 261 261 DO jj = 1, jpj 262 262 DO ji = 1, jpi 263 z1_ne3t = r1_ndttrcp1 / e3t _n(ji,jj,jk)264 z1_ne3u = r1_ndttrcp1 / e3u _n(ji,jj,jk)265 z1_ne3v = r1_ndttrcp1 / e3v _n(ji,jj,jk)266 z1_ne3w = r1_ndttrcp1 / e3w _n(ji,jj,jk)263 z1_ne3t = r1_ndttrcp1 / e3t(ji,jj,jk,Kmm) 264 z1_ne3u = r1_ndttrcp1 / e3u(ji,jj,jk,Kmm) 265 z1_ne3v = r1_ndttrcp1 / e3v(ji,jj,jk,Kmm) 266 z1_ne3w = r1_ndttrcp1 / e3w(ji,jj,jk,Kmm) 267 267 ! 268 u n (ji,jj,jk) = un_tm (ji,jj,jk) * z1_ne3u269 v n (ji,jj,jk) = vn_tm (ji,jj,jk) * z1_ne3v270 ts n (ji,jj,jk,jp_tem) = tsn_tm (ji,jj,jk,jp_tem) * z1_ne3t271 ts n (ji,jj,jk,jp_sal) = tsn_tm (ji,jj,jk,jp_sal) * z1_ne3t272 rhop (ji,jj,jk) = rhop_tm (ji,jj,jk) * z1_ne3t268 uu (ji,jj,jk,Kmm) = un_tm (ji,jj,jk) * z1_ne3u 269 vv (ji,jj,jk,Kmm) = vn_tm (ji,jj,jk) * z1_ne3v 270 ts (ji,jj,jk,jp_tem,Kmm) = tsn_tm (ji,jj,jk,jp_tem) * z1_ne3t 271 ts (ji,jj,jk,jp_sal,Kmm) = tsn_tm (ji,jj,jk,jp_sal) * z1_ne3t 272 rhop (ji,jj,jk) = rhop_tm (ji,jj,jk) * z1_ne3t 273 273 !!gm : BUG ==>> for avs I don't understand the division by e3w 274 avs (ji,jj,jk) = avs_tm (ji,jj,jk) * z1_ne3w274 avs (ji,jj,jk) = avs_tm (ji,jj,jk) * z1_ne3w 275 275 END DO 276 276 END DO … … 283 283 ENDIF 284 284 ! 285 CALL trc_sub_ssh( kt, K mm) ! after ssh & vertical velocity285 CALL trc_sub_ssh( kt, Kbb, Kmm, Krhs ) ! after ssh & vertical velocity 286 286 ! 287 287 ENDIF … … 292 292 293 293 294 SUBROUTINE trc_sub_ini 294 SUBROUTINE trc_sub_ini( Kmm ) 295 295 !!------------------------------------------------------------------- 296 296 !! *** ROUTINE trc_sub_ini *** … … 302 302 !!------------------------------------------------------------------- 303 303 INTEGER :: ierr 304 INTEGER, INTENT( in ) :: Kmm ! time level index 304 305 !!------------------------------------------------------------------- 305 306 ! … … 312 313 IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'top_sub_alloc : unable to allocate standard ocean arrays' ) 313 314 314 un_tm (:,:,:) = u n (:,:,:) * e3u_n(:,:,:)315 vn_tm (:,:,:) = v n (:,:,:) * e3v_n(:,:,:)316 tsn_tm (:,:,:,jp_tem) = ts n (:,:,:,jp_tem) * e3t_n(:,:,:)317 tsn_tm (:,:,:,jp_sal) = ts n (:,:,:,jp_sal) * e3t_n(:,:,:)318 rhop_tm (:,:,:) = rhop (:,:,:) * e3t_n(:,:,:)315 un_tm (:,:,:) = uu (:,:,:,Kmm) * e3u(:,:,:,Kmm) 316 vn_tm (:,:,:) = vv (:,:,:,Kmm) * e3v(:,:,:,Kmm) 317 tsn_tm (:,:,:,jp_tem) = ts (:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm) 318 tsn_tm (:,:,:,jp_sal) = ts (:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm) 319 rhop_tm (:,:,:) = rhop (:,:,:) * e3t(:,:,:,Kmm) 319 320 !!gm : BUG? ==>> for avt & avs I don't understand the division by e3w 320 avs_tm (:,:,:) = avs (:,:,:) * e3w_n(:,:,:)321 avs_tm (:,:,:) = avs (:,:,:) * e3w(:,:,:,Kmm) 321 322 IF( l_ldfslp ) THEN 322 323 wslpi_tm(:,:,:) = wslpi(:,:,:) … … 325 326 vslp_tm (:,:,:) = vslp (:,:,:) 326 327 ENDIF 327 sshn_tm (:,:) = ssh n (:,:)328 sshn_tm (:,:) = ssh (:,:,Kmm) 328 329 rnf_tm (:,:) = rnf (:,:) 329 330 h_rnf_tm (:,:) = h_rnf (:,:) … … 333 334 fr_i_tm (:,:) = 0._wp 334 335 emp_tm (:,:) = 0._wp 335 fmmflx_tm(:,:) 336 fmmflx_tm(:,:) = 0._wp 336 337 qsr_tm (:,:) = 0._wp 337 338 wndm_tm (:,:) = 0._wp … … 350 351 351 352 352 SUBROUTINE trc_sub_reset( kt )353 SUBROUTINE trc_sub_reset( kt, Kbb, Kmm, Krhs ) 353 354 !!------------------------------------------------------------------- 354 355 !! *** ROUTINE trc_sub_reset *** … … 359 360 !! Compute the averages for sub-stepping 360 361 !!------------------------------------------------------------------- 361 INTEGER, INTENT( in ) :: kt ! ocean time-step index 362 INTEGER :: jk ! dummy loop indices 362 INTEGER, INTENT( in ) :: kt ! ocean time-step index 363 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs ! time level index 364 INTEGER :: jk ! dummy loop indices 363 365 !!------------------------------------------------------------------- 364 366 ! … … 366 368 ! 367 369 ! restore physics variables 368 u n (:,:,:) = un_temp(:,:,:)369 v n (:,:,:) = vn_temp(:,:,:)370 w n (:,:,:) = wn_temp(:,:,:)371 ts n (:,:,:,:) = tsn_temp(:,:,:,:)372 rhop (:,:,:) = rhop_temp(:,:,:)373 avs (:,:,:) = avs_temp(:,:,:)370 uu (:,:,:,Kmm) = un_temp (:,:,:) 371 vv (:,:,:,Kmm) = vn_temp (:,:,:) 372 ww (:,:,:) = wn_temp (:,:,:) 373 ts (:,:,:,:,Kmm) = tsn_temp (:,:,:,:) 374 rhop (:,:,:) = rhop_temp(:,:,:) 375 avs (:,:,:) = avs_temp (:,:,:) 374 376 IF( l_ldfslp ) THEN 375 wslpi (:,:,:) = wslpi_temp (:,:,:)376 wslpj (:,:,:) = wslpj_temp (:,:,:)377 uslp (:,:,:) = uslp_temp (:,:,:)378 vslp (:,:,:) = vslp_temp (:,:,:)379 ENDIF 380 ssh n (:,:) = sshn_temp (:,:)381 ssh b (:,:) = sshb_temp (:,:)382 ssh a (:,:)= ssha_temp (:,:)383 rnf (:,:) = rnf_temp (:,:)384 h_rnf (:,:) = h_rnf_temp (:,:)377 wslpi (:,:,:) = wslpi_temp (:,:,:) 378 wslpj (:,:,:) = wslpj_temp (:,:,:) 379 uslp (:,:,:) = uslp_temp (:,:,:) 380 vslp (:,:,:) = vslp_temp (:,:,:) 381 ENDIF 382 ssh (:,:,Kmm) = sshn_temp (:,:) 383 ssh (:,:,Kbb) = sshb_temp (:,:) 384 ssh (:,:,Krhs) = ssha_temp (:,:) 385 rnf (:,:) = rnf_temp (:,:) 386 h_rnf (:,:) = h_rnf_temp (:,:) 385 387 ! 386 388 hmld (:,:) = hmld_temp (:,:) … … 402 404 ENDIF 403 405 ! 404 hdiv n(:,:,:) = hdivn_temp (:,:,:)406 hdiv (:,:,:) = hdivn_temp (:,:,:) 405 407 ! 406 408 ! Start new averages 407 un_tm (:,:,:) = u n (:,:,:) * e3u_n(:,:,:)408 vn_tm (:,:,:) = v n (:,:,:) * e3v_n(:,:,:)409 tsn_tm (:,:,:,jp_tem) = ts n (:,:,:,jp_tem) * e3t_n(:,:,:)410 tsn_tm (:,:,:,jp_sal) = ts n (:,:,:,jp_sal) * e3t_n(:,:,:)411 rhop_tm (:,:,:) = rhop (:,:,:) * e3t_n(:,:,:)412 avs_tm (:,:,:) = avs (:,:,:) * e3w_n(:,:,:)409 un_tm (:,:,:) = uu (:,:,:,Kmm) * e3u(:,:,:,Kmm) 410 vn_tm (:,:,:) = vv (:,:,:,Kmm) * e3v(:,:,:,Kmm) 411 tsn_tm (:,:,:,jp_tem) = ts (:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm) 412 tsn_tm (:,:,:,jp_sal) = ts (:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm) 413 rhop_tm (:,:,:) = rhop (:,:,:) * e3t(:,:,:,Kmm) 414 avs_tm (:,:,:) = avs (:,:,:) * e3w(:,:,:,Kmm) 413 415 IF( l_ldfslp ) THEN 414 416 uslp_tm (:,:,:) = uslp (:,:,:) … … 418 420 ENDIF 419 421 ! 420 sshb_hold (:,:) = ssh n (:,:)422 sshb_hold (:,:) = ssh (:,:,Kmm ) 421 423 emp_b_hold (:,:) = emp (:,:) 422 sshn_tm (:,:) = ssh n (:,:)424 sshn_tm (:,:) = ssh (:,:,Kmm) 423 425 rnf_tm (:,:) = rnf (:,:) 424 426 h_rnf_tm (:,:) = h_rnf (:,:) … … 446 448 447 449 448 SUBROUTINE trc_sub_ssh( kt, K mm)450 SUBROUTINE trc_sub_ssh( kt, Kbb, Kmm, Krhs ) 449 451 !!---------------------------------------------------------------------- 450 452 !! *** ROUTINE trc_sub_ssh *** 451 453 !! 452 !! ** Purpose : compute the after ssh (ssh a), the now vertical velocity454 !! ** Purpose : compute the after ssh (ssh(:,:,Krhs)), the now vertical velocity 453 455 !! and update the now vertical coordinate (ln_linssh=F). 454 456 !! … … 458 460 !! The boundary conditions are w=0 at the bottom (no flux) and. 459 461 !! 460 !! ** action : ssh a: after sea surface height461 !! w n: now vertical velocity462 !! ** action : ssh(:,:,Krhs) : after sea surface height 463 !! ww : now vertical velocity 462 464 !! sshu_a, sshv_a, sshf_a : after sea surface height (ln_linssh=F) 463 465 !! 464 466 !! Reference : Leclair, M., and G. Madec, 2009, Ocean Modelling. 465 467 !!---------------------------------------------------------------------- 466 INTEGER, INTENT(in) :: kt ! time step467 INTEGER, INTENT(in) :: K mm! ocean time-level index468 INTEGER, INTENT(in) :: kt ! time step 469 INTEGER, INTENT(in) :: Kbb, Kmm, Krhs ! ocean time-level index 468 470 ! 469 471 INTEGER :: ji, jj, jk ! dummy loop indices … … 481 483 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ ' 482 484 ! 483 w n(:,:,jpk) = 0._wp ! bottom boundary condition: w=0 (set once for all)484 ! 485 ENDIF 486 ! 487 !!gm BUG here ! hdiv nwill include the runoff divergence at the wrong timestep !!!!485 ww(:,:,jpk) = 0._wp ! bottom boundary condition: w=0 (set once for all) 486 ! 487 ENDIF 488 ! 489 !!gm BUG here ! hdiv will include the runoff divergence at the wrong timestep !!!! 488 490 CALL div_hor( kt, Kmm ) ! Horizontal divergence & Relative vorticity 489 491 ! … … 496 498 zhdiv(:,:) = 0._wp 497 499 DO jk = 1, jpkm1 ! Horizontal divergence of barotropic transports 498 zhdiv(:,:) = zhdiv(:,:) + e3t _n(:,:,jk) * hdivn(:,:,jk)500 zhdiv(:,:) = zhdiv(:,:) + e3t(:,:,jk,Kmm) * hdiv(:,:,jk) 499 501 END DO 500 502 ! ! Sea surface elevation time stepping … … 502 504 ! because emp_b field is initialized with the vlaues of emp field. Hence, 0.5 * ( emp + emp_b ) = emp 503 505 z1_rau0 = 0.5 / rau0 504 ssh a(:,:) = ( sshb(:,:) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) ) ) * tmask(:,:,1)506 ssh(:,:,Krhs) = ( ssh(:,:,Kbb) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) ) ) * tmask(:,:,1) 505 507 506 508 IF( .NOT.ln_dynspg_ts ) THEN … … 511 513 #endif 512 514 IF( ln_bdy ) THEN 513 ssh a(:,:) = ssha(:,:) * bdytmask(:,:)514 CALL lbc_lnk( 'trcsub', ssh a, 'T', 1. )515 ssh(:,:,Krhs) = ssh(:,:,Krhs) * bdytmask(:,:) 516 CALL lbc_lnk( 'trcsub', ssh(:,:,Krhs), 'T', 1. ) 515 517 ENDIF 516 518 ENDIF … … 522 524 DO jk = jpkm1, 1, -1 ! integrate from the bottom the hor. divergence 523 525 ! - ML - need 3 lines here because replacement of e3t by its expression yields too long lines otherwise 524 w n(:,:,jk) = wn(:,:,jk+1) - e3t_n(:,:,jk) * hdivn(:,:,jk)&525 & - ( e3t _a(:,:,jk) - e3t_b(:,:,jk) ) &526 ww(:,:,jk) = ww(:,:,jk+1) - e3t(:,:,jk,Kmm ) * hdiv(:,:,jk) & 527 & - ( e3t(:,:,jk,Krhs) - e3t (:,:,jk,Kbb) ) & 526 528 & * tmask(:,:,jk) * z1_2dt 527 IF( ln_bdy ) w n(:,:,jk) = wn(:,:,jk) * bdytmask(:,:)529 IF( ln_bdy ) ww(:,:,jk) = ww(:,:,jk) * bdytmask(:,:) 528 530 END DO 529 531 ! … … 588 590 !!---------------------------------------------------------------------- 589 591 CONTAINS 590 SUBROUTINE trc_sub_stp( kt ) ! Empty routine 592 SUBROUTINE trc_sub_stp( kt, Kbb, Kmm, Krhs ) ! Empty routine 593 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs ! time level indices 591 594 WRITE(*,*) 'trc_sub_stp: You should not have seen this print! error?', kt 592 595 END SUBROUTINE trc_sub_stp 593 SUBROUTINE trc_sub_ini ! Empty routine 596 SUBROUTINE trc_sub_ini( Kmm ) ! Empty routine 597 INTEGER, INTENT( in ) :: Kmm ! time level index 594 598 WRITE(*,*) 'trc_sub_ini: You should not have seen this print! error?', kt 595 599 END SUBROUTINE trc_sub_ini
Note: See TracChangeset
for help on using the changeset viewer.