Changeset 12377 for NEMO/trunk/src/TOP/trcbc.F90
- Timestamp:
- 2020-02-12T15:39:06+01:00 (4 years ago)
- Location:
- NEMO/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk
- Property svn:externals
-
old new 3 3 ^/utils/build/mk@HEAD mk 4 4 ^/utils/tools@HEAD tools 5 ^/vendors/AGRIF/dev @HEAD ext/AGRIF5 ^/vendors/AGRIF/dev_r11615_ENHANCE-04_namelists_as_internalfiles_agrif@HEAD ext/AGRIF 6 6 ^/vendors/FCM@HEAD ext/FCM 7 7 ^/vendors/IOIPSL@HEAD ext/IOIPSL
-
- Property svn:externals
-
NEMO/trunk/src/TOP/trcbc.F90
r11536 r12377 7 7 !! 3.6 ! 2015 (T . Lovato) Revision and BDY support 8 8 !! 4.0 ! 2016 (T . Lovato) Include application of sbc and cbc 9 !!----------------------------------------------------------------------10 #if defined key_top11 !!----------------------------------------------------------------------12 !! 'key_top' TOP model13 9 !!---------------------------------------------------------------------- 14 10 !! trc_bc : Apply tracer Boundary Conditions … … 45 41 #endif 46 42 43 #if defined key_top 44 !!---------------------------------------------------------------------- 45 !! 'key_top' TOP model 46 !!---------------------------------------------------------------------- 47 47 48 !! * Substitutions 48 # include " vectopt_loop_substitute.h90"49 # include "do_loop_substitute.h90" 49 50 !!---------------------------------------------------------------------- 50 51 !! NEMO/TOP 4.0 , NEMO Consortium (2018) … … 54 55 CONTAINS 55 56 56 SUBROUTINE trc_bc_ini( ntrc )57 SUBROUTINE trc_bc_ini( ntrc, Kmm ) 57 58 !!---------------------------------------------------------------------- 58 59 !! *** ROUTINE trc_bc_ini *** … … 63 64 !! - allocates passive tracer BC data structure 64 65 !!---------------------------------------------------------------------- 65 INTEGER,INTENT(in) :: ntrc ! number of tracers 66 INTEGER, INTENT(in) :: ntrc ! number of tracers 67 INTEGER, INTENT(in) :: Kmm ! time level index 66 68 ! 67 69 INTEGER :: jl, jn , ib, ibd, ii, ij, ik ! dummy loop indices … … 81 83 !! 82 84 NAMELIST/namtrc_bc/ cn_dir_obc, sn_trcobc, rn_trofac, cn_dir_sbc, sn_trcsbc, rn_trsfac, & 83 & cn_dir_cbc, sn_trccbc, rn_trcfac, ln_rnf_ctl, rn_ bc_time85 & cn_dir_cbc, sn_trccbc, rn_trcfac, ln_rnf_ctl, rn_sbc_time, rn_cbc_time 84 86 NAMELIST/namtrc_bdy/ cn_trc_dflt, cn_trc, nn_trcdmp_bdy 85 87 !!---------------------------------------------------------------------- … … 120 122 ! 121 123 ! Read Boundary Conditions Namelists 122 REWIND( numnat_ref ) ! Namelist namtrc_bc in reference namelist : Passive tracer data structure123 124 READ ( numnat_ref, namtrc_bc, IOSTAT = ios, ERR = 901) 124 125 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bc in reference namelist' ) 125 REWIND( numnat_cfg ) ! Namelist namtrc_bc in configuration namelist : Passive tracer data structure126 126 READ ( numnat_cfg, namtrc_bc, IOSTAT = ios, ERR = 902 ) 127 127 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist' ) … … 129 129 130 130 IF ( ln_bdy ) THEN 131 REWIND( numnat_ref ) ! Namelist namtrc_bdy in reference namelist : Passive tracer data structure132 131 READ ( numnat_ref, namtrc_bdy, IOSTAT = ios, ERR = 903) 133 132 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in reference namelist' ) … … 135 134 cn_trc (2:jp_bdy) = cn_trc (1) 136 135 cn_trc_dflt(2:jp_bdy) = cn_trc_dflt(1) 137 REWIND( numnat_cfg ) ! Namelist namtrc_bdy in configuration namelist : Passive tracer data structure138 136 READ ( numnat_cfg, namtrc_bdy, IOSTAT = ios, ERR = 904 ) 139 137 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist' ) … … 264 262 ii = idx_bdy(ib)%nbi(ibd,igrd) 265 263 ij = idx_bdy(ib)%nbj(ibd,igrd) 266 trcdta_bdy(jn,ib)%trc(ibd,ik) = tr n(ii,ij,ik,jn) * tmask(ii,ij,ik)264 trcdta_bdy(jn,ib)%trc(ibd,ik) = tr(ii,ij,ik,jn,Kmm) * tmask(ii,ij,ik) 267 265 END DO 268 266 END DO … … 339 337 340 338 341 SUBROUTINE trc_bc(kt, jit)339 SUBROUTINE trc_bc(kt, Kmm, ptr, Krhs, jit) 342 340 !!---------------------------------------------------------------------- 343 341 !! *** ROUTINE trc_bc *** … … 350 348 USE fldread 351 349 !! 352 INTEGER, INTENT(in) :: kt ! ocean time-step index 353 INTEGER, INTENT(in), OPTIONAL :: jit ! subcycle time-step index (for timesplitting option) 350 INTEGER , INTENT(in) :: kt ! ocean time-step index 351 INTEGER , INTENT(in) :: Kmm, Krhs ! time level indices 352 INTEGER , INTENT(in), OPTIONAL :: jit ! subcycle time-step index (for timesplitting option) 353 REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) :: ptr ! passive tracers and RHS of tracer equation 354 354 !! 355 355 INTEGER :: ji, jj, jk, jn, jl ! Loop index … … 368 368 IF( PRESENT(jit) ) THEN 369 369 ! 370 ! OPEN boundary conditions (use kt_offset=+1 as they are applied at the end of the step)370 ! BDY: use pt_offset=0.5 as applied at the end of the step and fldread is referenced at the middle of the step 371 371 IF( nb_trcobc > 0 ) THEN 372 372 if (lwp) write(numout,'(a,i5,a,i10)') ' reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt 373 CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, kit=jit, kt_offset=+1)373 CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, kit=jit, pt_offset = 0.5_wp ) 374 374 ENDIF 375 375 ! … … 388 388 ELSE 389 389 ! 390 ! OPEN boundary conditions (use kt_offset=+1 as they are applied at the end of the step)390 ! BDY: use pt_offset=0.5 as applied at the end of the step and fldread is referenced at the middle of the step 391 391 IF( nb_trcobc > 0 ) THEN 392 392 if (lwp) write(numout,'(a,i5,a,i10)') ' reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt 393 CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, kt_offset=+1)393 CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, pt_offset = 0.5_wp ) 394 394 ENDIF 395 395 ! … … 414 414 ! Remove river dilution for tracers with absent river load 415 415 IF( ln_rnf_ctl .AND. .NOT.ln_trc_cbc(jn) ) THEN 416 DO jj = 2, jpj 417 DO ji = fs_2, fs_jpim1 418 DO jk = 1, nk_rnf(ji,jj) 419 zrnf = (rnf(ji,jj) + rnf_b(ji,jj)) * 0.5_wp * r1_rau0 / h_rnf(ji,jj) 420 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + (trn(ji,jj,jk,jn) * zrnf) 421 END DO 416 DO_2D_01_00 417 DO jk = 1, nk_rnf(ji,jj) 418 zrnf = (rnf(ji,jj) + rnf_b(ji,jj)) * 0.5_wp * r1_rau0 / h_rnf(ji,jj) 419 ptr(ji,jj,jk,jn,Krhs) = ptr(ji,jj,jk,jn,Krhs) + (ptr(ji,jj,jk,jn,Kmm) * zrnf) 422 420 END DO 423 END DO421 END_2D 424 422 ENDIF 425 423 ! … … 429 427 IF( ln_trc_sbc(jn) ) THEN 430 428 jl = n_trc_indsbc(jn) 431 DO jj = 2, jpj 432 DO ji = fs_2, fs_jpim1 ! vector opt. 433 zfact = 1. / ( e3t_n(ji,jj,1) * rn_bc_time ) 434 tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + rf_trsfac(jl) * sf_trcsbc(jl)%fnow(ji,jj,1) * zfact 429 sf_trcsbc(jl)%fnow(:,:,1) = MAX( rtrn, sf_trcsbc(jl)%fnow(:,:,1) ) ! avoid nedgative value due to interpolation 430 DO_2D_01_00 431 zfact = 1. / ( e3t(ji,jj,1,Kmm) * rn_sbc_time ) 432 ptr(ji,jj,1,jn,Krhs) = ptr(ji,jj,1,jn,Krhs) + rf_trsfac(jl) * sf_trcsbc(jl)%fnow(ji,jj,1) * zfact 433 END_2D 434 ENDIF 435 ! 436 ! COASTAL boundary conditions 437 IF( ( ln_rnf .OR. l_offline ) .AND. ln_trc_cbc(jn) ) THEN 438 IF( l_offline ) rn_rfact = 1._wp 439 jl = n_trc_indcbc(jn) 440 DO_2D_01_00 441 DO jk = 1, nk_rnf(ji,jj) 442 zfact = rn_rfact / ( e1e2t(ji,jj) * h_rnf(ji,jj) * rn_cbc_time ) * tmask(ji,jj,1) 443 ptr(ji,jj,jk,jn,Krhs) = ptr(ji,jj,jk,jn,Krhs) + rf_trcfac(jl) * sf_trccbc(jl)%fnow(ji,jj,1) * zfact 435 444 END DO 436 END DO 437 ENDIF 438 ! 439 ! COASTAL boundary conditions 440 IF( ln_rnf .AND. ln_trc_cbc(jn) ) THEN 441 jl = n_trc_indcbc(jn) 442 DO jj = 2, jpj 443 DO ji = fs_2, fs_jpim1 ! vector opt. 444 DO jk = 1, nk_rnf(ji,jj) 445 zfact = rn_rfact / ( e1e2t(ji,jj) * h_rnf(ji,jj) * rn_bc_time ) 446 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + rf_trcfac(jl) * sf_trccbc(jl)%fnow(ji,jj,1) * zfact 447 END DO 448 END DO 449 END DO 445 END_2D 450 446 ENDIF 451 447 ! ! =========== … … 461 457 !!---------------------------------------------------------------------- 462 458 CONTAINS 463 SUBROUTINE trc_bc_ini( ntrc ) ! Empty routine 464 INTEGER,INTENT(IN) :: ntrc ! number of tracers 465 WRITE(*,*) 'trc_bc_ini: You should not have seen this print! error?', kt 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 462 WRITE(*,*) 'trc_bc_ini: You should not have seen this print! error?', ntrc, Kmm 466 463 END SUBROUTINE trc_bc_ini 467 SUBROUTINE trc_bc( kt ) ! Empty routine 468 WRITE(*,*) 'trc_bc: You should not have seen this print! error?', kt 464 SUBROUTINE trc_bc( kt, Kmm, Krhs ) ! Empty routine 465 INTEGER, INTENT(in) :: kt, Kmm, Krhs ! time level indices 466 WRITE(*,*) 'trc_bc: You should not have seen this print! error?', kt, Kmm, Krhs 469 467 END SUBROUTINE trc_bc 470 468 #endif
Note: See TracChangeset
for help on using the changeset viewer.