[3] | 1 | MODULE obctra |
---|
[2797] | 2 | !!====================================================================== |
---|
[3] | 3 | !! *** MODULE obctra *** |
---|
[2797] | 4 | !! Ocean tracers: Flow Relaxation Scheme of tracers on each open boundary |
---|
| 5 | !!====================================================================== |
---|
| 6 | !! History : 1.0 ! 2005-01 (J. Chanut, A. Sellar) Original code |
---|
| 7 | !! 3.0 ! 2008-04 (NEMO team) add in the reference version |
---|
| 8 | !!---------------------------------------------------------------------- |
---|
[3] | 9 | #if defined key_obc |
---|
[2797] | 10 | !!---------------------------------------------------------------------- |
---|
| 11 | !! 'key_obc' Unstructured Open Boundary Conditions |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
| 13 | !! obc_tra : Apply open boundary conditions to T and S |
---|
| 14 | !! obc_tra_frs : Apply Flow Relaxation Scheme |
---|
| 15 | !!---------------------------------------------------------------------- |
---|
[3] | 16 | USE oce ! ocean dynamics and tracers variables |
---|
| 17 | USE dom_oce ! ocean space and time domain variables |
---|
| 18 | USE obc_oce ! ocean open boundary conditions |
---|
[2797] | 19 | USE obcdta, ONLY: bf |
---|
| 20 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
[3] | 21 | USE in_out_manager ! I/O manager |
---|
| 22 | |
---|
| 23 | IMPLICIT NONE |
---|
| 24 | PRIVATE |
---|
| 25 | |
---|
[2797] | 26 | PUBLIC obc_tra ! routine called in tranxt.F90 |
---|
[3] | 27 | |
---|
[2797] | 28 | !!---------------------------------------------------------------------- |
---|
[2528] | 29 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
[1152] | 30 | !! $Id$ |
---|
[2528] | 31 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[2797] | 32 | !!---------------------------------------------------------------------- |
---|
[3] | 33 | CONTAINS |
---|
| 34 | |
---|
| 35 | SUBROUTINE obc_tra( kt ) |
---|
[2797] | 36 | !!---------------------------------------------------------------------- |
---|
| 37 | !! *** SUBROUTINE obc_dyn3d *** |
---|
[3] | 38 | !! |
---|
[2797] | 39 | !! ** Purpose : - Apply open boundary conditions for baroclinic velocities |
---|
[3] | 40 | !! |
---|
| 41 | !!---------------------------------------------------------------------- |
---|
[2797] | 42 | INTEGER, INTENT( in ) :: kt ! Main time step counter |
---|
| 43 | !! |
---|
| 44 | INTEGER :: ib_obc ! Loop index |
---|
[3] | 45 | |
---|
[2797] | 46 | DO ib_obc=1, nb_obc |
---|
[3] | 47 | |
---|
[2797] | 48 | SELECT CASE( nn_tra(ib_obc) ) |
---|
| 49 | CASE(jp_none) |
---|
| 50 | CYCLE |
---|
| 51 | CASE(jp_frs) |
---|
| 52 | CALL obc_tra_frs( idx_obc(ib_obc), dta_obc(ib_obc), kt ) |
---|
| 53 | CASE DEFAULT |
---|
[2865] | 54 | CALL ctl_stop( 'obc_tra : unrecognised option for open boundaries for T and S' ) |
---|
[2797] | 55 | END SELECT |
---|
| 56 | ENDDO |
---|
[3] | 57 | |
---|
| 58 | END SUBROUTINE obc_tra |
---|
| 59 | |
---|
[2797] | 60 | SUBROUTINE obc_tra_frs( idx, dta, kt ) |
---|
| 61 | !!---------------------------------------------------------------------- |
---|
| 62 | !! *** SUBROUTINE obc_tra_frs *** |
---|
| 63 | !! |
---|
| 64 | !! ** Purpose : Apply the Flow Relaxation Scheme for tracers at open boundaries. |
---|
| 65 | !! |
---|
| 66 | !! Reference : Engedahl H., 1995, Tellus, 365-382. |
---|
| 67 | !!---------------------------------------------------------------------- |
---|
| 68 | INTEGER, INTENT(in) :: kt |
---|
| 69 | TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices |
---|
| 70 | TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data |
---|
| 71 | !! |
---|
| 72 | REAL(wp) :: zwgt ! boundary weight |
---|
| 73 | INTEGER :: ib, ik, igrd ! dummy loop indices |
---|
| 74 | INTEGER :: ii, ij ! 2D addresses |
---|
| 75 | !!---------------------------------------------------------------------- |
---|
| 76 | ! |
---|
| 77 | ! |
---|
| 78 | igrd = 1 ! Everything is at T-points here |
---|
| 79 | DO ib = 1, idx%nblen(igrd) |
---|
| 80 | DO ik = 1, jpkm1 |
---|
| 81 | ii = idx%nbi(ib,igrd) |
---|
| 82 | ij = idx%nbj(ib,igrd) |
---|
| 83 | zwgt = idx%nbw(ib,igrd) |
---|
| 84 | ta(ii,ij,ik) = ( ta(ii,ij,ik) + zwgt * ( dta%tem(ib,ik) - ta(ii,ij,ik) ) ) * tmask(ii,ij,ik) |
---|
| 85 | sa(ii,ij,ik) = ( sa(ii,ij,ik) + zwgt * ( dta%sal(ib,ik) - sa(ii,ij,ik) ) ) * tmask(ii,ij,ik) |
---|
[3] | 86 | END DO |
---|
[2797] | 87 | END DO |
---|
| 88 | ! |
---|
| 89 | CALL lbc_lnk( ta, 'T', 1. ) ; CALL lbc_lnk( sa, 'T', 1. ) ! Boundary points should be updated |
---|
| 90 | ! |
---|
| 91 | IF( kt .eq. nit000 ) CLOSE( unit = 102 ) |
---|
| 92 | ! |
---|
| 93 | END SUBROUTINE obc_tra_frs |
---|
| 94 | |
---|
[3] | 95 | #else |
---|
[2797] | 96 | !!---------------------------------------------------------------------- |
---|
| 97 | !! Dummy module NO Unstruct Open Boundary Conditions |
---|
| 98 | !!---------------------------------------------------------------------- |
---|
[3] | 99 | CONTAINS |
---|
[2797] | 100 | SUBROUTINE obc_tra(kt) ! Empty routine |
---|
| 101 | WRITE(*,*) 'obc_tra: You should not have seen this print! error?', kt |
---|
[3] | 102 | END SUBROUTINE obc_tra |
---|
| 103 | #endif |
---|
| 104 | |
---|
[2797] | 105 | !!====================================================================== |
---|
[3] | 106 | END MODULE obctra |
---|