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 for trunk/NEMO/OPA_SRC/DYN/dynspg.F90 – NEMO

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.