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 2168 for branches/DEV_r1986_BDY_updates – NEMO

Ignore:
Timestamp:
2010-10-06T16:19:27+02:00 (14 years ago)
Author:
rblod
Message:

Cosmetic changes on BDY branch

Location:
branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY/bdy_par.F90

    r2093 r2168  
    88   !!            3.3  !  2010-09  (D. Storkey and E. O'Dea) update for Shelf configurations 
    99   !!---------------------------------------------------------------------- 
    10 #if defined key_bdy 
     10#if defined   key_bdy 
    1111   !!---------------------------------------------------------------------- 
    1212   !!   'key_bdy' :                    Unstructured Open Boundary Condition 
     
    1616   PUBLIC 
    1717 
    18  
    19    LOGICAL, PUBLIC, PARAMETER ::   lk_bdy  = .TRUE.  !: Unstructured Ocean Boundary Condition flag 
     18   LOGICAL, PUBLIC, PARAMETER ::   lk_bdy  = .TRUE.   !: Unstructured Ocean Boundary Condition flag 
    2019   INTEGER, PUBLIC, PARAMETER ::   jpbdta  = 20000    !: Max length of bdy field in file 
    2120   INTEGER, PUBLIC, PARAMETER ::   jpbdim  = 20000    !: Max length of bdy field on a processor 
    22    INTEGER, PUBLIC, PARAMETER ::   jpbtime = 1000    !: Max number of time dumps per file 
    23    INTEGER, PUBLIC, PARAMETER ::   jpbgrd  = 6       !: Number of horizontal grid types used  (T, u, v, f) 
     21   INTEGER, PUBLIC, PARAMETER ::   jpbtime = 1000     !: Max number of time dumps per file 
     22   INTEGER, PUBLIC, PARAMETER ::   jpbgrd  = 6        !: Number of horizontal grid types used  (T, u, v, f) 
    2423#else 
    2524   !!---------------------------------------------------------------------- 
     
    3029 
    3130   !!---------------------------------------------------------------------- 
    32    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     31   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    3332   !! $Id$  
    3433   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
  • branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY/bdydta.F90

    r2100 r2168  
    1616   !!---------------------------------------------------------------------- 
    1717   !!   bdy_dta    : read u, v, t, s data along open boundaries 
    18    !!   bdy_dta_bt : read depth-mean velocities and elevation along open 
    19    !!                boundaries         
     18   !!   bdy_dta_bt : read depth-mean velocities and elevation along open boundaries         
    2019   !!---------------------------------------------------------------------- 
    2120   USE oce             ! ocean dynamics and tracers 
     
    3736   PUBLIC   bdy_dta_bt  
    3837 
    39    INTEGER ::   numbdyt, numbdyu, numbdyv                      !: logical units for T-, U-, & V-points data file, resp. 
    40    INTEGER ::   ntimes_bdy                                     !: exact number of time dumps in data files 
    41    INTEGER ::   nbdy_b, nbdy_a                                 !: record of bdy data file for before and after model time step 
    42    INTEGER ::   numbdyt_bt, numbdyu_bt, numbdyv_bt             !: logical unit for T-, U- & V-points data file, resp. 
    43    INTEGER ::   ntimes_bdy_bt                                  !: exact number of time dumps in data files 
    44    INTEGER ::   nbdy_b_bt, nbdy_a_bt                           !: record of bdy data file for before and after model time step 
    45  
    46    INTEGER, DIMENSION (jpbtime) ::   istep, istep_bt           !: time array in seconds in each data file 
    47  
    48    REAL(wp) ::  zoffset                                        !: time offset between time origin in file & start time of model run 
    49  
    50    REAL(wp), DIMENSION(jpbdim,jpk,2) ::   tbdydta, sbdydta     !: time interpolated values of T and S bdy data    
    51    REAL(wp), DIMENSION(jpbdim,jpk,2) ::   ubdydta, vbdydta     !: time interpolated values of U and V bdy data  
    52    REAL(wp), DIMENSION(jpbdim,2)     ::   ubtbdydta, vbtbdydta !: Arrays used for time interpolation of bdy data    
    53    REAL(wp), DIMENSION(jpbdim,2)     ::   sshbdydta            !: bdy data of ssh 
     38   INTEGER ::   numbdyt, numbdyu, numbdyv                      ! logical units for T-, U-, & V-points data file, resp. 
     39   INTEGER ::   ntimes_bdy                                     ! exact number of time dumps in data files 
     40   INTEGER ::   nbdy_b, nbdy_a                                 ! record of bdy data file for before and after time step 
     41   INTEGER ::   numbdyt_bt, numbdyu_bt, numbdyv_bt             ! logical unit for T-, U- & V-points data file, resp. 
     42   INTEGER ::   ntimes_bdy_bt                                  ! exact number of time dumps in data files 
     43   INTEGER ::   nbdy_b_bt, nbdy_a_bt                           ! record of bdy data file for before and after time step 
     44 
     45   INTEGER, DIMENSION (jpbtime) ::   istep, istep_bt           ! time array in seconds in each data file 
     46 
     47   REAL(wp) ::  zoffset                                        ! time offset between time origin in file & start time of model run 
     48 
     49   REAL(wp), DIMENSION(jpbdim,jpk,2) ::   tbdydta, sbdydta     ! time interpolated values of T and S bdy data    
     50   REAL(wp), DIMENSION(jpbdim,jpk,2) ::   ubdydta, vbdydta     ! time interpolated values of U and V bdy data  
     51   REAL(wp), DIMENSION(jpbdim,2)     ::   ubtbdydta, vbtbdydta ! Arrays used for time interpolation of bdy data    
     52   REAL(wp), DIMENSION(jpbdim,2)     ::   sshbdydta            ! bdy data of ssh 
    5453 
    5554#if defined key_lim2 
    56    REAL(wp), DIMENSION(jpbdim,2)     ::   frld_bdydta          !: } 
    57    REAL(wp), DIMENSION(jpbdim,2)     ::   hicif_bdydta         !: } Arrays used for time interpolation of bdy data for ice variables 
    58    REAL(wp), DIMENSION(jpbdim,2)     ::   hsnif_bdydta         !: } 
     55   REAL(wp), DIMENSION(jpbdim,2)     ::   frld_bdydta          ! } 
     56   REAL(wp), DIMENSION(jpbdim,2)     ::   hicif_bdydta         ! } Arrays used for time interp. of ice bdy data  
     57   REAL(wp), DIMENSION(jpbdim,2)     ::   hsnif_bdydta         ! } 
    5958#endif 
    6059 
    6160   !!---------------------------------------------------------------------- 
    62    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     61   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    6362   !! $Id$  
    6463   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    6564   !!---------------------------------------------------------------------- 
    66  
    6765CONTAINS 
    6866 
     
    7876      !!                the file. If so read it in. Time interpolate. 
    7977      !!---------------------------------------------------------------------- 
    80       INTEGER, INTENT( in ) ::   kt                             ! ocean time-step index (for timesplitting option, otherwise zero) 
     78      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index (for timesplitting option, otherwise zero) 
    8179      !! 
    8280      CHARACTER(LEN=80), DIMENSION(3) ::   clfile               ! names of input files 
     
    9088      INTEGER ::   itimer, totime 
    9189      INTEGER ::   ii, ij                                       ! array addresses 
    92       INTEGER ::   ipi, ipj, ipk, inum                          ! temporary integers (NetCDF read) 
     90      INTEGER ::   ipi, ipj, ipk, inum                          ! local integers (NetCDF read) 
    9391      INTEGER ::   iyear0, imonth0, iday0 
    9492      INTEGER ::   ihours0, iminutes0, isec0 
     
    102100      !!--------------------------------------------------------------------------- 
    103101 
    104       IF( ln_bdy_dyn_frs .OR. ln_bdy_tra_frs ) THEN  ! If these are both false then this routine  
    105                                                      ! does nothing. 
     102 
     103      IF( ln_bdy_dyn_frs .OR. ln_bdy_tra_frs    & 
     104         &               .OR. ln_bdy_ice_frs ) THEN  ! If these are both false then this routine does nothing 
    106105 
    107106      ! -------------------- ! 
     
    113112      ! Some time variables for monthly climatological forcing: 
    114113      ! ******************************************************* 
    115  !!gm  here  use directely daymod variables 
     114 
     115!!gm  here  use directely daymod calendar variables 
    116116  
    117117      iman = INT( raamo )      ! Number of months in a year 
     
    132132         !                                             !-------------------! 
    133133         istep(:) = 0 
    134          nbdy_b    = 0 
    135          nbdy_a    = 0 
     134         nbdy_b   = 0 
     135         nbdy_a   = 0 
    136136 
    137137         ! Get time information from bdy data file 
     
    162162            igrd_start = 1 
    163163            igrd_end   = 3 
    164             IF(.NOT. ln_bdy_tra_frs .AND. .NOT. ln_bdy_ice_frs) THEN 
    165                ! No T-grid file. 
     164            IF(.NOT. ln_bdy_tra_frs .AND. .NOT. ln_bdy_ice_frs) THEN       ! No T-grid file. 
    166165               igrd_start = 2 
    167             ELSEIF ( .NOT. ln_bdy_dyn_frs ) THEN 
    168                ! No U-grid or V-grid file. 
     166            ELSEIF ( .NOT. ln_bdy_dyn_frs ) THEN                           ! No U-grid or V-grid file. 
    169167               igrd_end   = 1          
    170168            ENDIF 
     
    176174 
    177175               SELECT CASE( igrd ) 
    178                   CASE (1)  
    179                      numbdyt = inum 
    180                   CASE (2)  
    181                      numbdyu = inum 
    182                   CASE (3)  
    183                      numbdyv = inum 
     176                  CASE (1)   ;   numbdyt = inum 
     177                  CASE (2)   ;   numbdyu = inum 
     178                  CASE (3)   ;   numbdyv = inum 
    184179               END SELECT 
    185180 
     
    216211 
    217212               ! Check that time array increases: 
    218          
    219213               it = 1 
    220                DO WHILE( zstepr(it+1) > zstepr(it) .AND. it /= ntimes_bdy - 1 ) 
    221                  it = it + 1 
     214               DO WHILE( zstepr(it+1) > zstepr(it) .AND. it /= ntimes_bdy - 1 )  
     215                  it = it + 1 
    222216               END DO 
    223  
    224                IF( it.NE.ntimes_bdy-1 .AND. ntimes_bdy > 1 ) THEN 
     217               ! 
     218               IF( it /= ntimes_bdy-1 .AND. ntimes_bdy > 1 ) THEN 
    225219                     WRITE(ctmp1,*) 'Check file: ', clfile(igrd) 
    226220                     CALL ctl_stop( 'Time array in unstructured boundary data files',   & 
     
    274268            ENDIF 
    275269 
    276             IF( igrd_start == 1 ) THEN 
    277                istep(:) = istept(:) 
    278             ELSE 
    279                istep(:) = istepu(:) 
     270            IF( igrd_start == 1 ) THEN   ;   istep(:) = istept(:) 
     271            ELSE                         ;   istep(:) = istepu(:) 
    280272            ENDIF 
    281273 
     
    302294            it = 1 
    303295            DO WHILE( istep(it+1) <= 0 .AND. it <= ntimes_bdy - 1 ) 
    304               it = it + 1 
     296               it = it + 1 
    305297            END DO 
    306298            nbdy_b = it 
     
    315307         ! ***************************************************************** 
    316308 
    317          IF( nbdy_dta == 0) THEN      ! boundary data arrays are filled with initial conditions 
     309         IF( nbdy_dta == 0 ) THEN      ! boundary data arrays are filled with initial conditions 
    318310            ! 
    319311            IF (ln_bdy_tra_frs) THEN 
    320               igrd = 1            ! T-points data  
    321               DO ib = 1, nblen(igrd) 
    322                 ii = nbi(ib,igrd) 
    323                 ij = nbj(ib,igrd) 
    324                 DO ik = 1, jpkm1 
    325                   tbdy(ib,ik) = tn(ii, ij, ik) 
    326                   sbdy(ib,ik) = sn(ii, ij, ik) 
    327                 ENDDO 
    328               END DO 
     312               igrd = 1            ! T-points data  
     313               DO ib = 1, nblen(igrd) 
     314                  ii = nbi(ib,igrd) 
     315                  ij = nbj(ib,igrd) 
     316                  DO ik = 1, jpkm1 
     317                     tbdy(ib,ik) = tn(ii,ij,ik) 
     318                     sbdy(ib,ik) = sn(ii,ij,ik) 
     319                  END DO 
     320               END DO 
    329321            ENDIF 
    330322 
    331323            IF(ln_bdy_dyn_frs) THEN 
    332               igrd = 2            ! U-points data  
    333               DO ib = 1, nblen(igrd) 
    334                 ii = nbi(ib,igrd) 
    335                 ij = nbj(ib,igrd) 
    336                 DO ik = 1, jpkm1 
    337                   ubdy(ib,ik) = un(ii, ij, ik) 
    338                 ENDDO 
    339               END DO 
    340  
    341               igrd = 3            ! V-points data  
    342               DO ib = 1, nblen(igrd)             
    343                 ii = nbi(ib,igrd) 
    344                 ij = nbj(ib,igrd) 
    345                 DO ik = 1, jpkm1 
    346                   vbdy(ib,ik) = vn(ii, ij, ik) 
    347                 ENDDO 
    348               END DO 
     324               igrd = 2            ! U-points data  
     325               DO ib = 1, nblen(igrd) 
     326                  ii = nbi(ib,igrd) 
     327                  ij = nbj(ib,igrd) 
     328                  DO ik = 1, jpkm1 
     329                     ubdy(ib,ik) = un(ii, ij, ik) 
     330                  END DO 
     331               END DO 
     332               ! 
     333               igrd = 3            ! V-points data  
     334               DO ib = 1, nblen(igrd)             
     335                  ii = nbi(ib,igrd) 
     336                  ij = nbj(ib,igrd) 
     337                  DO ik = 1, jpkm1 
     338                     vbdy(ib,ik) = vn(ii, ij, ik) 
     339                  END DO 
     340               END DO 
    349341            ENDIF 
    350342            ! 
    351343#if defined key_lim2 
    352             IF (ln_bdy_ice_frs) THEN 
     344            IF( ln_bdy_ice_frs ) THEN 
    353345               igrd = 1            ! T-points data 
    354346               DO ib = 1, nblen(igrd) 
    355                   frld_bdy(ib) =  frld(nbi(ib,igrd), nbj(ib,igrd)) 
     347                  frld_bdy (ib) =  frld(nbi(ib,igrd), nbj(ib,igrd)) 
    356348                  hicif_bdy(ib) = hicif(nbi(ib,igrd), nbj(ib,igrd)) 
    357349                  hsnif_bdy(ib) = hsnif(nbi(ib,igrd), nbj(ib,igrd)) 
     
    377369 
    378370            IF(ln_bdy_tra_frs) THEN 
     371               ! 
    379372               igrd = 1                                           ! Temperature 
    380373               IF( nblendta(igrd) <=  0 ) THEN  
     
    385378               ipi = nblendta(igrd) 
    386379               CALL iom_get ( numbdyt, jpdom_unknown, 'votemper', zdta(1:ipi,1:ipj,1:ipk), nbdy_a ) 
    387  
     380               ! 
    388381               DO ib = 1, nblen(igrd) 
    389382                  DO ik = 1, jpkm1 
     
    400393               ipi = nblendta(igrd) 
    401394               CALL iom_get ( numbdyt, jpdom_unknown, 'vosaline', zdta(1:ipi,1:ipj,1:ipk), nbdy_a ) 
    402  
     395               ! 
    403396               DO ib = 1, nblen(igrd) 
    404397                  DO ik = 1, jpkm1 
     
    408401            ENDIF  ! ln_bdy_tra_frs 
    409402  
    410             IF(ln_bdy_dyn_frs) THEN 
    411  
     403            IF( ln_bdy_dyn_frs ) THEN 
     404               ! 
    412405               igrd = 2                                           ! u-velocity 
    413406               IF ( nblendta(igrd) .le. 0 ) THEN  
     
    440433 
    441434#if defined key_lim2 
    442             IF(ln_bdy_ice_frs) THEN 
     435            IF( ln_bdy_ice_frs ) THEN 
    443436              ! 
    444437              igrd=1                                              ! leads fraction 
     
    468461#endif 
    469462 
    470             IF ((.NOT.ln_bdy_clim) .AND. (istep(1) > 0)) THEN 
    471                ! First data time is after start of run 
    472                ! Put first value in both time levels 
     463            IF( .NOT.ln_bdy_clim .AND. istep(1) > 0 ) THEN     ! First data time is after start of run 
     464               nbdy_b = nbdy_a                                 ! Put first value in both time levels 
     465               IF( ln_bdy_tra_frs ) THEN 
     466                 tbdydta(:,:,1) = tbdydta(:,:,2) 
     467                 sbdydta(:,:,1) = sbdydta(:,:,2) 
     468               ENDIF 
     469               IF( ln_bdy_dyn_frs ) THEN 
     470                 ubdydta(:,:,1) = ubdydta(:,:,2) 
     471                 vbdydta(:,:,1) = vbdydta(:,:,2) 
     472               ENDIF 
     473#if defined key_lim2 
     474               IF( ln_bdy_ice_frs ) THEN 
     475                  frld_bdydta (:,1) =  frld_bdydta(:,2) 
     476                  hicif_bdydta(:,1) = hicif_bdydta(:,2) 
     477                  hsnif_bdydta(:,1) = hsnif_bdydta(:,2) 
     478               ENDIF 
     479#endif 
     480            END IF 
     481            ! 
     482         END IF   ! nbdy_dta == 0/1 
     483  
     484         ! In the case of constant boundary forcing fill bdy arrays once for all 
     485         IF( ln_bdy_clim .AND. ntimes_bdy == 1 ) THEN 
     486            IF( ln_bdy_tra_frs ) THEN 
     487               tbdy  (:,:) = tbdydta  (:,:,2) 
     488               sbdy  (:,:) = sbdydta  (:,:,2) 
     489            ENDIF 
     490            IF( ln_bdy_dyn_frs) THEN 
     491               ubdy  (:,:) = ubdydta  (:,:,2) 
     492               vbdy  (:,:) = vbdydta  (:,:,2) 
     493            ENDIF 
     494#if defined key_lim2 
     495            IF( ln_bdy_ice_frs ) THEN 
     496               frld_bdy (:) = frld_bdydta (:,2) 
     497               hicif_bdy(:) = hicif_bdydta(:,2) 
     498               hsnif_bdy(:) = hsnif_bdydta(:,2) 
     499            ENDIF 
     500#endif 
     501 
     502            IF( ln_bdy_tra_frs .OR. ln_bdy_ice_frs) CALL iom_close( numbdyt ) 
     503            IF( ln_bdy_dyn_frs                    ) CALL iom_close( numbdyu ) 
     504            IF( ln_bdy_dyn_frs                    ) CALL iom_close( numbdyv ) 
     505         END IF 
     506         ! 
     507      ENDIF                                            ! End if nit000 
     508 
     509 
     510      !                                                !---------------------! 
     511      IF( nbdy_dta == 1 .AND. ntimes_bdy > 1 ) THEN    !  at each time step  ! 
     512         !                                             !---------------------! 
     513         ! Read one more record if necessary 
     514         !********************************** 
     515 
     516         IF( ln_bdy_clim .AND. imois /= nbdy_b ) THEN      ! remember that nbdy_b=0 for kt=nit000 
     517            nbdy_b = imois 
     518            nbdy_a = imois + 1 
     519            nbdy_b = MOD( nbdy_b, iman )   ;   IF( nbdy_b == 0 ) nbdy_b = iman 
     520            nbdy_a = MOD( nbdy_a, iman )   ;   IF( nbdy_a == 0 ) nbdy_a = iman 
     521            lect=.true. 
     522         ELSEIF( .NOT.ln_bdy_clim .AND. itimer >= istep(nbdy_a) ) THEN 
     523 
     524            IF( nbdy_a < ntimes_bdy ) THEN 
     525               nbdy_b = nbdy_a 
     526               nbdy_a = nbdy_a + 1 
     527               lect  =.true. 
     528            ELSE 
     529               ! We have reached the end of the file 
     530               ! put the last data time into both time levels 
    473531               nbdy_b = nbdy_a 
    474532               IF(ln_bdy_tra_frs) THEN 
    475                  tbdydta(:,:,1) = tbdydta(:,:,2) 
    476                  sbdydta(:,:,1) = sbdydta(:,:,2) 
     533                  tbdydta(:,:,1) = tbdydta(:,:,2) 
     534                  sbdydta(:,:,1) = sbdydta(:,:,2) 
    477535               ENDIF 
    478536               IF(ln_bdy_dyn_frs) THEN 
    479                  ubdydta(:,:,1) = ubdydta(:,:,2) 
    480                  vbdydta(:,:,1) = vbdydta(:,:,2) 
     537                  ubdydta(:,:,1) = ubdydta(:,:,2) 
     538                  vbdydta(:,:,1) = vbdydta(:,:,2) 
    481539               ENDIF 
    482540#if defined key_lim2 
    483              IF( ln_bdy_ice_frs ) THEN 
    484                frld_bdydta (:,1) =  frld_bdydta(:,2) 
    485                hicif_bdydta(:,1) = hicif_bdydta(:,2) 
    486                hsnif_bdydta(:,1) = hsnif_bdydta(:,2) 
    487              ENDIF 
    488 #endif 
    489             END IF 
    490  
    491          END IF ! nbdy_dta == 0/1 
    492   
    493          ! In the case of constant boundary forcing fill bdy arrays once for all 
    494          IF ((ln_bdy_clim).AND.(ntimes_bdy==1)) THEN 
    495             IF(ln_bdy_tra_frs) THEN 
    496               tbdy  (:,:) = tbdydta  (:,:,2) 
    497               sbdy  (:,:) = sbdydta  (:,:,2) 
    498             ENDIF 
    499             IF(ln_bdy_dyn_frs) THEN 
    500               ubdy  (:,:) = ubdydta  (:,:,2) 
    501               vbdy  (:,:) = vbdydta  (:,:,2) 
    502             ENDIF 
    503 #if defined key_lim2 
    504           IF(ln_bdy_ice_frs) THEN 
    505             frld_bdy (:) = frld_bdydta (:,2) 
    506             hicif_bdy(:) = hicif_bdydta(:,2) 
    507             hsnif_bdy(:) = hsnif_bdydta(:,2) 
    508           ENDIF 
    509 #endif 
    510  
    511             IF(ln_bdy_tra_frs .or. ln_bdy_ice_frs) CALL iom_close( numbdyt ) 
    512             IF(ln_bdy_dyn_frs) CALL iom_close( numbdyu ) 
    513             IF(ln_bdy_dyn_frs) CALL iom_close( numbdyv ) 
    514          END IF 
    515  
    516       ENDIF                                            ! End if nit000 
    517  
    518  
    519       !                                                !---------------------! 
    520       !                                                !  at each time step  ! 
    521       !                                                !---------------------! 
    522  
    523       IF( nbdy_dta == 1 .AND. ntimes_bdy > 1 ) THEN  
    524          ! 
    525          ! Read one more record if necessary 
    526          !********************************** 
    527  
    528         IF( ln_bdy_clim .AND. imois /= nbdy_b ) THEN      ! remember that nbdy_b=0 for kt=nit000 
    529            nbdy_b = imois 
    530            nbdy_a = imois + 1 
    531            nbdy_b = MOD( nbdy_b, iman )   ;   IF( nbdy_b == 0 ) nbdy_b = iman 
    532            nbdy_a = MOD( nbdy_a, iman )   ;   IF( nbdy_a == 0 ) nbdy_a = iman 
    533            lect=.true. 
    534         ELSEIF( .NOT.ln_bdy_clim .AND. itimer >= istep(nbdy_a) ) THEN 
    535  
    536            IF ( nbdy_a < ntimes_bdy ) THEN 
    537               nbdy_b = nbdy_a 
    538               nbdy_a = nbdy_a + 1 
    539               lect  =.true. 
    540            ELSE 
    541               ! We have reached the end of the file 
    542               ! put the last data time into both time levels 
    543               nbdy_b = nbdy_a 
    544               IF(ln_bdy_tra_frs) THEN 
    545                 tbdydta(:,:,1) =  tbdydta(:,:,2) 
    546                 sbdydta(:,:,1) =  sbdydta(:,:,2) 
    547               ENDIF 
    548               IF(ln_bdy_dyn_frs) THEN 
    549                 ubdydta(:,:,1) =  ubdydta(:,:,2) 
    550                 vbdydta(:,:,1) =  vbdydta(:,:,2) 
    551               ENDIF 
    552 #if defined key_lim2 
    553               IF(ln_bdy_ice_frs) THEN 
    554                 frld_bdydta (:,1) =  frld_bdydta (:,2) 
    555                 hicif_bdydta(:,1) =  hicif_bdydta(:,2) 
    556                 hsnif_bdydta(:,1) =  hsnif_bdydta(:,2) 
    557               ENDIF 
     541               IF(ln_bdy_ice_frs) THEN 
     542                  frld_bdydta (:,1) =  frld_bdydta (:,2) 
     543                  hicif_bdydta(:,1) =  hicif_bdydta(:,2) 
     544                  hsnif_bdydta(:,1) =  hsnif_bdydta(:,2) 
     545               ENDIF 
    558546#endif 
    559547            END IF ! nbdy_a < ntimes_bdy 
    560  
     548            ! 
    561549        END IF 
    562550          
    563         IF( lect ) THEN 
    564            ! Swap arrays 
    565            IF(ln_bdy_tra_frs) THEN 
     551        IF( lect ) THEN           ! Swap arrays 
     552           IF( ln_bdy_tra_frs ) THEN 
    566553             tbdydta(:,:,1) =  tbdydta(:,:,2) 
    567554             sbdydta(:,:,1) =  sbdydta(:,:,2) 
    568555           ENDIF 
    569            IF(ln_bdy_dyn_frs) THEN 
     556           IF( ln_bdy_dyn_frs ) THEN 
    570557             ubdydta(:,:,1) =  ubdydta(:,:,2) 
    571558             vbdydta(:,:,1) =  vbdydta(:,:,2) 
    572559           ENDIF 
    573560#if defined key_lim2 
    574            IF(ln_bdy_ice_frs) THEN 
     561           IF( ln_bdy_ice_frs ) THEN 
    575562             frld_bdydta (:,1) =  frld_bdydta (:,2) 
    576563             hicif_bdydta(:,1) =  hicif_bdydta(:,2) 
     
    582569           ipk  = jpk 
    583570 
    584            IF(ln_bdy_tra_frs) THEN 
     571           IF( ln_bdy_tra_frs ) THEN 
    585572              !  
    586573              igrd = 1                                   ! temperature 
     
    720707      ! 
    721708      ENDIF ! ln_bdy_dyn_frs .OR. ln_bdy_tra_frs 
    722  
     709      ! 
    723710   END SUBROUTINE bdy_dta 
    724711 
  • branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY/bdydyn.F90

    r2093 r2168  
    3636 
    3737   !!---------------------------------------------------------------------- 
    38    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     38   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    3939   !! $Id$  
    4040   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4141   !!---------------------------------------------------------------------- 
    42  
    4342CONTAINS 
    4443 
     
    5655      INTEGER, INTENT( in ) ::   kt   ! Main time step counter 
    5756      !! 
    58       INTEGER  ::   ib, ik, igrd      ! dummy loop indices 
    59       INTEGER  ::   ii, ij            ! 2D addresses 
    60       REAL(wp) ::   zwgt              ! boundary weight 
     57      INTEGER  ::   jb, jk         ! dummy loop indices 
     58      INTEGER  ::   ii, ij, igrd   ! local integers 
     59      REAL(wp) ::   zwgt           ! boundary weight 
    6160      !!---------------------------------------------------------------------- 
    6261      ! 
    63       IF(ln_bdy_dyn_frs) THEN ! If this is false, then this routine does nothing.  
    64  
     62      IF(ln_bdy_dyn_frs) THEN       ! If this is false, then this routine does nothing.  
     63         ! 
    6564         IF( kt == nit000 ) THEN 
    6665            IF(lwp) WRITE(numout,*) 
     
    7069         ! 
    7170         igrd = 2                      ! Relaxation of zonal velocity 
    72          DO ib = 1, nblen(igrd) 
    73             DO ik = 1, jpkm1 
    74                ii = nbi(ib,igrd) 
    75                ij = nbj(ib,igrd) 
    76                zwgt = nbw(ib,igrd) 
    77                ua(ii,ij,ik) = ( ua(ii,ij,ik) * ( 1.- zwgt ) + ubdy(ib,ik) * zwgt ) * umask(ii,ij,ik) 
     71         DO jb = 1, nblen(igrd) 
     72            DO jk = 1, jpkm1 
     73               ii   = nbi(jb,igrd) 
     74               ij   = nbj(jb,igrd) 
     75               zwgt = nbw(jb,igrd) 
     76               ua(ii,ij,jk) = ( ua(ii,ij,jk) * ( 1.- zwgt ) + ubdy(jb,jk) * zwgt ) * umask(ii,ij,jk) 
    7877            END DO 
    7978         END DO 
    8079         ! 
    8180         igrd = 3                      ! Relaxation of meridional velocity 
    82          DO ib = 1, nblen(igrd) 
    83             DO ik = 1, jpkm1 
    84                ii = nbi(ib,igrd) 
    85                ij = nbj(ib,igrd) 
    86                zwgt = nbw(ib,igrd) 
    87                va(ii,ij,ik) = ( va(ii,ij,ik) * ( 1.- zwgt ) + vbdy(ib,ik) * zwgt ) * vmask(ii,ij,ik) 
     81         DO jb = 1, nblen(igrd) 
     82            DO jk = 1, jpkm1 
     83               ii   = nbi(jb,igrd) 
     84               ij   = nbj(jb,igrd) 
     85               zwgt = nbw(jb,igrd) 
     86               va(ii,ij,jk) = ( va(ii,ij,jk) * ( 1.- zwgt ) + vbdy(jb,jk) * zwgt ) * vmask(ii,ij,jk) 
    8887            END DO 
    8988         END DO  
    90          ! 
    91          CALL lbc_lnk( ua, 'U', -1. )   ! Boundary points should be updated 
    92          CALL lbc_lnk( va, 'V', -1. )   ! 
     89         CALL lbc_lnk( ua, 'U', -1. )   ;   CALL lbc_lnk( va, 'V', -1. )   ! Boundary points should be updated 
    9390         ! 
    9491      ENDIF ! ln_bdy_dyn_frs 
    95  
     92      ! 
    9693   END SUBROUTINE bdy_dyn_frs 
    9794 
    9895 
    99 #if defined key_dynspg_exp || defined key_dynspg_ts 
     96# if defined   key_dynspg_exp   ||   defined key_dynspg_ts 
     97   !!---------------------------------------------------------------------- 
     98   !!   'key_dynspg_exp'        OR              explicit sea surface height 
     99   !!   'key_dynspg_ts '                  split-explicit sea surface height 
     100   !!---------------------------------------------------------------------- 
     101    
    100102!! Option to use Flather with dynspg_flt not coded yet... 
     103 
    101104   SUBROUTINE bdy_dyn_fla( pssh ) 
    102105      !!---------------------------------------------------------------------- 
     
    121124      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pssh 
    122125 
    123       INTEGER  ::   ib, igrd                         ! dummy loop indices 
     126      INTEGER  ::   jb, igrd                         ! dummy loop indices 
    124127      INTEGER  ::   ii, ij, iim1, iip1, ijm1, ijp1   ! 2D addresses 
    125128      REAL(wp) ::   zcorr                            ! Flather correction 
     
    136139         igrd = 4 
    137140         spgu(:,:) = 0.0 
    138          DO ib = 1, nblenrim(igrd) 
    139             ii = nbi(ib,igrd) 
    140             ij = nbj(ib,igrd) 
    141             IF( ln_bdy_dyn_fla ) spgu(ii, ij) = sshbdy(ib) 
    142             IF( ln_bdy_tides )   spgu(ii, ij) = spgu(ii, ij) + sshtide(ib) 
     141         DO jb = 1, nblenrim(igrd) 
     142            ii = nbi(jb,igrd) 
     143            ij = nbj(jb,igrd) 
     144            IF( ln_bdy_dyn_fla ) spgu(ii, ij) = sshbdy(jb) 
     145            IF( ln_bdy_tides )   spgu(ii, ij) = spgu(ii, ij) + sshtide(jb) 
    143146         END DO 
    144147         ! 
     
    146149         !             ! remember that flagu=-1 if normal velocity direction is outward 
    147150         !             ! I think we should rather use after ssh ? 
    148          DO ib = 1, nblenrim(igrd) 
    149             ii  = nbi(ib,igrd) 
    150             ij  = nbj(ib,igrd)  
    151             iim1 = ii + MAX( 0, INT( flagu(ib) ) )   ! T pts i-indice inside the boundary 
    152             iip1 = ii - MIN( 0, INT( flagu(ib) ) )   ! T pts i-indice outside the boundary  
     151         DO jb = 1, nblenrim(igrd) 
     152            ii  = nbi(jb,igrd) 
     153            ij  = nbj(jb,igrd)  
     154            iim1 = ii + MAX( 0, INT( flagu(jb) ) )   ! T pts i-indice inside the boundary 
     155            iip1 = ii - MIN( 0, INT( flagu(jb) ) )   ! T pts i-indice outside the boundary  
    153156            ! 
    154             zcorr = - flagu(ib) * SQRT( grav * hur_e(ii, ij) ) * ( pssh(iim1, ij) - spgu(iip1,ij) ) 
    155             zforc = ubtbdy(ib) + utide(ib) 
     157            zcorr = - flagu(jb) * SQRT( grav * hur_e(ii, ij) ) * ( pssh(iim1, ij) - spgu(iip1,ij) ) 
     158            zforc = ubtbdy(jb) + utide(jb) 
    156159            ua_e(ii,ij) = zforc + zcorr * umask(ii,ij,1)  
    157160         END DO 
     
    159162         igrd = 6      ! Flather bc on v-velocity 
    160163         !             ! remember that flagv=-1 if normal velocity direction is outward 
    161          DO ib = 1, nblenrim(igrd) 
    162             ii  = nbi(ib,igrd) 
    163             ij  = nbj(ib,igrd)  
    164             ijm1 = ij + MAX( 0, INT( flagv(ib) ) )   ! T pts j-indice inside the boundary 
    165             ijp1 = ij - MIN( 0, INT( flagv(ib) ) )   ! T pts j-indice outside the boundary  
     164         DO jb = 1, nblenrim(igrd) 
     165            ii  = nbi(jb,igrd) 
     166            ij  = nbj(jb,igrd)  
     167            ijm1 = ij + MAX( 0, INT( flagv(jb) ) )   ! T pts j-indice inside the boundary 
     168            ijp1 = ij - MIN( 0, INT( flagv(jb) ) )   ! T pts j-indice outside the boundary  
    166169            ! 
    167             zcorr = - flagv(ib) * SQRT( grav * hvr_e(ii, ij) ) * ( pssh(ii, ijm1) - spgu(ii,ijp1) ) 
    168             zforc = vbtbdy(ib) + vtide(ib) 
     170            zcorr = - flagv(jb) * SQRT( grav * hvr_e(ii, ij) ) * ( pssh(ii, ijm1) - spgu(ii,ijp1) ) 
     171            zforc = vbtbdy(jb) + vtide(jb) 
    169172            va_e(ii,ij) = zforc + zcorr * vmask(ii,ij,1) 
    170173         END DO 
  • branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY/bdyice.F90

    r2093 r2168  
    11MODULE bdyice 
    2    !!================================================================================= 
     2   !!====================================================================== 
    33   !!                       ***  MODULE  bdyice  *** 
    4    !! Ocean tracers:   Flow Relaxation Scheme of sea-ice fields on each open boundary 
    5    !!================================================================================= 
    6 #if defined key_bdy && defined key_lim2 
    7    !!--------------------------------------------------------------------------------- 
    8    !!   'key_bdy'      :                         Unstructured Open Boundary Conditions 
    9    !!--------------------------------------------------------------------------------- 
     4   !! Unstructured Open Boundary Cond. :  Flow Relaxation Scheme applied sea-ice 
     5   !!====================================================================== 
     6   !!  History :  3.3  !  2010-09 (D. Storkey)  Original code 
     7   !!---------------------------------------------------------------------- 
     8#if defined   key_bdy   &&   defined key_lim2 
     9   !!---------------------------------------------------------------------- 
     10   !!   'key_bdy'            and                 Unstructured Open Boundary Conditions 
     11   !!   'key_lim2'                                                 LIM-2 sea ice model 
     12   !!---------------------------------------------------------------------- 
    1013   !!   bdy_ice        : Relaxation of tracers on unstructured open boundaries 
    11    !!--------------------------------------------------------------------------------- 
    12    !! * Modules used 
     14   !!---------------------------------------------------------------------- 
    1315   USE oce             ! ocean dynamics and tracers variables 
    14 #if defined key_lim2 
    1516   USE ice_2           ! LIM_2 ice variables 
    16 #endif 
    1717   USE dom_oce         ! ocean space and time domain variables  
    1818   USE bdy_oce         ! ocean open boundary conditions 
    1919   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2020   USE in_out_manager  ! write to numout file 
     21    
    2122   IMPLICIT NONE 
    2223   PRIVATE 
    2324 
    24    !! * Accessibility 
    25    PUBLIC bdy_ice     ! routine called in stp 
     25   PUBLIC   bdy_ice    ! routine called in sbcmod 
    2626 
    27    !! * Substitutions 
    28  
    29    !!--------------------------------------------------------------------------------- 
    30    !!   OPA 9.0 , LODYC-IPSL  (2003) 
    31    !!--------------------------------------------------------------------------------- 
    32  
     27   !!---------------------------------------------------------------------- 
     28   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     29   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     30   !!---------------------------------------------------------------------- 
    3331CONTAINS 
    3432 
     
    3735      !!                 ***  SUBROUTINE bdy_ice  *** 
    3836      !!                     
    39       !! ** Purpose : Apply the Flow Relaxation Scheme for sea-ice fields in the   
    40       !!              case of unstructured open boundaries. Currently only tested 
    41       !!              for LIM2. 
     37      !! ** Purpose : Apply the Flow Relaxation Scheme for sea-ice fields in the case  
     38      !!              of unstructured open boundaries. Currently only tested for LIM2. 
    4239      !!  
    43       !! Reference : Engedahl H., 1995: Use of the flow relaxation scheme in  
    44       !!             a three-dimensional baroclinic ocean model with realistic 
    45       !!             topography. Tellus, 365-382. 
    46       !!  History : 
    47       !!   NEMO 3.3  !  2010-09 (D. Storkey) Original code 
     40      !! Reference : Engedahl H., 1995: Use of the flow relaxation scheme in a three- 
     41      !!             dimensional baroclinic ocean model with realistic topography. Tellus, 365-382. 
    4842      !!------------------------------------------------------------------------------ 
    49       !! * Arguments 
    50       INTEGER, INTENT( in ) ::   kt 
    51  
    52       !! * Local declarations 
    53       REAL(wp) :: zwgt                       ! boundary weight 
    54       INTEGER ::   jb, jk, jgrd              ! dummy loop indices 
    55       INTEGER ::   ii, ij                    ! 2D addresses 
     43      INTEGER, INTENT( in ) ::   kt   ! model time step index 
     44      !! 
     45      INTEGER  ::   jb, jk, jgrd   ! dummy loop indices 
     46      INTEGER  ::   ii, ij         ! local scalar 
     47      REAL(wp) ::   zwgt, zwgt1    ! local scalar 
    5648      !!------------------------------------------------------------------------------ 
    57  
    58       jgrd=1 !: Everything is at T-points here 
    59   
    60       IF(ln_bdy_ice_frs) THEN 
    61   
    62         DO jb = 1, nblen(jgrd) 
    63           DO jk = 1, jpkm1 
    64             ii = nbi(jb,jgrd) 
    65             ij = nbj(jb,jgrd) 
    66             zwgt = nbw(jb,jgrd) 
    67  
    68             ! Leads fraction relaxation at the boundary    
    69             frld(ii,ij) = ( frld(ii,ij)*(1.-zwgt)  +  frld_bdy(jb)*zwgt ) & 
    70                                                           * tmask(ii,ij,1)          
    71  
    72             ! Ice depth relaxation at the boundary    
    73             hicif(ii,ij) = ( hicif(ii,ij)*(1.-zwgt)  +  hicif_bdy(jb)*zwgt ) & 
    74                                                           * tmask(ii,ij,1) 
    75             ! Snow depth relaxation at the boundary    
    76             hsnif(ii,ij) = ( hsnif(ii,ij)*(1.-zwgt)  +  hsnif_bdy(jb)*zwgt ) & 
    77                                                           * tmask(ii,ij,1) 
    78     
    79           END DO 
    80         END DO  
    81  
    82         CALL lbc_lnk( frld, 'T', 1. )  ! Boundary points should be updated 
    83         CALL lbc_lnk( hicif, 'T', 1. ) ! 
    84         CALL lbc_lnk( hsnif, 'T', 1. ) ! 
    85        
    86       ELSE 
    87         ! we have called this routine without ln_bdy_ice_frs not set 
    88         IF(kt .EQ. nit000) THEN 
    89           WRITE(numout,*) 'E R R O R (possible) called bdy_ice when' 
    90           WRITE(numout,*) 'ln_bdy_ice_frs is false?' 
    91         ENDIF 
    92       ENDIF ! if ln_bdy_ice_frs 
    93        
     49      ! 
     50      jgrd = 1      ! Everything is at T-points here 
     51      ! 
     52      IF( ln_bdy_ice_frs ) THEN     ! update ice fields by relaxation at the boundary 
     53         DO jb = 1, nblen(jgrd) 
     54            DO jk = 1, jpkm1 
     55               ii    = nbi(jb,jgrd) 
     56               ij    = nbj(jb,jgrd) 
     57               zwgt  = nbw(jb,jgrd) 
     58               zwgt1 = 1.e0 - nbw(jb,jgrd) 
     59               frld (ii,ij) = ( frld (ii,ij) * zwgt1 + frld_bdy (jb) * zwgt ) * tmask(ii,ij,1)     ! Leads fraction  
     60               hicif(ii,ij) = ( hicif(ii,ij) * zwgt1 + hicif_bdy(jb) * zwgt ) * tmask(ii,ij,1)     ! Ice depth  
     61               hsnif(ii,ij) = ( hsnif(ii,ij) * zwgt1 + hsnif_bdy(jb) * zwgt ) * tmask(ii,ij,1)     ! Snow depth 
     62            END DO 
     63         END DO  
     64         CALL lbc_lnk( frld, 'T', 1. )                                         ! lateral boundary conditions 
     65         CALL lbc_lnk( hicif, 'T', 1. )   ;   CALL lbc_lnk( hsnif, 'T', 1. ) 
     66         ! 
     67      ELSE                          ! we have called this routine without ln_bdy_ice_frs not set 
     68         IF( kt == nit000 )   CALL ctl_warn( 'E R R O R (possible) called bdy_ice when ln_bdy_ice_frs is false?' ) 
     69      ENDIF 
     70      !       
    9471   END SUBROUTINE bdy_ice 
    9572#else 
     
    9976CONTAINS 
    10077   SUBROUTINE bdy_ice( kt )      ! Empty routine 
     78      WRITE(*,*) 'bdy_ice: You should not have seen this print! error?', kt 
    10179   END SUBROUTINE bdy_ice 
    10280#endif 
  • branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY/bdyini.F90

    r2093 r2168  
    1919   USE oce             ! ocean dynamics and tracers variables 
    2020   USE dom_oce         ! ocean space and time domain 
     21   USE obc_par         ! ocean open boundary conditions 
    2122   USE bdy_oce         ! unstructured open boundary conditions 
    2223   USE bdytides        ! tides at open boundaries initialization (tide_init routine) 
     
    3233 
    3334   !!---------------------------------------------------------------------- 
    34    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     35   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    3536   !! $Id$  
    3637   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    37    !!--------------------------------------------------------------------------------- 
    38  
     38   !!---------------------------------------------------------------------- 
    3939CONTAINS 
    4040    
     
    5050      !! 
    5151      !! ** Input   :  bdy_init.nc, input file for unstructured open boundaries 
    52       !! 
    5352      !!----------------------------------------------------------------------       
    5453      INTEGER ::   ii, ij, ik, igrd, ib, ir   ! dummy loop indices 
     
    5655      INTEGER ::   ib_len, ibr_max 
    5756      INTEGER ::   iw, ie, is, in  
    58       INTEGER ::   inum                 ! temporary logical unit 
    59       INTEGER ::   id_dummy             ! temporary integers 
     57      INTEGER ::   inum                 ! local logical unit 
     58      INTEGER ::   id_dummy             ! local integers 
    6059      INTEGER ::   igrd_start, igrd_end ! start and end of loops on igrd 
    6160      INTEGER, DIMENSION (2)             ::   kdimsz 
     
    6867      !! 
    6968      NAMELIST/nambdy/filbdy_mask, filbdy_data_T, filbdy_data_U, filbdy_data_V,          & 
    70          &            filbdy_data_bt_T, filbdy_data_bt_U, filbdy_data_bt_V,          & 
     69         &            filbdy_data_bt_T, filbdy_data_bt_U, filbdy_data_bt_V,              & 
    7170         &            ln_bdy_tides, ln_bdy_clim, ln_bdy_vol, ln_bdy_mask,                & 
    7271         &            ln_bdy_dyn_fla, ln_bdy_dyn_frs, ln_bdy_tra_frs,ln_bdy_ice_frs,     & 
    7372         &            nbdy_dta, nb_rimwidth, volbdy 
    74  
    7573      !!---------------------------------------------------------------------- 
    7674 
     
    7977      IF(lwp) WRITE(numout,*) '~~~~~~~~' 
    8078      ! 
    81       IF( jperio /= 0 ) CALL ctl_stop( 'Cyclic or symmetric,',   & 
    82            ' and unstructured open boundary condition are not compatible' ) 
    83  
    84 #if defined key_obc 
    85       CALL ctl_stop( 'Straight open boundaries,',   & 
    86            ' and unstructured open boundaries are not compatible' ) 
    87 #endif 
    88  
    89       ! Read namelist parameters 
     79      IF( jperio /= 0 )   CALL ctl_stop( 'Cyclic or symmetric,',   & 
     80         &                               ' and unstructured open boundary condition are not compatible' ) 
     81 
     82      IF( lk_obc      )   CALL ctl_stop( 'Straight open boundaries,',   & 
     83         &                               ' and unstructured open boundaries are not compatible' ) 
     84 
    9085      ! --------------------------- 
    91       REWIND( numnam ) 
     86      REWIND( numnam )                    ! Read namelist parameters 
    9287      READ  ( numnam, nambdy ) 
    9388 
    94       ! control prints 
     89      !                                   ! control prints 
    9590      IF(lwp) WRITE(numout,*) '         nambdy' 
    9691 
    97       ! Check nbdy_dta value 
     92      !                                         ! check type of data used (nbdy_dta value) 
    9893      IF(lwp) WRITE(numout,*) 'nbdy_dta =', nbdy_dta       
    99       IF(lwp) WRITE(numout,*) ' ' 
    100       SELECT CASE( nbdy_dta ) 
    101       CASE( 0 ) 
    102         IF(lwp) WRITE(numout,*) '         initial state used for bdy data'         
    103       CASE( 1 ) 
    104         IF(lwp) WRITE(numout,*) '         boundary data taken from file' 
    105       CASE DEFAULT 
    106         CALL ctl_stop( 'nbdy_dta must be 0 or 1' ) 
     94      IF(lwp) WRITE(numout,*) 
     95      SELECT CASE( nbdy_dta )                   !  
     96      CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for bdy data'         
     97      CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file' 
     98      CASE DEFAULT   ;   CALL ctl_stop( 'nbdy_dta must be 0 or 1' ) 
    10799      END SELECT 
    108100 
    109       IF(lwp) WRITE(numout,*) ' ' 
     101      IF(lwp) WRITE(numout,*) 
    110102      IF(lwp) WRITE(numout,*) 'Boundary rim width for the FRS nb_rimwidth = ', nb_rimwidth 
    111103 
    112       IF(lwp) WRITE(numout,*) ' ' 
    113       IF(lwp) WRITE(numout,*) '         volbdy = ', volbdy 
    114  
    115       IF (ln_bdy_vol) THEN 
    116         SELECT CASE ( volbdy ) ! Check volbdy value 
    117         CASE( 1 ) 
    118           IF(lwp) WRITE(numout,*) '         The total volume will be constant' 
    119         CASE( 0 ) 
    120           IF(lwp) WRITE(numout,*) '         The total volume will vary according' 
    121           IF(lwp) WRITE(numout,*) '         to the surface E-P flux' 
    122         CASE DEFAULT 
    123           CALL ctl_stop( 'volbdy must be 0 or 1' ) 
    124         END SELECT 
     104      IF(lwp) WRITE(numout,*) 
     105      IF(lwp) WRITE(numout,*) '      volbdy = ', volbdy 
     106 
     107      IF( ln_bdy_vol ) THEN                     ! check volume conservation (volbdy value) 
     108         SELECT CASE ( volbdy ) 
     109         CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      The total volume will be constant' 
     110         CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      The total volume will vary according to the surface E-P flux' 
     111         CASE DEFAULT   ;   CALL ctl_stop( 'volbdy must be 0 or 1' ) 
     112         END SELECT 
     113         IF(lwp) WRITE(numout,*) 
    125114      ELSE 
    126         IF(lwp) WRITE(numout,*) 'No volume correction with unstructured open boundaries' 
    127         IF(lwp) WRITE(numout,*) ' ' 
    128       ENDIF 
    129  
    130       IF (ln_bdy_tides) THEN 
    131         IF(lwp) WRITE(numout,*) ' ' 
     115         IF(lwp) WRITE(numout,*) 'No volume correction with unstructured open boundaries' 
     116         IF(lwp) WRITE(numout,*) 
     117      ENDIF 
     118 
     119      IF( ln_bdy_tides ) THEN 
    132120        IF(lwp) WRITE(numout,*) 'Tidal harmonic forcing at unstructured open boundaries' 
    133         IF(lwp) WRITE(numout,*) ' ' 
    134       ENDIF 
    135  
    136       IF (ln_bdy_dyn_fla) THEN 
    137         IF(lwp) WRITE(numout,*) ' ' 
     121        IF(lwp) WRITE(numout,*) 
     122      ENDIF 
     123 
     124      IF( ln_bdy_dyn_fla ) THEN 
    138125        IF(lwp) WRITE(numout,*) 'Flather condition on U, V at unstructured open boundaries' 
    139         IF(lwp) WRITE(numout,*) ' ' 
    140       ENDIF 
    141  
    142       IF (ln_bdy_dyn_frs) THEN 
    143         IF(lwp) WRITE(numout,*) ' ' 
     126        IF(lwp) WRITE(numout,*) 
     127      ENDIF 
     128 
     129      IF( ln_bdy_dyn_frs ) THEN 
    144130        IF(lwp) WRITE(numout,*) 'FRS condition on U and V at unstructured open boundaries' 
    145         IF(lwp) WRITE(numout,*) ' ' 
    146       ENDIF 
    147  
    148       IF (ln_bdy_tra_frs) THEN 
    149         IF(lwp) WRITE(numout,*) ' ' 
     131        IF(lwp) WRITE(numout,*) 
     132      ENDIF 
     133 
     134      IF( ln_bdy_tra_frs ) THEN 
    150135        IF(lwp) WRITE(numout,*) 'FRS condition on T & S fields at unstructured open boundaries' 
    151         IF(lwp) WRITE(numout,*) ' ' 
    152       ENDIF 
    153  
    154       IF (ln_bdy_ice_frs) THEN 
    155         IF(lwp) WRITE(numout,*) ' ' 
     136        IF(lwp) WRITE(numout,*) 
     137      ENDIF 
     138 
     139      IF( ln_bdy_ice_frs ) THEN 
    156140        IF(lwp) WRITE(numout,*) 'FRS condition on ice fields at unstructured open boundaries' 
    157         IF(lwp) WRITE(numout,*) ' ' 
    158       ENDIF 
    159  
    160       ! Read tides namelist  
    161       ! ------------------------ 
    162       IF( ln_bdy_tides )   CALL tide_init 
     141        IF(lwp) WRITE(numout,*) 
     142      ENDIF 
     143 
     144      IF( ln_bdy_tides )   CALL tide_init      ! Read tides namelist  
     145 
    163146 
    164147      ! Read arrays defining unstructured open boundaries 
     
    170153      !          = 0  elsewhere    
    171154  
    172       IF( cp_cfg == "eel" .AND. jp_cfg == 5 ) THEN 
     155      IF( cp_cfg == "eel" .AND. jp_cfg == 5 ) THEN          ! EEL configuration at 5km resolution 
    173156         zmask(         :                ,:) = 0.e0 
    174157         zmask(jpizoom+1:jpizoom+jpiglo-2,:) = 1.e0           
    175       ELSE IF ( ln_bdy_mask ) THEN 
     158      ELSE IF( ln_bdy_mask ) THEN 
    176159         CALL iom_open( filbdy_mask, inum ) 
    177160         CALL iom_get ( inum, jpdom_data, 'bdy_msk', zmask(:,:) ) 
     
    181164      ENDIF 
    182165 
    183       ! Save mask over local domain       
    184       DO ij = 1, nlcj 
     166      DO ij = 1, nlcj      ! Save mask over local domain       
    185167         DO ii = 1, nlci 
    186168            bdytmask(ii,ij) = zmask( mig(ii), mjg(ij) ) 
     
    197179         END DO 
    198180      END DO 
    199  
    200       ! Lateral boundary conditions 
    201       CALL lbc_lnk( bdyumask(:,:), 'U', 1. ) 
    202       CALL lbc_lnk( bdyvmask(:,:), 'V', 1. ) 
     181      CALL lbc_lnk( bdyumask(:,:), 'U', 1. )   ;   CALL lbc_lnk( bdyvmask(:,:), 'V', 1. )      ! Lateral boundary cond. 
     182 
    203183 
    204184      ! Read discrete distance and mapping indices 
     
    210190      IF( cp_cfg == "eel" .AND. jp_cfg == 5 ) THEN 
    211191         icount = 0 
    212          ! Define west boundary (from ii=2 to ii=1+nb_rimwidth): 
    213          DO ir = 1, nb_rimwidth          
     192         DO ir = 1, nb_rimwidth                  ! Define west boundary (from ii=2 to ii=1+nb_rimwidth): 
    214193            DO ij = 3, jpjglo-2 
    215                icount=icount+1 
     194               icount = icount + 1 
    216195               nbidta(icount,:) = ir + 1 + (jpizoom-1) 
    217                nbjdta(icount,:) = ij + (jpjzoom-1)  
     196               nbjdta(icount,:) = ij     + (jpjzoom-1)  
    218197               nbrdta(icount,:) = ir 
    219198            END DO 
    220199         END DO 
    221  
    222          ! Define east boundary (from ii=jpiglo-1 to ii=jpiglo-nb_rimwidth): 
    223          DO ir=1,nb_rimwidth          
     200         ! 
     201         DO ir = 1, nb_rimwidth                  ! Define east boundary (from ii=jpiglo-1 to ii=jpiglo-nb_rimwidth): 
    224202            DO ij=3,jpjglo-2 
    225                icount=icount+1 
     203               icount = icount + 1 
    226204               nbidta(icount,:) = jpiglo-ir + (jpizoom-1) 
    227205               nbidta(icount,2) = jpiglo-ir-1 + (jpizoom-1) ! special case for u points 
     
    230208            END DO 
    231209         END DO 
    232              
     210         !        
    233211      ELSE            ! Read indices and distances in unstructured boundary data files  
    234  
    235          IF( ln_bdy_tides ) THEN  
    236             ! Read tides input files for preference in case there are 
    237             ! no bdydata files.  
     212         ! 
     213         IF( ln_bdy_tides ) THEN             ! Read tides input files for preference in case there are no bdydata files 
    238214            clfile(4) = TRIM(filtide)//TRIM(tide_cpt(1))//'_grid_T.nc' 
    239215            clfile(5) = TRIM(filtide)//TRIM(tide_cpt(1))//'_grid_U.nc' 
    240216            clfile(6) = TRIM(filtide)//TRIM(tide_cpt(1))//'_grid_V.nc' 
    241217         ENDIF 
    242          IF( ln_bdy_dyn_fla .and. .not. ln_bdy_tides ) THEN  
     218         IF( ln_bdy_dyn_fla .AND. .NOT. ln_bdy_tides ) THEN  
    243219            clfile(4) = filbdy_data_bt_T 
    244220            clfile(5) = filbdy_data_bt_U 
     
    248224         IF( ln_bdy_tra_frs ) THEN  
    249225            clfile(1) = filbdy_data_T 
    250             IF( .not. ln_bdy_dyn_frs ) THEN  
    251                clfile(2) = filbdy_data_T  ! Dummy read re read T file for sake of 6 files 
    252                clfile(3) = filbdy_data_T  ! 
     226            IF( .NOT. ln_bdy_dyn_frs ) THEN  
     227               clfile(2) = filbdy_data_T     ! Dummy read re read T file for sake of 6 files 
     228               clfile(3) = filbdy_data_T     ! 
    253229            ENDIF 
    254230         ENDIF           
    255231         IF( ln_bdy_dyn_frs ) THEN  
    256             IF( .not. ln_bdy_tra_frs ) THEN  
    257                clfile(1) = filbdy_data_U ! Dummy Read  
    258             ENDIF 
     232            IF( .NOT. ln_bdy_tra_frs )   clfile(1) = filbdy_data_U      ! Dummy Read  
    259233            clfile(2) = filbdy_data_U 
    260234            clfile(3) = filbdy_data_V  
    261235         ENDIF 
    262236 
    263          ! how many files are we to read in? 
    264          IF(ln_bdy_tides .or. ln_bdy_dyn_fla) then 
    265              igrd_start = 4 
     237         !                                   ! how many files are we to read in? 
     238         IF(ln_bdy_tides .OR. ln_bdy_dyn_fla)   igrd_start = 4 
     239         ! 
     240         IF(ln_bdy_tra_frs    ) THEN   ;   igrd_start = 1 
     241         ELSEIF(ln_bdy_dyn_frs) THEN   ;   igrd_start = 2 
    266242         ENDIF 
    267  
    268          IF(ln_bdy_tra_frs) then 
    269              igrd_start = 1 
    270          ELSEIF(ln_bdy_dyn_frs) then 
    271              igrd_start = 2 
    272          ENDIF 
    273  
    274          IF( ln_bdy_tra_frs ) then 
    275              igrd_end = 1 
    276          ENDIF 
    277  
    278          IF(ln_bdy_dyn_fla .or. ln_bdy_tides) THEN 
    279              igrd_end = 6 
    280          ELSEIF( ln_bdy_dyn_frs) THEN 
    281              igrd_end = 3 
     243         ! 
     244         IF( ln_bdy_tra_frs   )   igrd_end = 1 
     245         ! 
     246         IF(ln_bdy_dyn_fla .OR. ln_bdy_tides) THEN   ;   igrd_end = 6 
     247         ELSEIF( ln_bdy_dyn_frs             ) THEN   ;   igrd_end = 3 
    282248         ENDIF 
    283249 
     
    287253            IF(lwp) WRITE(numout,*) 'kdimsz : ',kdimsz 
    288254            ib_len = kdimsz(1) 
    289             IF( ib_len > jpbdta) CALL ctl_stop(          & 
    290                 'Boundary data array in file too long.', & 
    291                 'File :', TRIM(clfile(igrd)),            & 
    292                 'increase parameter jpbdta.' ) 
     255            IF( ib_len > jpbdta)   CALL ctl_stop(  'Boundary data array in file too long.',                  & 
     256                &                                  'File :', TRIM(clfile(igrd)),'increase parameter jpbdta.' ) 
    293257 
    294258            CALL iom_get( inum, jpdom_unknown, 'nbidta', zdta(1:ib_len,:) ) 
     
    298262            CALL iom_get( inum, jpdom_unknown, 'nbjdta', zdta(1:ib_len,:) ) 
    299263            DO ii = 1,ib_len 
    300               nbjdta(ii,igrd) = INT( zdta(ii,1) ) 
    301             END DO 
    302             CALL iom_get ( inum, jpdom_unknown, 'nbrdta', zdta(1:ib_len,:) ) 
     264               nbjdta(ii,igrd) = INT( zdta(ii,1) ) 
     265            END DO 
     266            CALL iom_get( inum, jpdom_unknown, 'nbrdta', zdta(1:ib_len,:) ) 
    303267            DO ii = 1,ib_len 
    304               nbrdta(ii,igrd) = INT( zdta(ii,1) ) 
     268               nbrdta(ii,igrd) = INT( zdta(ii,1) ) 
    305269            END DO 
    306270            CALL iom_close( inum ) 
    307271 
    308             ! Check that rimwidth in file is big enough for Frs case(barotropic is one): 
    309             IF( igrd < 4) then 
    310                 ibr_max = MAXVAL( nbrdta(:,igrd) ) 
    311                 IF(lwp) WRITE(numout,*) 
    312                 IF(lwp) WRITE(numout,*) ' Maximum rimwidth in file is ', ibr_max 
    313                 IF(lwp) WRITE(numout,*) ' nb_rimwidth from namelist is ', nb_rimwidth 
    314                 IF (ibr_max < nb_rimwidth) CALL ctl_stop( & 
    315                     'nb_rimwidth is larger than maximum rimwidth in file' ) 
     272            IF( igrd < 4) THEN            ! Check that rimwidth in file is big enough for Frs case(barotropic is one): 
     273               ibr_max = MAXVAL( nbrdta(:,igrd) ) 
     274               IF(lwp) WRITE(numout,*) 
     275               IF(lwp) WRITE(numout,*) ' Maximum rimwidth in file is ', ibr_max 
     276               IF(lwp) WRITE(numout,*) ' nb_rimwidth from namelist is ', nb_rimwidth 
     277               IF (ibr_max < nb_rimwidth)   CALL ctl_stop( 'nb_rimwidth is larger than maximum rimwidth in file' ) 
    316278            ENDIF !Check igrd < 4 
    317279            ! 
     
    329291 
    330292      DO igrd = igrd_start, igrd_end 
    331         icount  = 0 
    332         icountr = 0 
    333         nblen(igrd) = 0 
    334         nblenrim(igrd) = 0 
    335         nblendta(igrd) = 0 
    336         DO ir=1, nb_rimwidth 
    337           DO ib = 1, jpbdta 
    338           ! check if point is in local domain and equals ir 
    339             IF(  nbidta(ib,igrd) >= iw .AND. nbidta(ib,igrd) <= ie .AND.   & 
    340                & nbjdta(ib,igrd) >= is .AND. nbjdta(ib,igrd) <= in .AND.   & 
    341                & nbrdta(ib,igrd) == ir  ) THEN 
    342                ! 
    343                icount = icount  + 1 
    344                ! 
    345                IF( ir == 1 )   icountr = icountr+1 
     293         icount  = 0 
     294         icountr = 0 
     295         nblen   (igrd) = 0 
     296         nblenrim(igrd) = 0 
     297         nblendta(igrd) = 0 
     298         DO ir=1, nb_rimwidth 
     299            DO ib = 1, jpbdta 
     300               ! check if point is in local domain and equals ir 
     301               IF(  nbidta(ib,igrd) >= iw .AND. nbidta(ib,igrd) <= ie .AND.   & 
     302                  & nbjdta(ib,igrd) >= is .AND. nbjdta(ib,igrd) <= in .AND.   & 
     303                  & nbrdta(ib,igrd) == ir  ) THEN 
     304                  ! 
     305                  icount = icount  + 1 
     306                  ! 
     307                  IF( ir == 1 )   icountr = icountr+1 
    346308                  IF (icount > jpbdim) THEN 
    347309                     IF(lwp) WRITE(numout,*) 'bdy_ini: jpbdim too small' 
     
    364326      DO igrd = igrd_start, igrd_end 
    365327         DO ib = 1, nblen(igrd) 
    366             ! tanh formulation 
    367             nbw(ib,igrd) = 1.- TANH( FLOAT( nbr(ib,igrd) - 1 ) *0.5 ) 
    368             ! quadratic 
    369 !           nbw(ib,igrd) = (FLOAT(nb_rimwidth+1-nbr(ib,igrd))/FLOAT(nb_rimwidth))**2 
    370             ! linear 
    371 !           nbw(ib,igrd) =  FLOAT(nb_rimwidth+1-nbr(ib,igrd))/FLOAT(nb_rimwidth) 
     328            nbw(ib,igrd) = 1.- TANH( FLOAT( nbr(ib,igrd) - 1 ) *0.5 )                     ! tanh formulation 
     329!           nbw(ib,igrd) = (FLOAT(nb_rimwidth+1-nbr(ib,igrd))/FLOAT(nb_rimwidth))**2      ! quadratic 
     330!           nbw(ib,igrd) =  FLOAT(nb_rimwidth+1-nbr(ib,igrd))/FLOAT(nb_rimwidth)          ! linear 
    372331         END DO 
    373332      END DO  
     
    420379 
    421380      ! Lateral boundary conditions 
    422       CALL lbc_lnk( fmask        , 'F', 1. ) 
    423       CALL lbc_lnk( bdytmask(:,:), 'T', 1. ) 
    424       CALL lbc_lnk( bdyumask(:,:), 'U', 1. ) 
    425       CALL lbc_lnk( bdyvmask(:,:), 'V', 1. ) 
     381      CALL lbc_lnk( fmask        , 'F', 1. )   ;   CALL lbc_lnk( bdytmask(:,:), 'T', 1. ) 
     382      CALL lbc_lnk( bdyumask(:,:), 'U', 1. )   ;   CALL lbc_lnk( bdyvmask(:,:), 'V', 1. ) 
    426383 
    427384      IF( ln_bdy_vol .OR. ln_bdy_dyn_fla ) THEN      ! Indices and directions of rim velocity components 
     
    473430      ! Compute total lateral surface for volume correction: 
    474431      ! ---------------------------------------------------- 
    475   
    476432      bdysurftot = 0.e0  
    477433      IF( ln_bdy_vol ) THEN   
     
    491447               &                    * tmask_i(nbi(ib,igrd),nbj(ib,igrd)+1) 
    492448         END DO 
    493  
     449         ! 
    494450         IF( lk_mpp )   CALL mpp_sum( bdysurftot )      ! sum over the global domain 
    495451      END IF    
  • branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY/bdytides.F90

    r2093 r2168  
    4141   PUBLIC   tide_update   ! routine called in bdydyn 
    4242 
    43    LOGICAL, PUBLIC            ::   ln_tide_date            !: =T correct tide phases and amplitude for model start date 
    44  
    45    INTEGER, PARAMETER,PUBLIC  ::   jptides_max = 15      !: Max number of tidal contituents 
     43   LOGICAL, PUBLIC            ::   ln_tide_date          !: =T correct tide phases and amplitude for model start date 
     44   INTEGER, PUBLIC, PARAMETER ::   jptides_max = 15      !: Max number of tidal contituents 
    4645   INTEGER, PUBLIC            ::   ntide                 !: Actual number of tidal constituents 
    4746 
     
    4948   CHARACTER(len= 4), PUBLIC, DIMENSION(jptides_max) ::   tide_cpt   !: Names of tidal components used. 
    5049 
    51    INTEGER , DIMENSION(jptides_max), PUBLIC ::   nindx        !: ??? 
    52    REAL(wp), DIMENSION(jptides_max), PUBLIC ::   tide_speed   !: Phase speed of tidal constituent (deg/hr) 
     50   INTEGER , PUBLIC, DIMENSION(jptides_max) ::   nindx        !: ??? 
     51   REAL(wp), PUBLIC, DIMENSION(jptides_max) ::   tide_speed   !: Phase speed of tidal constituent (deg/hr) 
    5352    
    54    REAL(wp), DIMENSION(jpbdim,jptides_max)  ::   ssh1, ssh2   !: Tidal constituents : SSH 
    55    REAL(wp), DIMENSION(jpbdim,jptides_max)  ::   u1  , u2     !: Tidal constituents : U 
    56    REAL(wp), DIMENSION(jpbdim,jptides_max)  ::   v1  , v2     !: Tidal constituents : V 
     53   REAL(wp), DIMENSION(jpbdim,jptides_max)  ::   ssh1, ssh2   ! Tidal constituents : SSH 
     54   REAL(wp), DIMENSION(jpbdim,jptides_max)  ::   u1  , u2     ! Tidal constituents : U 
     55   REAL(wp), DIMENSION(jpbdim,jptides_max)  ::   v1  , v2     ! Tidal constituents : V 
    5756    
    5857   !!---------------------------------------------------------------------- 
    59    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     58   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    6059   !! $Id$  
    6160   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    6261   !!---------------------------------------------------------------------- 
    63  
    6462CONTAINS 
    6563 
     
    8886      READ  ( numnam, nambdy_tide ) 
    8987      !                                               ! Count number of components specified 
    90       ntide=jptides_max 
    91       do itide = 1, jptides_max 
    92         if ( tide_cpt(itide) == '' ) then 
     88      ntide = jptides_max 
     89      DO itide = 1, jptides_max 
     90        IF( tide_cpt(itide) == '' ) THEN 
    9391           ntide = itide-1 
    9492           exit 
    95         endif 
    96       enddo 
     93        ENDIF 
     94      END DO 
    9795 
    9896      !                                               ! find constituents in standard list 
  • branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY/bdytra.F90

    r1146 r2168  
    2525 
    2626   !!---------------------------------------------------------------------- 
    27    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     27   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    2828   !! $Id$  
    2929   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    3030   !!---------------------------------------------------------------------- 
    31  
    3231CONTAINS 
    3332 
     
    4847      !!---------------------------------------------------------------------- 
    4948      ! 
    50       IF(ln_bdy_tra_frs) THEN ! If this is false, then this routine does nothing.  
    51  
    52       IF( kt == nit000 ) THEN 
    53          IF(lwp) WRITE(numout,*) 
    54          IF(lwp) WRITE(numout,*) 'bdy_tra : Flow Relaxation Scheme for tracers' 
    55          IF(lwp) WRITE(numout,*) '~~~~~~~' 
    56       ENDIF 
     49      IF(ln_bdy_tra_frs) THEN       ! If this is false, then this routine does nothing.  
     50         ! 
     51         IF( kt == nit000 ) THEN 
     52            IF(lwp) WRITE(numout,*) 
     53            IF(lwp) WRITE(numout,*) 'bdy_tra : Flow Relaxation Scheme for tracers' 
     54            IF(lwp) WRITE(numout,*) '~~~~~~~' 
     55         ENDIF 
     56         ! 
     57         igrd = 1                       ! Everything is at T-points here 
     58         DO ib = 1, nblen(igrd) 
     59            DO ik = 1, jpkm1 
     60               ii = nbi(ib,igrd) 
     61               ij = nbj(ib,igrd) 
     62               zwgt = nbw(ib,igrd) 
     63               ta(ii,ij,ik) = ( ta(ii,ij,ik) * (1.-zwgt) + tbdy(ib,ik) * zwgt ) * tmask(ii,ij,ik)          
     64               sa(ii,ij,ik) = ( sa(ii,ij,ik) * (1.-zwgt) + sbdy(ib,ik) * zwgt ) * tmask(ii,ij,ik) 
     65            END DO 
     66         END DO  
     67         ! 
     68         CALL lbc_lnk( ta, 'T', 1. )   ; CALL lbc_lnk( sa, 'T', 1. )    ! Boundary points should be updated 
     69         ! 
     70      ENDIF ! ln_bdy_tra_frs 
    5771      ! 
    58       igrd = 1                       ! Everything is at T-points here 
    59       DO ib = 1, nblen(igrd) 
    60          DO ik = 1, jpkm1 
    61             ii = nbi(ib,igrd) 
    62             ij = nbj(ib,igrd) 
    63             zwgt = nbw(ib,igrd) 
    64             ta(ii,ij,ik) = ( ta(ii,ij,ik) * (1.-zwgt) + tbdy(ib,ik) * zwgt ) * tmask(ii,ij,ik)          
    65             sa(ii,ij,ik) = ( sa(ii,ij,ik) * (1.-zwgt) + sbdy(ib,ik) * zwgt ) * tmask(ii,ij,ik) 
    66         END DO 
    67       END DO  
    68       ! 
    69       CALL lbc_lnk( ta, 'T', 1. )   ! Boundary points should be updated 
    70       CALL lbc_lnk( sa, 'T', 1. )   ! 
    71       ! 
    72       ENDIF ! ln_bdy_tra_frs 
    73  
    7472   END SUBROUTINE bdy_tra 
    7573    
  • branches/DEV_r1986_BDY_updates/NEMO/OPA_SRC/BDY/bdyvol.F90

    r1739 r2168  
    1111#if   defined key_bdy   &&   defined key_dynspg_flt 
    1212   !!---------------------------------------------------------------------- 
    13    !!   'key_bdy'            and      unstructured open boundary conditions 
     13   !!   'key_bdy'            AND      unstructured open boundary conditions 
    1414   !!   'key_dynspg_flt'                              filtered free surface 
    1515   !!---------------------------------------------------------------------- 
     
    3030#  include "domzgr_substitute.h90" 
    3131   !!---------------------------------------------------------------------- 
    32    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     32   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    3333   !! $Id$  
    3434   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    3535   !!---------------------------------------------------------------------- 
    36  
    3736CONTAINS 
    3837 
     
    7372      INTEGER  ::   ji, jj, jk, jb, jgrd 
    7473      INTEGER  ::   ii, ij 
    75       REAL(wp) ::   zubtpecor, z_cflxemp, ztranst, zraur 
     74      REAL(wp) ::   zubtpecor, z_cflxemp, ztranst 
    7675      !!----------------------------------------------------------------------------- 
    7776 
     
    8584      ! ----------------------------------------------------------------------- 
    8685      z_cflxemp = 0.e0 
    87       zraur = 1.e0 / rau0 
    88       z_cflxemp = SUM ( emp(:,:) * bdytmask(:,:) * e1t(:,:) * e2t(:,:) * zraur ) 
    89       IF( lk_mpp )   CALL mpp_sum( z_cflxemp )   ! sum over the global domain 
     86      z_cflxemp = SUM ( emp(:,:) * bdytmask(:,:) * e1t(:,:) * e2t(:,:) ) / rau0 
     87      IF( lk_mpp )   CALL mpp_sum( z_cflxemp )     ! sum over the global domain 
    9088 
    91       ! Barotropic velocity through the unstructured open boundary 
    92       ! ---------------------------------------------------------- 
     89      ! Transport through the unstructured open boundary 
     90      ! ------------------------------------------------ 
    9391      zubtpecor = 0.e0 
    9492      jgrd = 2                               ! cumulate u component contribution first  
     
    112110      ! The normal velocity correction 
    113111      ! ------------------------------ 
    114       IF (volbdy==1) THEN   ;   zubtpecor = ( zubtpecor - z_cflxemp) / bdysurftot  
    115       ELSE                  ;   zubtpecor =   zubtpecor             / bdysurftot 
     112      IF( volbdy==1 ) THEN   ;   zubtpecor = ( zubtpecor - z_cflxemp) / bdysurftot  
     113      ELSE                   ;   zubtpecor =   zubtpecor             / bdysurftot 
    116114      END IF 
    117115 
     
    141139      ! Check the cumulated transport through unstructured OBC once barotropic velocities corrected 
    142140      ! ------------------------------------------------------ 
    143  
    144141      IF( lwp .AND. MOD( kt, nwrite ) == 0) THEN 
    145142         IF(lwp) WRITE(numout,*) 
Note: See TracChangeset for help on using the changeset viewer.