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 1566 – NEMO

Changeset 1566


Ignore:
Timestamp:
2009-07-31T16:34:08+02:00 (15 years ago)
Author:
rblod
Message:

Cosmetic changes: suppress useless variables and code review of the code changed when suppressing rigid-lid, see ticket #508

Location:
trunk/NEMO/OPA_SRC
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DOM/domcfg.F90

    r1528 r1566  
    44   !! Ocean initialization : domain configuration initialization 
    55   !!============================================================================== 
     6   !! History :  1.0  ! 2003-09  (G. Madec)  Original code 
     7   !!            3.2  ! 2009-07  (R. Benshila) Suppression of rigid-lid option 
     8   !!---------------------------------------------------------------------- 
    69 
    710   !!---------------------------------------------------------------------- 
    811   !!   dom_cfg        : initialize the domain configuration 
    912   !!---------------------------------------------------------------------- 
    10    !! * Modules used 
    1113   USE dom_oce         ! ocean space and time domain 
    1214   USE phycst          ! physical constants 
     
    1719   PRIVATE 
    1820 
    19    !! * Routine accessibility 
    20    PUBLIC dom_cfg        ! called by opa.F90 
     21   PUBLIC   dom_cfg    ! called by opa.F90 
     22 
    2123   !!---------------------------------------------------------------------- 
    22    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     24   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009) 
    2325   !! $Id$  
    24    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     26   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
    2527   !!---------------------------------------------------------------------- 
    2628 
     
    3335      !! ** Purpose :   set the domain configuration 
    3436      !! 
    35       !! ** Method  : 
    36       !! 
    37       !! History : 
    38       !!   9.0  !  03-09  (G. Madec)  Original code 
    39       !!---------------------------------------------------------------------- 
    40       !! * Local declarations 
    4137      !!---------------------------------------------------------------------- 
    4238 
    43       IF(lwp) THEN 
     39      IF(lwp) THEN                   ! Control print 
    4440         WRITE(numout,*) 
    4541         WRITE(numout,*) 'dom_cfg : set the ocean configuration' 
    46          WRITE(numout,*) '~~~~~~~      ocean model configuration used :',   & 
    47             &                             ' cp_cfg = ', cp_cfg, ' jp_cfg = ', jp_cfg 
     42         WRITE(numout,*) '~~~~~~~ ' 
     43         WRITE(numout,*) '   ocean model configuration used :   cp_cfg = ', cp_cfg, ' jp_cfg = ', jp_cfg 
     44         ! 
     45         WRITE(numout,*) '   global domain lateral boundaries' 
     46         ! 
     47         IF( jperio == 0 )   WRITE(numout,*) '      jperio= 0, closed' 
     48         IF( jperio == 1 )   WRITE(numout,*) '      jperio= 1, cyclic east-west' 
     49         IF( jperio == 2 )   WRITE(numout,*) '      jperio= 2, equatorial symmetric' 
     50         IF( jperio == 3 )   WRITE(numout,*) '      jperio= 3, north fold with T-point pivot' 
     51         IF( jperio == 4 )   WRITE(numout,*) '      jperio= 4, cyclic east-west and north fold with T-point pivot' 
     52         IF( jperio == 5 )   WRITE(numout,*) '      jperio= 5, north fold with F-point pivot' 
     53         IF( jperio == 6 )   WRITE(numout,*) '      jperio= 6, cyclic east-west and north fold with F-point pivot' 
    4854      ENDIF 
    49  
    50       ! Global domain boundary conditions 
    51       ! --------------------------------- 
    52       IF(lwp) THEN 
    53          WRITE(numout,*) '          global domain lateral boundaries' 
    54  
    55          IF( jperio == 0 ) WRITE(numout,*) '             jperio= 0, closed' 
    56          IF( jperio == 1 ) WRITE(numout,*) '             jperio= 1, cyclic east-west' 
    57          IF( jperio == 2 ) WRITE(numout,*) '             jperio= 2, equatorial symmetric' 
    58          IF( jperio == 3 ) WRITE(numout,*) '             jperio= 3, north fold with T-point pivot' 
    59          IF( jperio == 4 ) WRITE(numout,*) '             jperio= 4, cyclic east-west and',   & 
    60                                                                   ' north fold with T-point pivot' 
    61          IF( jperio == 5 ) WRITE(numout,*) '             jperio= 5, north fold with F-point pivot' 
    62          IF( jperio == 6 ) WRITE(numout,*) '             jperio= 6, cyclic east-west and',   & 
    63                                                                   ' north fold with F-point pivot' 
    64       ENDIF 
    65       IF( jperio <  0 .OR. jperio > 6 ) CALL ctl_stop( 'jperio is out of range' ) 
    66  
    67       ! global domain versus zoom and/or local domain 
    68       ! --------------------------------------------- 
    69  
    70       CALL dom_glo  
    71  
     55      ! 
     56      IF( jperio <  0 .OR. jperio > 6 )   CALL ctl_stop( 'jperio is out of range' ) 
     57      ! 
     58      CALL dom_glo                   ! global domain versus zoom and/or local domain 
     59      ! 
    7260   END SUBROUTINE dom_cfg 
    7361 
     
    8472      !!              - mi0  , mi1   : 
    8573      !!              - mj0, , mj1   : 
    86       !! 
    87       !! History : 
    88       !!   8.5  !  02-08  (G. Madec)    Original code 
    8974      !!---------------------------------------------------------------------- 
    90       !! * Local declarations 
    91       INTEGER ::   ji, jj            ! dummy loop argument 
     75      INTEGER ::   ji, jj   ! dummy loop argument 
    9276      !!---------------------------------------------------------------------- 
    9377 
    94       ! Local domain  
    95       ! ============ 
    96  
    97       ! local domain indices ==> data domain indices 
    98       DO ji = 1, jpi 
     78      !                        ! ============== ! 
     79      !                        !  Local domain  !  
     80      !                        ! ============== ! 
     81      DO ji = 1, jpi                 ! local domain indices ==> data domain indices 
    9982        mig(ji) = ji + jpizoom - 1 + nimpp - 1 
    10083      END DO 
     
    10285        mjg(jj) = jj + jpjzoom - 1 + njmpp - 1 
    10386      END DO 
    104  
    105       ! data domain indices ==> local domain indices 
    106       ! (return (m.0,m.1)=(1,0) if data domain gridpoint is to the west/south of the  
    107       ! local domain, or (m.0,m.1)=(jp.+1,jp.) to the east/north of local domain.  
     87      ! 
     88      !                              ! data domain indices ==> local domain indices 
     89      !                                   ! (return (m.0,m.1)=(1,0) if data domain gridpoint is to the west/south of the  
     90      !                                   !local domain, or (m.0,m.1)=(jp.+1,jp.) to the east/north of local domain.  
    10891      DO ji = 1, jpidta 
    10992        mi0(ji) = MAX( 1, MIN( ji - jpizoom + 1 - nimpp + 1, jpi+1 ) ) 
     
    11598      END DO 
    11699 
    117       IF(lwp) THEN 
     100      IF(lwp) THEN                   ! control print 
    118101         WRITE(numout,*) 
    119102         WRITE(numout,*) 'dom_glo : domain: data / local ' 
     
    149132 25   FORMAT( 100(10x,19i4,/) ) 
    150133 
    151       ! Zoom domain 
    152       ! =========== 
    153  
    154       ! zoom control 
     134      !                        ! ============== ! 
     135      !                        !  Zoom domain   ! 
     136      !                        ! ============== ! 
     137      !                              ! zoom control 
    155138      IF( jpiglo + jpizoom - 1  >  jpidta .OR.   & 
    156139          jpjglo + jpjzoom - 1  >  jpjdta      ) & 
    157140          &   CALL ctl_stop( ' global or zoom domain exceed the data domain ! ' ) 
    158141 
    159       ! set zoom flag 
    160       IF ( jpiglo < jpidta .OR. jpjglo < jpjdta )   lzoom = .TRUE. 
     142      !                              ! set zoom flag 
     143      IF( jpiglo < jpidta .OR. jpjglo < jpjdta )   lzoom = .TRUE. 
    161144 
    162       ! set zoom type flags 
     145      !                              ! set zoom type flags 
    163146      IF( lzoom .AND. jpizoom /= 1 )   lzoom_w = .TRUE.                     !  
    164147      IF( lzoom .AND. jpjzoom /= 1 )   lzoom_s = .TRUE. 
     
    180163           &   CALL ctl_stop( ' Your zoom choice is inconsistent with North fold boundary condition' ) 
    181164 
    182       ! Pre-defined arctic/antarctic zoom of ORCA configuration flag 
     165      !                              ! Pre-defined arctic/antarctic zoom of ORCA configuration flag 
    183166      IF( cp_cfg == "orca" ) THEN 
    184167         SELECT CASE ( jp_cfg ) 
    185          !                                        ! ======================= 
    186168         CASE ( 2 )                               !  ORCA_R2 configuration 
    187             !                                     ! ======================= 
    188169            IF(  jpiglo  == 142    .AND. jpjglo  ==  53 .AND.   & 
    189170               & jpizoom ==  21    .AND. jpjzoom ==  97         )   lzoom_arct = .TRUE. 
    190171            IF(  jpiglo  == jpidta .AND. jpjglo  ==  50 .AND.   & 
    191172               & jpizoom ==   1    .AND. jpjzoom ==   1         )   lzoom_anta = .TRUE. 
    192             !                                     ! ======================= 
     173            !                              
    193174         CASE ( 05 )                              !  ORCA_R05 configuration 
    194             !                                     ! ======================= 
    195175            IF(  jpiglo  == 562    .AND. jpjglo  == 202 .AND.   & 
    196176               & jpizoom ==  81    .AND. jpjzoom == 301         )   lzoom_arct = .TRUE. 
     
    204184         ! 
    205185      ENDIF 
    206           
     186      ! 
    207187   END SUBROUTINE dom_glo 
    208188 
  • trunk/NEMO/OPA_SRC/DOM/dommsk.F90

    r1528 r1566  
    11MODULE dommsk 
    2    !!============================================================================== 
     2   !!====================================================================== 
    33   !!                       ***  MODULE dommsk   *** 
    44   !! Ocean initialization : domain land/sea mask  
    5    !!============================================================================== 
     5   !!====================================================================== 
     6   !! History :  OPA  ! 1987-07  (G. Madec)  Original code 
     7   !!             -   ! 1993-03  (M. Guyon)  symetrical conditions (M. Guyon) 
     8   !!             -   ! 1996-01  (G. Madec)  suppression of common work arrays 
     9   !!             -   ! 1996-05  (G. Madec)  mask computed from tmask and sup- 
     10   !!                 !                      pression of the double computation of bmask 
     11   !!             -   ! 1997-02  (G. Madec)  mesh information put in domhgr.F 
     12   !!             -   ! 1997-07  (G. Madec)  modification of mbathy and fmask 
     13   !!             -   ! 1998-05  (G. Roullet)  free surface 
     14   !!             -   ! 2000-03  (G. Madec)  no slip accurate 
     15   !!             -   ! 2001-09  (J.-M. Molines)  Open boundaries 
     16   !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90: Free form and module 
     17   !!             -   ! 2005-11  (V. Garnier) Surface pressure gradient organization 
     18   !!            3.2  ! 2009-07  (R. Benshila) Suppression of rigid-lid option 
     19   !!---------------------------------------------------------------------- 
    620 
    721   !!---------------------------------------------------------------------- 
    822   !!   dom_msk        : compute land/ocean mask 
    9    !!   dom_msk_nsa    : update land/ocean mask when no-slip accurate 
    10    !!                    option is used. 
    11    !!---------------------------------------------------------------------- 
    12    !! * Modules used 
     23   !!   dom_msk_nsa    : update land/ocean mask when no-slip accurate option is used. 
     24   !!---------------------------------------------------------------------- 
    1325   USE oce             ! ocean dynamics and tracers 
    1426   USE dom_oce         ! ocean space and time domain 
     
    2234   PRIVATE 
    2335 
    24    !! * Routine accessibility 
    25    PUBLIC dom_msk        ! routine called by inidom.F90 
    26  
    27    !! * Module variables 
    28    REAL(wp) ::   & 
    29       shlat = 2.   ! type of lateral boundary condition on velocity (namelist namlbc) 
     36   PUBLIC   dom_msk    ! routine called by inidom.F90 
     37 
     38   REAL(wp) ::   shlat = 2.   ! type of lateral boundary condition on velocity (namelist namlbc) 
    3039    
    3140   !! * Substitutions 
    3241#  include "vectopt_loop_substitute.h90" 
    33    !!--------------------------------------------------------------------------------- 
    34    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     42   !!---------------------------------------------------------------------- 
     43   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009) 
    3544   !! $Id$  
    36    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    37    !!--------------------------------------------------------------------------------- 
     45   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
     46   !!---------------------------------------------------------------------- 
    3847 
    3948CONTAINS 
     
    93102      !!      (note that the minimum value of mbathy is 2). 
    94103      !! 
    95       !! ** Action : 
    96       !!                     tmask    : land/ocean mask at t-point (=0. or 1.) 
    97       !!                     umask    : land/ocean mask at u-point (=0. or 1.) 
    98       !!                     vmask    : land/ocean mask at v-point (=0. or 1.) 
    99       !!                     fmask    : land/ocean mask at f-point (=0. or 1.) 
     104      !! ** Action :   tmask    : land/ocean mask at t-point (=0. or 1.) 
     105      !!               umask    : land/ocean mask at u-point (=0. or 1.) 
     106      !!               vmask    : land/ocean mask at v-point (=0. or 1.) 
     107      !!               fmask    : land/ocean mask at f-point (=0. or 1.) 
    100108      !!                          =shlat along lateral boundaries 
    101       !!                     bmask    : land/ocean mask at barotropic stream 
    102       !!                          function point (=0. or 1.) and set to 
    103       !!                          0 along lateral boundaries 
    104       !!                   mbathy   : number of non-zero w-levels  
    105       !! 
    106       !! History : 
    107       !!        !  87-07  (G. Madec)  Original code 
    108       !!        !  91-12  (G. Madec) 
    109       !!        !  92-06  (M. Imbard) 
    110       !!        !  93-03  (M. Guyon)  symetrical conditions (M. Guyon) 
    111       !!        !  96-01  (G. Madec)  suppression of common work arrays 
    112       !!        !  96-05  (G. Madec)  mask computed from tmask and sup- 
    113       !!                 pression of the double computation of bmask 
    114       !!        !  97-02  (G. Madec)  mesh information put in domhgr.F 
    115       !!        !  97-07  (G. Madec)  modification of mbathy and fmask 
    116       !!        !  98-05  (G. Roullet)  free surface 
    117       !!        !  00-03  (G. Madec)  no slip accurate 
    118       !!        !  01-09  (J.-M. Molines)  Open boundaries 
    119       !!   8.5  !  02-08  (G. Madec)  F90: Free form and module 
    120       !!   9.0  !  05-11  (V. Garnier) Surface pressure gradient organization 
     109      !!               bmask    : land/ocean mask at barotropic stream 
     110      !!                          function point (=0. or 1.) and set to 0 along lateral boundaries 
     111      !!               mbathy   : number of non-zero w-levels  
    121112      !!---------------------------------------------------------------------- 
    122113      INTEGER  ::   ji, jj, jk      ! dummy loop indices 
     
    129120      !!--------------------------------------------------------------------- 
    130121       
    131       ! Namelist namlbc : lateral momentum boundary condition 
    132       REWIND( numnam ) 
     122      REWIND( numnam )              ! Namelist namlbc : lateral momentum boundary condition 
    133123      READ  ( numnam, namlbc ) 
    134       IF(lwp) THEN 
     124       
     125      IF(lwp) THEN                  ! control print 
    135126         WRITE(numout,*) 
    136127         WRITE(numout,*) 'dommsk : ocean mask ' 
    137128         WRITE(numout,*) '~~~~~~' 
    138          WRITE(numout,*) '         Namelist namlbc' 
    139          WRITE(numout,*) '            lateral momentum boundary cond. shlat = ',shlat 
    140       ENDIF 
    141  
    142       IF ( shlat == 0. ) THEN 
    143           IF(lwp) WRITE(numout,*) '         ocean lateral free-slip ' 
    144         ELSEIF ( shlat  ==  2. ) THEN 
    145           IF(lwp) WRITE(numout,*) '         ocean lateral  no-slip ' 
    146         ELSEIF ( 0. < shlat .AND. shlat < 2. ) THEN 
    147           IF(lwp) WRITE(numout,*) '         ocean lateral  partial-slip ' 
    148         ELSEIF ( 2. < shlat ) THEN 
    149           IF(lwp) WRITE(numout,*) '         ocean lateral  strong-slip ' 
     129         WRITE(numout,*) '   Namelist namlbc' 
     130         WRITE(numout,*) '      lateral momentum boundary cond. shlat = ',shlat 
     131      ENDIF 
     132 
     133      IF(             shlat == 0.            ) THEN   ;   IF(lwp) WRITE(numout,*) '         ocean lateral free-slip ' 
     134        ELSEIF (      shlat == 2.            ) THEN   ;   IF(lwp) WRITE(numout,*) '         ocean lateral  no-slip ' 
     135        ELSEIF ( 0. < shlat .AND. shlat < 2. ) THEN   ;   IF(lwp) WRITE(numout,*) '         ocean lateral  partial-slip ' 
     136        ELSEIF ( 2. < shlat                  ) THEN   ;   IF(lwp) WRITE(numout,*) '         ocean lateral  strong-slip ' 
    150137        ELSE 
    151138          WRITE(ctmp1,*) ' shlat is negative = ', shlat 
     
    155142      ! 1. Ocean/land mask at t-point (computed from mbathy) 
    156143      ! ----------------------------- 
    157       ! Tmask has already the right boundary conditions since mbathy is ok 
    158  
     144      ! N.B. tmask has already the right boundary conditions since mbathy is ok 
     145      ! 
    159146      tmask(:,:,:) = 0.e0 
    160147      DO jk = 1, jpk 
    161148         DO jj = 1, jpj 
    162149            DO ji = 1, jpi 
    163                IF( FLOAT( mbathy(ji,jj)-jk )+.1 >= 0.e0 ) tmask(ji,jj,jk) = 1.e0 
     150               IF( REAL( mbathy(ji,jj) - jk ) +.1 >= 0.e0 ) tmask(ji,jj,jk) = 1.e0 
    164151            END DO   
    165152         END DO   
    166153      END DO   
    167154 
     155!!gm  ???? 
    168156#if defined key_zdfkpp 
    169157      IF( cp_cfg == 'orca' )   THEN 
     
    184172      ENDIF 
    185173#endif 
     174!!gm end 
    186175 
    187176      ! Interior domain mask (used for global sum) 
    188177      ! -------------------- 
    189  
    190178      tmask_i(:,:) = tmask(:,:,1) 
    191179      iif = jpreci                         ! ??? 
     
    200188 
    201189      ! north fold mask 
     190      ! --------------- 
    202191      tpol(1:jpiglo) = 1.e0  
    203192      fpol(1:jpiglo) = 1.e0 
     
    205194         tpol(jpiglo/2+1:jpiglo) = 0.e0 
    206195         fpol(     1    :jpiglo) = 0.e0 
    207          ! T-point pivot: only half of the nlcj-1 row 
    208          IF( mjg(nlej) == jpjglo )   THEN 
     196         IF( mjg(nlej) == jpjglo ) THEN                  ! only half of the nlcj-1 row 
    209197            DO ji = iif+1, iil-1 
    210198               tmask_i(ji,nlej-1) = tmask_i(ji,nlej-1) * tpol(mig(ji)) 
     
    219207      ! 2. Ocean/land mask at u-,  v-, and z-points (computed from tmask) 
    220208      ! ------------------------------------------- 
    221        
    222       ! Computation 
    223209      DO jk = 1, jpk 
    224210         DO jj = 1, jpjm1 
     
    233219         END DO 
    234220      END DO 
    235  
    236       ! Lateral boundary conditions 
    237       CALL lbc_lnk( umask, 'U', 1. ) 
     221      CALL lbc_lnk( umask, 'U', 1. )      ! Lateral boundary conditions 
    238222      CALL lbc_lnk( vmask, 'V', 1. ) 
    239223      CALL lbc_lnk( fmask, 'F', 1. ) 
     
    242226      ! 4. ocean/land mask for the elliptic equation 
    243227      ! -------------------------------------------- 
    244        
    245       ! Computation 
    246228      bmask(:,:) = tmask(:,:,1)       ! elliptic equation is written at t-point 
    247        
    248       ! Boundary conditions 
    249       !   cyclic east-west : bmask must be set to 0. on rows 1 and jpi 
     229      ! 
     230      !                               ! Boundary conditions 
     231      !                                    ! cyclic east-west : bmask must be set to 0. on rows 1 and jpi 
    250232      IF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 
    251233         bmask( 1 ,:) = 0.e0 
    252234         bmask(jpi,:) = 0.e0 
    253235      ENDIF 
    254        
    255       !   south symmetric :  bmask must be set to 0. on row 1 
    256       IF( nperio == 2 ) THEN 
     236      IF( nperio == 2 ) THEN               ! south symmetric :  bmask must be set to 0. on row 1 
    257237         bmask(:, 1 ) = 0.e0 
    258238      ENDIF 
    259        
    260       !   north fold :  
    261       IF( nperio == 3 .OR. nperio == 4 ) THEN 
    262          ! T-pt pivot and T-pt elliptic eq. : bmask set to 0. on row jpj and on half jpjglo-1 row 
    263          DO ji = 1, jpi 
     239      !                                    ! north fold :  
     240      IF( nperio == 3 .OR. nperio == 4 ) THEN   ! T-pt pivot : bmask set to 0. on row jpj and on half jpjglo-1 row 
     241         DO ji = 1, jpi                       
    264242            ii = ji + nimpp - 1 
    265243            bmask(ji,jpj-1) = bmask(ji,jpj-1) * tpol(ii) 
     
    267245         END DO 
    268246      ENDIF 
    269       IF( nperio == 5 .OR. nperio == 6 ) THEN 
    270          ! F-pt pivot and T-pt elliptic eq. : bmask set to 0. on row jpj 
     247      IF( nperio == 5 .OR. nperio == 6 ) THEN   ! F-pt pivot and T-pt elliptic eq. : bmask set to 0. on row jpj 
    271248         bmask(:,jpj) = 0.e0 
    272249      ENDIF 
    273  
    274       ! Mpp boundary conditions: bmask is set to zero on the overlap 
    275       ! region for all elliptic solvers 
    276  
    277       IF( lk_mpp ) THEN 
     250      ! 
     251      IF( lk_mpp ) THEN                    ! mpp specificities 
     252         !                                      ! bmask is set to zero on the overlap region 
    278253         IF( nbondi /= -1 .AND. nbondi /= 2 )   bmask(  1 :jpreci,:) = 0.e0 
    279254         IF( nbondi /=  1 .AND. nbondi /= 2 )   bmask(nlci:jpi   ,:) = 0.e0 
    280255         IF( nbondj /= -1 .AND. nbondj /= 2 )   bmask(:,  1 :jprecj) = 0.e0 
    281256         IF( nbondj /=  1 .AND. nbondj /= 2 )   bmask(:,nlcj:jpj   ) = 0.e0 
    282        
    283          ! north fold : bmask must be set to 0. on rows jpj-1 and jpj  
    284          IF( npolj == 3 .OR. npolj == 4 ) THEN 
     257         ! 
     258         IF( npolj == 3 .OR. npolj == 4 ) THEN  ! north fold : bmask must be set to 0. on rows jpj-1 and jpj 
    285259            DO ji = 1, nlci 
    286260               ii = ji + nimpp - 1 
     
    289263            END DO 
    290264         ENDIF 
    291          IF( npolj == 5 .OR. npolj == 6 ) THEN 
     265         IF( npolj == 5 .OR. npolj == 6 ) THEN  ! F-pt pivot and T-pt elliptic eq. : bmask set to 0. on row jpj 
    292266            DO ji = 1, nlci 
    293267               bmask(ji,nlcj  ) = 0.e0 
     
    299273      ! mask for second order calculation of vorticity 
    300274      ! ---------------------------------------------- 
    301        
    302275      CALL dom_msk_nsa 
    303276 
    304277       
    305278      ! Lateral boundary conditions on velocity (modify fmask) 
    306       ! --------------------------------------- 
    307        
     279      ! ---------------------------------------      
    308280      DO jk = 1, jpk 
    309  
    310          zwf(:,:) = fmask(:,:,jk) 
    311           
     281         zwf(:,:) = fmask(:,:,jk)          
    312282         DO jj = 2, jpjm1 
    313283            DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    318288            END DO 
    319289         END DO 
    320           
    321290         DO jj = 2, jpjm1 
    322291            IF( fmask(1,jj,jk) == 0. ) THEN 
     
    326295               fmask(jpi,jj,jk) = shlat * MIN( 1., MAX( zwf(jpi,jj+1), zwf(jpim1,jj), zwf(jpi,jj-1) ) ) 
    327296            ENDIF 
    328          END DO 
    329           
     297         END DO          
    330298         DO ji = 2, jpim1 
    331299            IF( fmask(ji,1,jk) == 0. ) THEN 
     
    337305         END DO 
    338306      END DO 
    339        
    340  
    341       IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN 
    342          !                                           ! ======================= 
    343          ! Increased lateral friction in             !  ORCA_R2 configuration 
    344          ! the vicinity of some straits              ! ======================= 
    345          ! 
     307      ! 
     308      IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN   ! ORCA_R2 configuration 
     309         !                                                 ! Increased lateral friction near of some straits 
    346310         IF( n_cla == 0 ) THEN 
    347311            !                                ! Gibraltar strait  : partial slip (fmask=0.5) 
     
    365329         ! 
    366330      ENDIF 
    367        
    368       ! Lateral boundary conditions on fmask 
    369       CALL lbc_lnk( fmask, 'F', 1. ) 
     331      ! 
     332      CALL lbc_lnk( fmask, 'F', 1. )      ! Lateral boundary conditions on fmask 
     333 
    370334       
    371335      ! Mbathy set to the number of w-level (minimum value 2) 
     
    377341      END DO 
    378342       
    379       ! Control print 
    380       ! ------------- 
    381       IF( nprint == 1 .AND. lwp ) THEN 
     343      IF( nprint == 1 .AND. lwp ) THEN      ! Control print 
    382344         imsk(:,:) = INT( tmask_i(:,:) ) 
    383345         WRITE(numout,*) ' tmask_i : ' 
     
    423385               &                           1, jpj, 1, 1, numout ) 
    424386      ENDIF 
    425  
     387      ! 
    426388   END SUBROUTINE dom_msk 
    427389 
     
    441403      !! ** Action : 
    442404      !! 
    443       !! History : 
    444       !!        !  00-03  (G. Madec)  no slip accurate 
    445405      !!---------------------------------------------------------------------- 
    446406      INTEGER  :: ji, jj, jk, jl      ! dummy loop indices 
    447       INTEGER ::   ine, inw, ins, inn, itest, ierror, iind, ijnd 
     407      INTEGER  ::   ine, inw, ins, inn, itest, ierror, iind, ijnd 
     408      REAL(wp) ::   zaa 
    448409      INTEGER, DIMENSION(jpi*jpj*jpk,3) ::  icoord 
    449       REAL(wp) ::   zaa 
    450410      !!--------------------------------------------------------------------- 
    451411       
  • trunk/NEMO/OPA_SRC/DOM/domvvl.F90

    r1528 r1566  
    2424   PRIVATE 
    2525 
    26    PUBLIC dom_vvl        ! called by domain.F90 
     26   PUBLIC   dom_vvl    ! called by domain.F90 
    2727 
    28    REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ee_t, ee_u, ee_v, ee_f   !: ??? 
     28   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ee_t, ee_u, ee_v, ee_f   !: ??? 
     29   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   mut, muu, muv, muf       !: ???  
    2930 
    30    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   mut, muu, muv, muf   !: ???  
    31  
    32    REAL(wp), DIMENSION(jpk) ::   r2dt               ! vertical profile time-step, = 2 rdttra  
    33       !                                             ! except at nit000 (=rdttra) if neuler=0 
     31   REAL(wp), DIMENSION(jpk) ::   r2dt   ! vertical profile time-step, = 2 rdttra  
     32      !                                 ! except at nit000 (=rdttra) if neuler=0 
    3433 
    3534   !! * Substitutions 
     
    5049      !! ** Purpose :  compute coefficients muX at T-U-V-F points to spread 
    5150      !!               ssh over the whole water column (scale factors) 
    52       !! 
    5351      !!---------------------------------------------------------------------- 
    5452      INTEGER  ::   ji, jj, jk 
     
    6260      ENDIF 
    6361 
    64 #if defined key_zco 
    65       CALL ctl_stop( 'dom_vvl_ini : options key_zco is incompatible with variable volume option key_vvl') 
    66 #endif 
     62      IF( lk_zco )   CALL ctl_stop( 'dom_vvl : key_zco is incompatible with variable volume option key_vvl') 
    6763 
    6864      fsdept(:,:,:) = gdept (:,:,:) 
     
    7773      fse3vw(:,:,:) = e3vw  (:,:,:) 
    7874 
    79       ! mu computation 
    80       ! -------------- 
    81       ! define ee_t, u, v and f as in sigma coordinate (ee_t = 1/ht, ...) 
    82       ee_t(:,:) = fse3t_0(:,:,1)        ! Lower bound : thickness of the first model level 
     75      !                                 !==  mu computation  ==! 
     76      ee_t(:,:) = fse3t_0(:,:,1)                ! Lower bound : thickness of the first model level 
    8377      ee_u(:,:) = fse3u_0(:,:,1) 
    8478      ee_v(:,:) = fse3v_0(:,:,1) 
    8579      ee_f(:,:) = fse3f_0(:,:,1) 
    86       DO jk = 2, jpkm1                   ! Sum of the masked vertical scale factors 
     80      DO jk = 2, jpkm1                          ! Sum of the masked vertical scale factors 
    8781         ee_t(:,:) = ee_t(:,:) + fse3t_0(:,:,jk) * tmask(:,:,jk) 
    8882         ee_u(:,:) = ee_u(:,:) + fse3u_0(:,:,jk) * umask(:,:,jk) 
     
    9286         END DO 
    9387      END DO   
    94       !                                  ! Compute and mask the inverse of the local depth at T, U, V and F points 
     88      !                                         ! Compute and mask the inverse of the local depth at T, U, V and F points 
    9589      ee_t(:,:) = 1. / ee_t(:,:) * tmask(:,:,1) 
    9690      ee_u(:,:) = 1. / ee_u(:,:) * umask(:,:,1) 
    9791      ee_v(:,:) = 1. / ee_v(:,:) * vmask(:,:,1) 
    98       DO jj = 1, jpjm1                         ! f-point case fmask cannot be used  
     92      DO jj = 1, jpjm1                               ! f-point case fmask cannot be used  
    9993         ee_f(:,jj) = 1. / ee_f(:,jj) * umask(:,jj,1) * umask(:,jj+1,1) 
    10094      END DO 
    101       CALL lbc_lnk( ee_f, 'F', 1. )       ! lateral boundary condition on ee_f 
     95      CALL lbc_lnk( ee_f, 'F', 1. )                  ! lateral boundary condition on ee_f 
    10296      ! 
    103       DO jk = 1, jpk 
    104          mut(:,:,jk) = ee_t(:,:) * tmask(:,:,jk)   ! at T levels 
    105          muu(:,:,jk) = ee_u(:,:) * umask(:,:,jk)   ! at T levels 
    106          muv(:,:,jk) = ee_v(:,:) * vmask(:,:,jk)   ! at T levels 
     97      DO jk = 1, jpk                            ! mu coefficients 
     98         mut(:,:,jk) = ee_t(:,:) * tmask(:,:,jk)     ! T-point at T levels 
     99         muu(:,:,jk) = ee_u(:,:) * umask(:,:,jk)     ! U-point at T levels 
     100         muv(:,:,jk) = ee_v(:,:) * vmask(:,:,jk)     ! V-point at T levels 
    107101      END DO 
    108       DO jk = 1, jpk 
    109          DO jj = 1, jpjm1                      ! f-point : fmask=shlat at coasts, use the product of umask 
     102      DO jk = 1, jpk                                 ! F-point : fmask=shlat at coasts, use the product of umask 
     103         DO jj = 1, jpjm1 
    110104               muf(:,jj,jk) = ee_f(:,jj) * umask(:,jj,jk) * umask(:,jj+1,jk)   ! at T levels 
    111105         END DO 
    112106         muf(:,jpj,jk) = 0.e0 
    113107      END DO 
    114       CALL lbc_lnk( muf, 'F', 1. )       ! lateral boundary condition on ee_f 
     108      CALL lbc_lnk( muf, 'F', 1. )                   ! lateral boundary condition 
    115109 
    116110 
    117       ! Reference ocean depth at U- and V-points 
    118       hu_0(:,:) = 0.e0     
     111      hu_0(:,:) = 0.e0                          ! Reference ocean depth at U- and V-points 
    119112      hv_0(:,:) = 0.e0 
    120113      DO jk = 1, jpk 
     
    123116      END DO 
    124117 
    125       ! before and now Sea Surface Height at u-, v-, f-points 
    126       DO jj = 1, jpjm1 
     118      DO jj = 1, jpjm1                          ! initialise before and now Sea Surface Height at u-, v-, f-points 
    127119         DO ji = 1, jpim1 
    128120            zcoefu = 0.5  * umask(ji,jj,1) / ( e1u(ji,jj) * e2u(ji,jj) ) 
     
    143135         END DO 
    144136      END DO 
    145       ! Boundaries conditions 
    146       CALL lbc_lnk( sshu_b, 'U', 1. )   ;   CALL lbc_lnk( sshu_n, 'U', 1. ) 
     137      CALL lbc_lnk( sshu_b, 'U', 1. )   ;   CALL lbc_lnk( sshu_n, 'U', 1. )      ! lateral boundary conditions 
    147138      CALL lbc_lnk( sshv_b, 'V', 1. )   ;   CALL lbc_lnk( sshv_n, 'V', 1. ) 
    148139      CALL lbc_lnk( sshf_b, 'F', 1. )   ;   CALL lbc_lnk( sshf_n, 'F', 1. ) 
  • trunk/NEMO/OPA_SRC/DOM/domzgr.F90

    r1528 r1566  
    44   !! Ocean initialization : domain initialization 
    55   !!============================================================================== 
    6    !! History :  OPA  !  1995-12  (G. Madec)  Original code : s vertical coordinate 
    7    !!                 !  1997-07  (G. Madec)  lbc_lnk call 
    8    !!                 !  1997-04  (J.-O. Beismann)  
    9    !!            8.5  !  2002-09 (A. Bozec, G. Madec)  F90: Free form and module 
    10    !!             -   !  2002-09 (A. de Miranda)  rigid-lid + islands 
    11    !!  NEMO      1.0  !  2003-08  (G. Madec)  F90: Free form and module 
    12    !!             -   !  2005-10  (A. Beckmann)  modifications for hybrid s-ccordinates & new stretching function 
    13    !!            2.0  !  2006-04  (R. Benshila, G. Madec)  add zgr_zco 
    14    !!            3.0  !  2008-06  (G. Madec)  insertion of domzgr_zps.h90 & conding style 
     6   !! History :  OPA  ! 1995-12  (G. Madec)  Original code : s vertical coordinate 
     7   !!                 ! 1997-07  (G. Madec)  lbc_lnk call 
     8   !!                 ! 1997-04  (J.-O. Beismann)  
     9   !!            8.5  ! 2002-09 (A. Bozec, G. Madec)  F90: Free form and module 
     10   !!             -   ! 2002-09 (A. de Miranda)  rigid-lid + islands 
     11   !!  NEMO      1.0  ! 2003-08  (G. Madec)  F90: Free form and module 
     12   !!             -   ! 2005-10  (A. Beckmann)  modifications for hybrid s-ccordinates & new stretching function 
     13   !!            2.0  ! 2006-04  (R. Benshila, G. Madec)  add zgr_zco 
     14   !!            3.0  ! 2008-06  (G. Madec)  insertion of domzgr_zps.h90 & conding style 
     15   !!            3.2  ! 2009-07  (R. Benshila) Suppression of rigid-lid option 
    1516   !!---------------------------------------------------------------------- 
    1617 
     
    623624      ENDIF 
    624625 
    625       ! Set to zero mbathy over islands if necessary 
    626       IF(lwp) WRITE(numout,*) 
    627       IF(lwp) WRITE(numout,*) '         mbathy set to 0 over islands' 
    628       IF(lwp) WRITE(numout,*) '         ----------------------------' 
    629       ! 
    630       mbathy(:,:) = MAX( 0, mbathy(:,:) ) 
    631       ! 
    632626      !  Boundary condition on mbathy 
    633627      IF( .NOT.lk_mpp ) THEN  
     
    655649      ENDIF 
    656650 
    657       ! control print 
    658       IF( lwp .AND. nprint == 1 ) THEN 
     651      IF( lwp .AND. nprint == 1 ) THEN      ! control print 
    659652         WRITE(numout,*) 
    660653         WRITE(numout,*) ' bathymetric field :   number of non-zero T-levels ' 
     
    10271020      REAL(wp), INTENT(in   ) ::   bb    ! Stretching coefficient 
    10281021      REAL(wp)                ::   pf1   ! sigma value 
    1029  
    1030       !!---------------------------------------------------------------------- 
    1031       ! 
    1032       IF ( theta == 0 ) then   !uniform sigma 
    1033          pf1 = -(pk1-0.5)/REAL(jpkm1) 
    1034       ELSE    ! stretched sigma 
     1022      !!---------------------------------------------------------------------- 
     1023      ! 
     1024      IF ( theta == 0 ) then      ! uniform sigma 
     1025         pf1 = -(pk1-0.5) / REAL( jpkm1 ) 
     1026      ELSE                        ! stretched sigma 
    10351027         pf1 =   (1.0-bb) * (sinh( theta*(-(pk1-0.5)/REAL(jpkm1)) ) ) / sinh(theta) + & 
    1036                  bb * ( (tanh( theta*( (-(pk1-0.5)/REAL(jpkm1)) + 0.5) ) - tanh(0.5*theta) ) / & 
    1037                  (2*tanh(0.5*theta) ) ) 
    1038       ENDIF 
    1039  
     1028            &    bb * ( (tanh( theta*( (-(pk1-0.5)/REAL(jpkm1)) + 0.5) ) - tanh(0.5*theta) ) / & 
     1029            &    (2*tanh(0.5*theta) ) ) 
     1030      ENDIF 
     1031      ! 
    10401032   END FUNCTION fssig1 
    10411033 
     
    10781070      REAL(wp), DIMENSION(jpi,jpj) ::   zenv, ztmp, zmsk    ! 2D workspace 
    10791071      REAL(wp), DIMENSION(jpi,jpj) ::   zri , zrj , zhbat   !  -     - 
    1080  
    1081       LOGICAL :: ln_s_sigma = .false. !use hybrid s_sigma coordinates & stretching function fssig1,used with ln_sco = .true. 
     1072      !! 
     1073      LOGICAL  :: ln_s_sigma = .false. !use hybrid s_sigma coordinates & stretching function fssig1,used with ln_sco = .true. 
    10821074      REAL(wp) :: bb = 0.8   ! stretching parameter for song and haidvogel stretching, bb=0; top only, bb =1; top and bottom 
    10831075      REAL(wp) :: hc = 150   ! Critical depth for s-sigma coordinates 
    1084  
     1076!!gm never do that !!!!   ==> Pb at compilation phase on several computer 
    10851077      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   gsigw3 = 0.0d0 
    10861078      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   gsigt3 = 0.0d0 
     
    10931085      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigwu3 = 0.0d0 
    10941086      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigwv3 = 0.0d0 
     1087!!gm end 
    10951088      !! 
    10961089      NAMELIST/nam_zgr_sco/ sbot_max, sbot_min, theta, thetb, r_max, ln_s_sigma, bb, hc 
  • trunk/NEMO/OPA_SRC/DYN/dynadv_cen2.F90

    r1528 r1566  
    55   !!                 using a 2nd order centred scheme 
    66   !!====================================================================== 
    7    !! History :  9.0  !  06-08  (G. Madec, S. Theetten)  Original code 
     7   !! History :  2.0  ! 2006-08  (G. Madec, S. Theetten)  Original code 
     8   !!            3.2  ! 2009-07  (R. Benshila)  Suppression of rigid-lid option 
    89   !!---------------------------------------------------------------------- 
    910 
     
    1415   USE oce            ! ocean dynamics and tracers 
    1516   USE dom_oce        ! ocean space and time domain 
     17   USE trdmod_oce     ! ocean variables trends 
     18   USE trdmod         ! ocean dynamics trends 
    1619   USE in_out_manager ! I/O manager 
    17    USE trdmod         ! ocean dynamics trends 
    18    USE trdmod_oce     ! ocean variables trends 
    1920   USE prtctl         ! Print control 
    2021 
     
    2223   PRIVATE 
    2324 
    24    !! * Routine accessibility 
    25    PUBLIC dyn_adv_cen2                        ! routine called by step.F90 
     25   PUBLIC   dyn_adv_cen2   ! routine called by step.F90 
    2626 
    2727   !! * Substitutions 
     
    2929#  include "vectopt_loop_substitute.h90" 
    3030   !!---------------------------------------------------------------------- 
    31    !!   OPA 9.0 , LODYC-IPSL  (2006) 
     31   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009) 
    3232   !! $Id$ 
    3333   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
     
    4141      !! 
    4242      !! ** Purpose :   Compute the now momentum advection trend in flux form 
    43       !!      and the general trend of the momentum equation. 
     43      !!              and the general trend of the momentum equation. 
    4444      !! 
    4545      !! ** Method  :   Trend evaluated using now fields (centered in time)  
    4646      !! 
    47       !! ** Action : - Update (ua,va) with the now vorticity term trend 
     47      !! ** Action  :   (ua,va) updated with the now vorticity term trend 
    4848      !!---------------------------------------------------------------------- 
    49       USE oce, ONLY:   zfu => ta,   & ! use ta as 3D workspace 
    50                        zfv => sa      ! use sa as 3D workspace 
    51  
    52       INTEGER, INTENT( in ) ::   kt         ! ocean time-step index 
    53  
    54       INTEGER  ::   ji, jj, jk              ! dummy loop indices 
    55       REAL(wp) ::   zua, zva, zbu, zbv      ! temporary scalars 
     49      USE oce, ONLY:   zfu => ta  ! use ta as 3D workspace 
     50      USE oce, ONLY:   zfv => sa   ! use sa as 3D workspace 
     51      !! 
     52      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     53      !! 
     54      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     55      REAL(wp) ::   zbu, zbv     ! temporary scalars 
    5656      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zfu_t, zfu_f, zfu_uw   ! 3D workspace 
    57       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zfv_t, zfv_f, zfv_vw   !  "      " 
    58       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zfw                    !  "      " 
     57      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zfv_t, zfv_f, zfv_vw   !  -      - 
     58      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zfw                    !  -      - 
    5959      !!---------------------------------------------------------------------- 
    6060 
     
    7070      ENDIF 
    7171 
    72       ! I. Horizontal advection 
    73       ! ----------------------- 
    74       !                                                ! =============== 
    75       DO jk = 1, jpkm1                                 ! Horizontal slab 
    76          !                                             ! =============== 
    77          ! horizontal volume fluxes 
     72      !                                      ! ====================== ! 
     73      !                                      !  Horizontal advection  ! 
     74      DO jk = 1, jpkm1                       ! ====================== ! 
     75         !                                         ! horizontal volume fluxes 
    7876         zfu(:,:,jk) = 0.25 * e2u(:,:) * fse3u(:,:,jk) * un(:,:,jk) 
    7977         zfv(:,:,jk) = 0.25 * e1v(:,:) * fse3v(:,:,jk) * vn(:,:,jk) 
    80  
    81          ! horizontal momentum fluxes at T- and F-point 
    82          DO jj = 1, jpjm1 
     78         ! 
     79         DO jj = 1, jpjm1                          ! horizontal momentum fluxes at T- and F-point 
    8380            DO ji = 1, fs_jpim1   ! vector opt. 
    8481               zfu_t(ji+1,jj  ,jk) = ( zfu(ji,jj,jk) + zfu(ji+1,jj  ,jk) ) * ( un(ji,jj,jk) + un(ji+1,jj  ,jk) ) 
     
    8885            END DO 
    8986         END DO 
    90  
    91          ! divergence of horizontal momentum fluxes 
    92          DO jj = 2, jpjm1 
     87         DO jj = 2, jpjm1                          ! divergence of horizontal momentum fluxes 
    9388            DO ji = fs_2, fs_jpim1   ! vector opt. 
    9489               zbu = e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk) 
    9590               zbv = e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk) 
    96                ! horizontal advective trends 
    97                zua = - (  zfu_t(ji+1,jj  ,jk) - zfu_t(ji  ,jj  ,jk)   & 
    98                   &     + zfv_f(ji  ,jj  ,jk) - zfv_f(ji  ,jj-1,jk)  ) / zbu 
    99                zva = - (  zfu_f(ji  ,jj  ,jk) - zfu_f(ji-1,jj  ,jk)   & 
    100                   &     + zfv_t(ji  ,jj+1,jk) - zfv_t(ji  ,jj  ,jk)  ) / zbv 
    101                ! add it to the general tracer trends 
    102                ua(ji,jj,jk) = ua(ji,jj,jk) + zua 
    103                va(ji,jj,jk) = va(ji,jj,jk) + zva 
     91               ! 
     92               ua(ji,jj,jk) = ua(ji,jj,jk) - (  zfu_t(ji+1,jj  ,jk) - zfu_t(ji  ,jj  ,jk)    & 
     93                  &                           + zfv_f(ji  ,jj  ,jk) - zfv_f(ji  ,jj-1,jk)  ) / zbu 
     94               va(ji,jj,jk) = va(ji,jj,jk) - (  zfu_f(ji  ,jj  ,jk) - zfu_f(ji-1,jj  ,jk)    & 
     95                  &                           + zfv_t(ji  ,jj+1,jk) - zfv_t(ji  ,jj  ,jk)  ) / zbv 
    10496            END DO 
    10597         END DO 
    106          !                                             ! =============== 
    107       END DO                                           !   End of slab 
    108       !                                                ! =============== 
    109  
    110       IF( l_trddyn ) THEN      ! save the horizontal advection trend for diagnostic 
     98      END DO 
     99      ! 
     100      IF( l_trddyn ) THEN                          ! save the horizontal advection trend for diagnostic 
    111101         zfu_uw(:,:,:) = ua(:,:,:) - zfu_uw(:,:,:) 
    112102         zfv_vw(:,:,:) = va(:,:,:) - zfv_vw(:,:,:) 
    113103         CALL trd_mod( zfu_uw, zfv_vw, jpdyn_trd_had, 'DYN', kt ) 
     104         zfu_t(:,:,:) = ua(:,:,:) 
     105         zfv_t(:,:,:) = va(:,:,:) 
    114106      ENDIF 
    115107      ! 
    116108 
    117       ! II. Vertical advection 
    118       ! ---------------------- 
    119  
    120       IF( l_trddyn ) THEN           ! Save ua and va trends 
    121          zfu_t(:,:,:) = ua(:,:,:) 
    122          zfv_t(:,:,:) = va(:,:,:) 
    123       ENDIF 
    124  
    125       ! Second order centered tracer flux at w-point 
    126       DO jk = 1, jpkm1 
    127          ! Vertical volume fluxes                    
     109      !                                      ! ==================== ! 
     110      !                                      !  Vertical advection  ! 
     111      DO jk = 1, jpkm1                       ! ==================== ! 
     112         !                                         ! Vertical volume fluxesÊ 
    128113         zfw(:,:,jk) = 0.25 * e1t(:,:) * e2t(:,:) * wn(:,:,jk) 
    129          ! Vertical advective fluxes                    
    130          IF( jk == 1 ) THEN 
    131             zfu_uw(:,:,jpk) = 0.e0         ! Bottom value : flux set to zero 
     114         ! 
     115         IF( jk == 1 ) THEN                        ! surface/bottom advective fluxes                    
     116            zfu_uw(:,:,jpk) = 0.e0                      ! Bottom value : flux set to zero 
    132117            zfv_vw(:,:,jpk) = 0.e0 
    133             !                              ! Surface value 
    134             IF( lk_vvl ) THEN 
    135                ! variable volume : flux set to zero 
     118            !                                           ! Surface value : 
     119            IF( lk_vvl ) THEN                                ! variable volume : flux set to zero 
    136120               zfu_uw(:,:, 1 ) = 0.e0     
    137121               zfv_vw(:,:, 1 ) = 0.e0 
    138             ELSE 
    139                ! free surface-constant volume 
     122            ELSE                                             ! constant volume : advection through the surface 
    140123               DO jj = 2, jpjm1 
    141124                  DO ji = fs_2, fs_jpim1 
     
    145128               END DO 
    146129            ENDIF 
    147          ELSE 
    148             !                              ! interior fluxes 
     130         ELSE                                      ! interior fluxes 
    149131            DO jj = 2, jpjm1 
    150132               DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    155137         ENDIF 
    156138      END DO 
    157  
    158       ! momentum flux divergence at u-, v-points added to the general trend 
    159       DO jk = 1, jpkm1 
     139      DO jk = 1, jpkm1                             ! divergence of vertical momentum flux divergence 
    160140         DO jj = 2, jpjm1  
    161141            DO ji = fs_2, fs_jpim1   ! vector opt. 
    162                zua = - ( zfu_uw(ji,jj,jk) - zfu_uw(ji,jj,jk+1) )    & 
     142               ua(ji,jj,jk) =  ua(ji,jj,jk) - ( zfu_uw(ji,jj,jk) - zfu_uw(ji,jj,jk+1) )    & 
    163143                  &  / ( e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk) ) 
    164                zva = - ( zfv_vw(ji,jj,jk) - zfv_vw(ji,jj,jk+1) )    & 
     144               va(ji,jj,jk) =  va(ji,jj,jk) - ( zfv_vw(ji,jj,jk) - zfv_vw(ji,jj,jk+1) )    & 
    165145                  &  / ( e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk) ) 
    166                ! add it to the general tracer trends 
    167                ua(ji,jj,jk) =  ua(ji,jj,jk) + zua 
    168                va(ji,jj,jk) =  va(ji,jj,jk) + zva 
    169146            END DO 
    170147         END DO 
    171148      END DO 
    172  
    173       IF( l_trddyn ) THEN      ! save the vertical advection trend for diagnostic 
     149      ! 
     150      IF( l_trddyn ) THEN                          ! save the vertical advection trend for diagnostic 
    174151         zfu_t(:,:,:) = ua(:,:,:) - zfu_t(:,:,:) 
    175152         zfv_t(:,:,:) = va(:,:,:) - zfv_t(:,:,:) 
    176153         CALL trd_mod( zfu_t, zfv_t, jpdyn_trd_zad, 'DYN', kt ) 
    177154      ENDIF 
    178  
    179       !                             ! Control print 
     155      !                                            ! Control print 
    180156      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' cen2 adv - Ua: ', mask1=umask,   & 
    181157         &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' ) 
  • trunk/NEMO/OPA_SRC/DYN/dynadv_ubs.F90

    r1528 r1566  
    55   !!                 trend using a 3rd order upstream biased scheme 
    66   !!====================================================================== 
    7    !! History :  9.0  !  06-08  (R. Benshila, L. Debreu)  Original code 
     7   !! History :  2.0  ! 2006-08  (R. Benshila, L. Debreu)  Original code 
     8   !!            3.2  ! 2009-07  (R. Benshila)  Suppression of rigid-lid option 
    89   !!---------------------------------------------------------------------- 
    910 
     
    2728   REAL(wp), PARAMETER :: gamma2 = 1._wp/8._wp  ! =0   2nd order  ; =1/8  4th order centred 
    2829 
    29    !! * Routine accessibility 
    30    PUBLIC dyn_adv_ubs                            ! routine called by step.F90 
     30   PUBLIC   dyn_adv_ubs   ! routine called by step.F90 
    3131 
    3232   !! * Substitutions 
     
    3434#  include "vectopt_loop_substitute.h90" 
    3535   !!---------------------------------------------------------------------- 
    36    !!   OPA 9.0 , LODYC-IPSL  (2006) 
     36   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009) 
    3737   !! $Id$ 
    3838   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
     
    4646      !! 
    4747      !! ** Purpose :   Compute the now momentum advection trend in flux form 
    48       !!      and the general trend of the momentum equation. 
     48      !!              and the general trend of the momentum equation. 
    4949      !! 
    5050      !! ** Method  :   The scheme is the one implemeted in ROMS. It depends  
     
    6464      !!      gamma1=1/4 and gamma2=1/8. 
    6565      !! 
    66       !! ** Action : - update (ua,va) with the 3D advective momentum trends 
     66      !! ** Action : - (ua,va) updated with the 3D advective momentum trends 
    6767      !! 
    6868      !! Reference : Shchepetkin & McWilliams, 2005, Ocean Modelling.  
    6969      !!---------------------------------------------------------------------- 
    70       USE oce, ONLY:   zfu => ta,   & ! use ta as 3D workspace 
    71                        zfv => sa      ! use sa as 3D workspace 
    72  
     70      USE oce, ONLY:   zfu => ta  ! use ta as 3D workspace 
     71      USE oce, ONLY:   zfv => sa   ! use sa as 3D workspace 
     72      !! 
    7373      INTEGER, INTENT(in) ::   kt     ! ocean time-step index 
    74  
    75       INTEGER  ::   ji, jj, jk                      ! dummy loop indices 
    76       REAL(wp) ::   zua, zva, zbu, zbv              ! temporary scalars 
    77       REAL(wp) ::   zui, zvj, zfuj, zfvi, zl_u, zl_v! temporary scalars 
     74      !! 
     75      INTEGER  ::   ji, jj, jk            ! dummy loop indices 
     76      REAL(wp) ::   zbu, zbv    ! temporary scalars 
     77      REAL(wp) ::   zui, zvj, zfuj, zfvi, zl_u, zl_v   ! temporary scalars 
    7878      REAL(wp), DIMENSION(jpi,jpj,jpk)   ::   zfu_t, zfu_f     ! temporary workspace 
    7979      REAL(wp), DIMENSION(jpi,jpj,jpk)   ::   zfv_t, zfv_f     !    "           " 
     
    9292      zfu_f(:,:,:) = 0.e0 
    9393      zfv_f(:,:,:) = 0.e0 
    94       
     94      ! 
    9595      zlu_uu(:,:,:,:) = 0.e0  
    9696      zlv_vv(:,:,:,:) = 0.e0  
     
    103103      ENDIF 
    104104 
    105       !                                                ! =============== 
    106       DO jk = 1, jpkm1                                 ! Horizontal slab 
    107          !                                             ! =============== 
    108          ! Laplacian 
    109          ! --------- 
     105      !                                      ! =========================== ! 
     106      DO jk = 1, jpkm1                       !  Laplacian of the velocity  ! 
     107         !                                   ! =========================== ! 
     108         !                                         ! horizontal volume fluxes 
    110109         zfu(:,:,jk) = e2u(:,:) * fse3u(:,:,jk) * un(:,:,jk) 
    111110         zfv(:,:,jk) = e1v(:,:) * fse3v(:,:,jk) * vn(:,:,jk) 
    112              
    113          DO jj = 2, jpjm1 
     111         !             
     112         DO jj = 2, jpjm1                          ! laplacian 
    114113            DO ji = fs_2, fs_jpim1   ! vector opt. 
    115114               zlu_uu(ji,jj,jk,1) = ( ub (ji+1,jj,jk)-2.*ub (ji,jj,jk)+ub (ji-1,jj,jk) ) * umask(ji,jj,jk) 
     
    124123            END DO 
    125124         END DO 
    126          !                                             ! =============== 
    127       END DO                                           !   End of slab 
    128       !                                                ! =============== 
    129  
    130       CALL lbc_lnk( zlu_uu(:,:,:,1), 'U', -1.)  
    131       CALL lbc_lnk( zlu_uu(:,:,:,2), 'U', -1.)  
    132       CALL lbc_lnk( zlv_vv(:,:,:,1), 'V', -1.)  
    133       CALL lbc_lnk( zlv_vv(:,:,:,2), 'V', -1.)  
    134  
    135       CALL lbc_lnk( zlu_uv(:,:,:,1), 'U', -1.)  
    136       CALL lbc_lnk( zlu_uv(:,:,:,2), 'U', -1.)  
    137       CALL lbc_lnk( zlv_vu(:,:,:,1), 'V', -1.)  
    138       CALL lbc_lnk( zlv_vu(:,:,:,2), 'V', -1.)  
    139  
    140       ! I. Horizontal advection 
    141       ! ----------------------- 
    142       !                                                ! =============== 
    143       DO jk = 1, jpkm1                                 ! Horizontal slab 
    144          !                                             ! =============== 
    145          ! horizontal volume fluxes 
     125      END DO 
     126!!gm BUG !!!  just below this should be +1 in all the communications 
     127      CALL lbc_lnk( zlu_uu(:,:,:,1), 'U', -1.)   ;   CALL lbc_lnk( zlu_uv(:,:,:,1), 'U', -1.) 
     128      CALL lbc_lnk( zlu_uu(:,:,:,2), 'U', -1.)   ;   CALL lbc_lnk( zlu_uv(:,:,:,2), 'U', -1.) 
     129      CALL lbc_lnk( zlv_vv(:,:,:,1), 'V', -1.)   ;   CALL lbc_lnk( zlv_vu(:,:,:,1), 'V', -1.) 
     130      CALL lbc_lnk( zlv_vv(:,:,:,2), 'V', -1.)   ;   CALL lbc_lnk( zlv_vu(:,:,:,2), 'V', -1.)  
     131 
     132!!gm corrected: 
     133      CALL lbc_lnk( zlu_uu(:,:,:,1), 'U', 1. )   ;   CALL lbc_lnk( zlu_uv(:,:,:,1), 'U', 1. ) 
     134      CALL lbc_lnk( zlu_uu(:,:,:,2), 'U', 1. )   ;   CALL lbc_lnk( zlu_uv(:,:,:,2), 'U', 1. ) 
     135      CALL lbc_lnk( zlv_vv(:,:,:,1), 'V', 1. )   ;   CALL lbc_lnk( zlv_vu(:,:,:,1), 'V', 1. ) 
     136      CALL lbc_lnk( zlv_vv(:,:,:,2), 'V', 1. )   ;   CALL lbc_lnk( zlv_vu(:,:,:,2), 'V', 1. )  
     137!!gm end 
     138       
     139      !                                      ! ====================== ! 
     140      !                                      !  Horizontal advection  ! 
     141      DO jk = 1, jpkm1                       ! ====================== ! 
     142         !                                         ! horizontal volume fluxes 
    146143         zfu(:,:,jk) = 0.25 * e2u(:,:) * fse3u(:,:,jk) * un(:,:,jk) 
    147144         zfv(:,:,jk) = 0.25 * e1v(:,:) * fse3v(:,:,jk) * vn(:,:,jk) 
    148  
    149          ! horizontal momentum fluxes at T- and F-point 
    150          DO jj = 1, jpjm1 
     145         ! 
     146         DO jj = 1, jpjm1                          ! horizontal momentum fluxes at T- and F-point 
    151147            DO ji = 1, fs_jpim1   ! vector opt. 
    152148               zui = ( un(ji,jj,jk) + un(ji+1,jj  ,jk) ) 
    153149               zvj = ( vn(ji,jj,jk) + vn(ji  ,jj+1,jk) ) 
    154  
     150               ! 
    155151               IF (zui > 0) THEN   ;   zl_u = zlu_uu(ji  ,jj,jk,1) 
    156152               ELSE                ;   zl_u = zlu_uu(ji+1,jj,jk,1) 
     
    159155               ELSE                ;   zl_v = zlv_vv(ji,jj+1,jk,1) 
    160156               ENDIF 
    161  
     157               ! 
    162158               zfu_t(ji+1,jj  ,jk) = ( zfu(ji,jj,jk) + zfu(ji+1,jj  ,jk)                               & 
    163159                  &                    - gamma2 * ( zlu_uu(ji,jj,jk,2) + zlu_uu(ji+1,jj  ,jk,2) )  )   & 
     
    166162                  &                    - gamma2 * ( zlv_vv(ji,jj,jk,2) + zlv_vv(ji  ,jj+1,jk,2) )  )   & 
    167163                  &                * ( zvj - gamma1 * zl_v) 
    168  
     164               ! 
    169165               zfuj = ( zfu(ji,jj,jk) + zfu(ji  ,jj+1,jk) ) 
    170166               zfvi = ( zfv(ji,jj,jk) + zfv(ji+1,jj  ,jk) ) 
     
    175171               ELSE                 ;    zl_u = zlu_uv( ji,jj+1,jk,1) 
    176172               ENDIF 
    177  
     173               ! 
    178174               zfv_f(ji  ,jj  ,jk) = ( zfvi - gamma2 * ( zlv_vu(ji,jj,jk,2) + zlv_vu(ji+1,jj  ,jk,2) )  )   & 
    179175                  &                * ( un(ji,jj,jk) + un(ji  ,jj+1,jk) - gamma1 * zl_u ) 
     
    182178            END DO 
    183179         END DO 
    184  
    185          ! divergence of horizontal momentum fluxes 
    186          DO jj = 2, jpjm1 
     180         DO jj = 2, jpjm1                          ! divergence of horizontal momentum fluxes 
    187181            DO ji = fs_2, fs_jpim1   ! vector opt. 
    188182               zbu = e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk) 
    189183               zbv = e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk) 
    190                ! horizontal advective trends 
    191                zua = - (  zfu_t(ji+1,jj  ,jk) - zfu_t(ji  ,jj  ,jk)   & 
    192                   &     + zfv_f(ji  ,jj  ,jk) - zfv_f(ji  ,jj-1,jk)  ) / zbu 
    193                zva = - (  zfu_f(ji  ,jj  ,jk) - zfu_f(ji-1,jj  ,jk)   & 
    194                   &     + zfv_t(ji  ,jj+1,jk) - zfv_t(ji  ,jj  ,jk)  ) / zbv 
    195                ! add it to the general tracer trends 
    196                ua(ji,jj,jk) = ua(ji,jj,jk) + zua 
    197                va(ji,jj,jk) = va(ji,jj,jk) + zva 
    198             END DO 
    199          END DO 
    200          !                                             ! =============== 
    201       END DO                                           !   End of slab 
    202       !                                                ! =============== 
    203  
    204       IF( l_trddyn ) THEN      ! save the horizontal advection trend for diagnostic 
     184               ! 
     185               ua(ji,jj,jk) = ua(ji,jj,jk) - (  zfu_t(ji+1,jj  ,jk) - zfu_t(ji  ,jj  ,jk)    & 
     186                  &                           + zfv_f(ji  ,jj  ,jk) - zfv_f(ji  ,jj-1,jk)  ) / zbu 
     187               va(ji,jj,jk) = va(ji,jj,jk) - (  zfu_f(ji  ,jj  ,jk) - zfu_f(ji-1,jj  ,jk)    & 
     188                  &                           + zfv_t(ji  ,jj+1,jk) - zfv_t(ji  ,jj  ,jk)  ) / zbv 
     189            END DO 
     190         END DO 
     191      END DO 
     192      IF( l_trddyn ) THEN                          ! save the horizontal advection trend for diagnostic 
    205193         zfu_uw(:,:,:) = ua(:,:,:) - zfu_uw(:,:,:) 
    206194         zfv_vw(:,:,:) = va(:,:,:) - zfv_vw(:,:,:) 
    207195         CALL trd_mod( zfu_uw, zfv_vw, jpdyn_trd_had, 'DYN', kt ) 
    208       ENDIF 
    209  
    210       ! II. Vertical advection 
    211       ! ---------------------- 
    212  
    213       IF( l_trddyn ) THEN           ! Save ua and va trends 
    214196         zfu_t(:,:,:) = ua(:,:,:) 
    215197         zfv_t(:,:,:) = va(:,:,:) 
    216198      ENDIF 
    217199 
    218       ! Second order centered tracer flux at w-point 
    219       DO jk = 1, jpkm1 
    220          ! Vertical volume fluxes                    
     200      !                                      ! ==================== ! 
     201      !                                      !  Vertical advection  ! 
     202      DO jk = 1, jpkm1                       ! ==================== ! 
     203         !                                         ! Vertical volume fluxesÊ 
    221204         zfw(:,:,jk) = 0.25 * e1t(:,:) * e2t(:,:) * wn(:,:,jk) 
    222          ! Vertical advective fluxes                    
    223          IF( jk == 1 ) THEN 
    224             zfu_uw(:,:,jpk) = 0.e0         ! Bottom value : flux set to zero 
     205         ! 
     206         IF( jk == 1 ) THEN                        ! surface/bottom advective fluxes                    
     207            zfu_uw(:,:,jpk) = 0.e0                      ! Bottom value : flux set to zero 
    225208            zfv_vw(:,:,jpk) = 0.e0 
    226             !                              ! Surface value 
    227             IF( lk_vvl ) THEN 
    228                ! variable volume : flux set to zero 
     209            !                                           ! Surface value : 
     210            IF( lk_vvl ) THEN                                ! variable volume : flux set to zero 
    229211               zfu_uw(:,:, 1 ) = 0.e0     
    230212               zfv_vw(:,:, 1 ) = 0.e0 
    231             ELSE 
    232                ! free surface-constant volume 
     213            ELSE                                             ! constant volume : advection through the surface 
    233214               DO jj = 2, jpjm1 
    234215                  DO ji = fs_2, fs_jpim1 
     
    238219               END DO 
    239220            ENDIF 
    240          ELSE 
    241             !                              ! interior fluxes 
     221         ELSE                                      ! interior fluxes 
    242222            DO jj = 2, jpjm1 
    243223               DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    248228         ENDIF 
    249229      END DO 
    250  
    251       ! momentum flux divergence at u-, v-points added to the general trend 
    252       DO jk = 1, jpkm1 
     230      DO jk = 1, jpkm1                             ! divergence of vertical momentum flux divergence 
    253231         DO jj = 2, jpjm1  
    254232            DO ji = fs_2, fs_jpim1   ! vector opt. 
    255                zua = - ( zfu_uw(ji,jj,jk) - zfu_uw(ji,jj,jk+1) )    & 
     233               ua(ji,jj,jk) =  ua(ji,jj,jk) - ( zfu_uw(ji,jj,jk) - zfu_uw(ji,jj,jk+1) )    & 
    256234                  &  / ( e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk) ) 
    257                zva = - ( zfv_vw(ji,jj,jk) - zfv_vw(ji,jj,jk+1) )    & 
     235               va(ji,jj,jk) =  va(ji,jj,jk) - ( zfv_vw(ji,jj,jk) - zfv_vw(ji,jj,jk+1) )    & 
    258236                  &  / ( e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk) ) 
    259                ! add it to the general tracer trends 
    260                ua(ji,jj,jk) =  ua(ji,jj,jk) + zua 
    261                va(ji,jj,jk) =  va(ji,jj,jk) + zva 
    262             END DO 
    263          END DO 
    264       END DO 
    265  
    266       IF( l_trddyn ) THEN      ! save the vertical advection trend for diagnostic 
     237            END DO 
     238         END DO 
     239      END DO 
     240      ! 
     241      IF( l_trddyn ) THEN                          ! save the vertical advection trend for diagnostic 
    267242         zfu_t(:,:,:) = ua(:,:,:) - zfu_t(:,:,:) 
    268243         zfv_t(:,:,:) = va(:,:,:) - zfv_t(:,:,:) 
    269244         CALL trd_mod( zfu_t, zfv_t, jpdyn_trd_zad, 'DYN', kt ) 
    270245      ENDIF 
    271  
    272       !                             ! Control print 
     246      !                                            ! Control print 
    273247      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' ubs2 adv - Ua: ', mask1=umask,   & 
    274248         &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' ) 
    275  
     249      ! 
    276250   END SUBROUTINE dyn_adv_ubs 
    277251 
  • trunk/NEMO/OPA_SRC/DYN/dynnxt.F90

    r1502 r1566  
    9090      !! 
    9191      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     92#if ! defined key_dynspg_flt 
    9293      REAL(wp) ::   z2dt         ! temporary scalar 
     94#endif 
    9395      REAL(wp) ::   zue3a , zue3n , zue3b    ! temporary scalar 
    9496      REAL(wp) ::   zve3a , zve3n , zve3b    !    -         - 
  • trunk/NEMO/OPA_SRC/DYN/dynspg.F90

    r1528 r1566  
    44   !! Ocean dynamics:  surface pressure gradient control 
    55   !!====================================================================== 
    6    !! History :  9.0  !  05-12  (C. Talandier, G. Madec)  Original code 
    7    !!            9.0  !  05-12  (V. Garnier)  dyn_spg_ctl: Original code 
     6   !! History :  1.0  ! 2005-12  (C. Talandier, G. Madec, V. Garnier)  Original code 
     7   !!            3.2  ! 2009-07  (R. Benshila)  Suppression of rigid-lid option 
    88   !!---------------------------------------------------------------------- 
    99 
     
    2727   PRIVATE 
    2828 
    29    PUBLIC dyn_spg         ! routine called by step module 
     29   PUBLIC   dyn_spg   ! routine called by step module 
    3030 
    31    !! * module variables 
    3231   INTEGER ::   nspg = 0   ! type of surface pressure gradient scheme defined from lk_dynspg_...  
    3332 
     
    3635#  include "vectopt_loop_substitute.h90" 
    3736   !!---------------------------------------------------------------------- 
    38    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     37   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009) 
    3938   !! $Id$  
    40    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     39   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
    4140   !!---------------------------------------------------------------------- 
    4241 
     
    4746      !!                  ***  ROUTINE dyn_spg  *** 
    4847      !! 
    49       !! ** Purpose :   compute the lateral ocean dynamics physics. 
     48      !! ** Purpose :   achieve the momentum time stepping by computing the 
     49      !!              last trend, the surface pressure gradient, and performing 
     50      !!              the Leap-Frog integration. 
     51      !!gm              In the current version only the filtered solution provide 
     52      !!gm            the after velocity, in the 2 other (ua,va) are still the trends 
     53      !! 
     54      !! ** Method  :   Three schemes: 
     55      !!              - explicit computation      : the spg is evaluated at now 
     56      !!              - filtered computation      : the Roulet & madec (2000) technique is used 
     57      !!              - split-explicit computation: a time splitting technique is used 
     58      !! 
     59      !! N.B. : When key_esopa is used all the scheme are tested, regardless  
     60      !!        of the physical meaning of the results.  
    5061      !!---------------------------------------------------------------------- 
    51       INTEGER, INTENT( in  ) ::   kt     ! ocean time-step index 
    52       INTEGER, INTENT( out ) ::   kindic ! solver flag 
     62      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
     63      INTEGER, INTENT(  out) ::   kindic  ! solver flag 
    5364      !! 
    54       REAL(wp) ::   z2dt                      ! temporary scalar 
     65      REAL(wp) ::   z2dt   ! temporary scalar 
    5566      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace 
    5667      !!---------------------------------------------------------------------- 
     68 
     69 
     70!!gm NOTA BENE : the dynspg_exp and dynspg_ts should be modified so that  
     71!!gm             they return the after velocity, not the trends (as in trazdf_imp...) 
     72!!gm             In this case, change/simplify dynnxt 
     73 
     74 
    5775 
    5876      IF( kt == nit000 )   CALL dyn_spg_ctl      ! initialisation & control of options 
     
    6583      SELECT CASE ( nspg )                       ! compute surf. pressure gradient trend and add it to the general trend 
    6684      !                                                      
    67       CASE (  0 )   ;   CALL dyn_spg_exp    ( kt )              ! explicit 
    68       CASE (  1 )   ;   CALL dyn_spg_ts     ( kt )              ! time-splitting 
    69       CASE (  2 )   ;   CALL dyn_spg_flt    ( kt, kindic )      ! filtered 
     85      CASE (  0 )   ;   CALL dyn_spg_exp( kt )              ! explicit 
     86      CASE (  1 )   ;   CALL dyn_spg_ts ( kt )              ! time-splitting 
     87      CASE (  2 )   ;   CALL dyn_spg_flt( kt, kindic )      ! filtered 
    7088      !                                                     
    71       CASE ( -1 )                                       ! esopa: test all possibility with control print 
    72                        CALL dyn_spg_exp    ( kt ) 
    73                        CALL prt_ctl( tab3d_1=ua, clinfo1=' spg0 - Ua: ', mask1=umask, & 
    74             &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
    75                        CALL dyn_spg_ts    ( kt ) 
    76                        CALL prt_ctl( tab3d_1=ua, clinfo1=' spg1 - Ua: ', mask1=umask, & 
    77             &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
    78                        CALL dyn_spg_flt  ( kt, kindic ) 
    79                        CALL prt_ctl( tab3d_1=ua, clinfo1=' spg2 - Ua: ', mask1=umask, & 
    80             &                         tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
     89      CASE ( -1 )                                ! esopa: test all possibility with control print 
     90                        CALL dyn_spg_exp( kt ) 
     91                        CALL prt_ctl( tab3d_1=ua, clinfo1=' spg0 - Ua: ', mask1=umask, & 
     92         &                            tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
     93                        CALL dyn_spg_ts ( kt ) 
     94                        CALL prt_ctl( tab3d_1=ua, clinfo1=' spg1 - Ua: ', mask1=umask, & 
     95                                  tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
     96                        CALL dyn_spg_flt( kt, kindic ) 
     97                        CALL prt_ctl( tab3d_1=ua, clinfo1=' spg2 - Ua: ', mask1=umask, & 
     98         &                            tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
    8199      END SELECT 
    82100      !                     
    83       IF( l_trddyn )   THEN                      ! save the horizontal diffusive trends for further diagnostics 
     101      IF( l_trddyn )   THEN                      ! save the surface pressure gradient trends for further diagnostics 
    84102         SELECT CASE ( nspg ) 
    85103         CASE ( 0, 1 ) 
     
    106124      !!                 
    107125      !! ** Purpose :   Control the consistency between cpp options for  
    108       !!      surface pressure gradient schemes 
     126      !!              surface pressure gradient schemes 
    109127      !!---------------------------------------------------------------------- 
    110       !! * Local declarations 
    111128      INTEGER ::   ioptio 
    112129      !!---------------------------------------------------------------------- 
    113130 
    114       ! Parameter control and print 
    115       ! --------------------------- 
    116       ! Control print 
    117       IF(lwp) THEN 
     131      IF(lwp) THEN             ! Control print 
    118132         WRITE(numout,*) 
    119133         WRITE(numout,*) 'dyn_spg_ctl : choice of the surface pressure gradient scheme' 
     
    124138      ENDIF 
    125139 
    126       ! Control of surface pressure gradient scheme options 
    127       ! --------------------------------------------------- 
     140      !                        ! Control of surface pressure gradient scheme options 
    128141      ioptio = 0 
    129142      IF(lk_dynspg_exp)   ioptio = ioptio + 1 
    130143      IF(lk_dynspg_ts )   ioptio = ioptio + 1 
    131144      IF(lk_dynspg_flt)   ioptio = ioptio + 1 
    132  
     145      ! 
    133146      IF( ( ioptio > 1 .AND. .NOT. lk_esopa ) .OR. ioptio == 0 )   & 
    134147           &   CALL ctl_stop( ' Choose only one surface pressure gradient scheme with a key cpp' ) 
    135  
     148      ! 
    136149      IF( lk_esopa     )   nspg = -1 
    137150      IF( lk_dynspg_exp)   nspg =  0 
    138151      IF( lk_dynspg_ts )   nspg =  1 
    139152      IF( lk_dynspg_flt)   nspg =  2 
    140  
     153      ! 
    141154      IF( lk_esopa     )   nspg = -1 
    142  
    143      IF(lwp) THEN 
     155      ! 
     156      IF(lwp) THEN 
    144157         WRITE(numout,*) 
    145158         IF( nspg == -1 )   WRITE(numout,*) '     ESOPA test All scheme used' 
     
    149162      ENDIF 
    150163 
    151       ! Control of timestep choice 
    152       ! -------------------------- 
     164      !                        ! Control of timestep choice 
    153165      IF( lk_dynspg_ts .OR. lk_dynspg_exp ) THEN 
    154166         IF( n_cla == 1 )   & 
     
    157169 
    158170#if defined key_obc 
    159       ! Conservation of ocean volume (key_dynspg_flt) 
    160       ! --------------------------------------------- 
    161       IF( lk_dynspg_flt ) ln_vol_cst = .true. 
     171      !                        ! Conservation of ocean volume (key_dynspg_flt) 
     172      IF( lk_dynspg_flt )   ln_vol_cst = .true. 
    162173 
    163       ! Application of Flather's algorithm at open boundaries 
    164       ! ----------------------------------------------------- 
    165       IF( lk_dynspg_flt ) ln_obc_fla = .false. 
    166       IF( lk_dynspg_exp ) ln_obc_fla = .true. 
    167       IF( lk_dynspg_ts  ) ln_obc_fla = .true. 
     174      !                        ! Application of Flather's algorithm at open boundaries 
     175      IF( lk_dynspg_flt )   ln_obc_fla = .false. 
     176      IF( lk_dynspg_exp )   ln_obc_fla = .true. 
     177      IF( lk_dynspg_ts  )   ln_obc_fla = .true. 
    168178#endif 
    169  
     179      ! 
    170180   END SUBROUTINE dyn_spg_ctl 
    171181 
  • trunk/NEMO/OPA_SRC/DYN/dynspg_oce.F90

    r1528 r1566  
    11MODULE dynspg_oce 
    2    !!---------------------------------------------------------------------- 
     2   !!====================================================================== 
    33   !!                       ***  MODULE dynspg_oce  *** 
    44   !!        
    5    !! ** Purpose :   Define in memory all the ocean space domain variables 
     5   !! Ocean dynamics: Define in memory surface pressure gradient variables 
     6   !!====================================================================== 
     7   !! History :  1.0  !  05-12  (C. Talandier, G. Madec)  Original code 
     8   !!            3.2  ! 2009-07  (R. Benshila) Suppression of rigid-lid option 
    69   !!---------------------------------------------------------------------- 
    7    !! Modules used 
    8    USE par_oce          ! ocean parameters 
     10   USE par_oce        ! ocean parameters 
    911 
    1012   IMPLICIT NONE 
    1113   PUBLIC            
    12    !!---------------------------------------------------------------------- 
    13    !!  OPA 9.0 , LOCEAN-IPSL (2005)  
    14    !! $Id$  
    15    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    16    !!---------------------------------------------------------------------- 
    1714 
    18    !! Surface pressure gradient logicals 
    19    !! ---------------------------------- 
    20 #if   defined key_dynspg_exp   ||  defined key_esopa 
    21    LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_exp = .TRUE.  !: Explicit free surface flag 
     15   !                                                       !!! Surface pressure gradient logicals 
     16#if   defined key_dynspg_exp  ||  defined key_esopa 
     17   LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_exp = .TRUE.   !: Explicit free surface flag 
    2218#else 
    23    LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_exp = .FALSE. !: Explicit free surface flag 
     19   LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_exp = .FALSE.  !: Explicit free surface flag 
    2420#endif 
    2521#if   defined key_dynspg_ts   ||  defined key_esopa 
    26    LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_ts  = .TRUE.  !: Free surface with time splitting flag 
     22   LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_ts  = .TRUE.   !: Free surface with time splitting flag 
    2723#else 
    28    LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_ts  = .FALSE. !: Free surface with time splitting flag 
     24   LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_ts  = .FALSE.  !: Free surface with time splitting flag 
    2925#endif 
    3026#if   defined key_dynspg_flt  ||  defined key_esopa 
    31    LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_flt = .TRUE.  !: Filtered free surface cst volume flag 
     27   LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_flt = .TRUE.   !: Filtered free surface cst volume flag 
    3228#else 
    33    LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_flt = .FALSE. !: Filtered free surface cst volume flag 
     29   LOGICAL, PUBLIC, PARAMETER ::   lk_dynspg_flt = .FALSE.  !: Filtered free surface cst volume flag 
    3430#endif 
    3531 
    36 #if   defined key_dynspg_ts   ||  defined key_vvl   ||  defined key_esopa 
    37   !! Time splitting variables   ! variables of the explicit barotropic loop 
    38   !! ------------------------ 
    39      REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: ua_e  , va_e             ! barotropic velocities (after) 
    40      REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: sshn_e, ssha_e, sshn_b   ! sea surface heigth (now, after, average) 
    41      REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hu_e  , hv_e             ! depth arrays for the barotropic solution 
    42      REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hur_e , hvr_e            ! inverse of depth arrays  
     32!!gm BUG : always required in _ts, only  some of them in vvl 
     33!    #if   defined key_dynspg_ts   ||   defined key_esopa 
     34!!gm end 
     35#if   defined key_dynspg_ts   ||   defined key_vvl   ||   defined key_esopa 
     36  !                                                                !!! Time splitting scheme (sub-time step variables) 
     37   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: ua_e  , va_e             ! barotropic velocities (after) 
     38   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: sshn_e, ssha_e, sshn_b   ! sea surface heigth (now, after, average) 
     39   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hu_e  , hv_e             ! now ocean depth ( = Ho+sshn_e ) 
     40   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hur_e , hvr_e            ! inverse of the now depth ( = 1/(Ho+sshn_e) ) 
    4341#endif 
    4442 
    4543   !!---------------------------------------------------------------------- 
    46  
     44   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009) 
     45   !! $Id$  
     46   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
     47   !!====================================================================== 
    4748END MODULE dynspg_oce 
  • trunk/NEMO/OPA_SRC/LDF/ldftra_c3d.h90

    r1152 r1566  
    3737      LOGICAL, INTENT (in) :: ld_print   ! If true, output arrays on numout 
    3838 
    39       !! * Local declarations 
    40       INTEGER ::   ji, jj, jk                   ! dummy loop indices 
    4139      !!---------------------------------------------------------------------- 
    4240 
  • trunk/NEMO/OPA_SRC/SOL/solmat.F90

    r1556 r1566  
    6666      !! * Local declarations 
    6767      INTEGER ::   ji, jj                    ! dummy loop indices 
    68       INTEGER ::   ii, ij, iiend, ijend      ! temporary integers 
    6968      REAL(wp) ::   zcoefs, zcoefw, zcoefe, zcoefn  ! temporary scalars 
    7069      REAL(wp) ::   z2dt, zcoef 
  • trunk/NEMO/OPA_SRC/istate.F90

    r1528 r1566  
    2929   USE zdf_oce         ! ocean vertical physics 
    3030   USE phycst          ! physical constants 
    31    USE wzvmod          ! verctical velocity               (wzv     routine) 
    3231   USE dtatem          ! temperature data                 (dta_tem routine) 
    3332   USE dtasal          ! salinity data                    (dta_sal routine) 
  • trunk/NEMO/OPA_SRC/stpctl.F90

    r1561 r1566  
    145145      IF( lk_dynspg_flt ) THEN      ! elliptic solver statistics (if required) 
    146146         ! 
    147          IF(lwp) WRITE(numsol,9200) kt, niter, res, SQRT(epsr)/eps      ! Solver 
     147         IF(lwp) WRITE(numsol,9200) kt, niter, res, SQRT(epsr)/eps       ! Solver 
    148148         ! 
    149          IF( kindic < 0 .AND. zsmin > 0.e0 .AND. zumax <= 20.e0 ) THEN                                          ! create a abort file if problem found  
     149         IF( kindic < 0 .AND. zsmin > 0.e0 .AND. zumax <= 20.e0 ) THEN   ! create a abort file if problem found  
    150150            IF(lwp) THEN 
    151151               WRITE(numout,*) ' stpctl: the elliptic solver DO not converge or explode' 
Note: See TracChangeset for help on using the changeset viewer.