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 5902 for branches/2015/dev_r5847_MERCATOR9_solveur_simplification/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90 – NEMO

Ignore:
Timestamp:
2015-11-20T10:58:48+01:00 (8 years ago)
Author:
jchanut
Message:

Free surface simplification #1620. Step 3: Step readibility, suppress cpp key_dynspg_xxx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5847_MERCATOR9_solveur_simplification/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90

    r5869 r5902  
    66   !! History :  1.0  ! 2005-12  (C. Talandier, G. Madec, V. Garnier)  Original code 
    77   !!            3.2  ! 2009-07  (R. Benshila)  Suppression of rigid-lid option 
    8    !!---------------------------------------------------------------------- 
    9  
    10    !!---------------------------------------------------------------------- 
    11    !!   dyn_spg     : update the dynamics trend with the lateral diffusion 
    12    !!   dyn_spg_ctl : initialization, namelist read, and parameters control 
     8   !!            3.7  ! 2015-11  (J. Chanut) Suppression of filtered free surface  
     9   !!---------------------------------------------------------------------- 
     10 
     11   !!---------------------------------------------------------------------- 
     12   !!   dyn_spg     : update the dynamics trend with surface pressure gradient  
     13   !!   dyn_spg_init: initialization, namelist read, and parameters control 
    1314   !!---------------------------------------------------------------------- 
    1415   USE oce            ! ocean dynamics and tracers variables 
     
    1819   USE sbc_oce        ! surface boundary condition: ocean 
    1920   USE sbcapr         ! surface boundary condition: atmospheric pressure 
    20    USE dynspg_oce     ! surface pressure gradient variables 
    2121   USE dynspg_exp     ! surface pressure gradient     (dyn_spg_exp routine) 
    2222   USE dynspg_ts      ! surface pressure gradient     (dyn_spg_ts  routine) 
    23    USE dynadv         ! dynamics: vector invariant versus flux form 
    2423   USE sbctide 
    2524   USE updtide 
     
    4039   PUBLIC   dyn_spg_init   ! routine called by opa module 
    4140 
    42    INTEGER ::   nspg = 0   ! type of surface pressure gradient scheme defined from lk_dynspg_...  
     41   INTEGER ::   nspg = 0   ! type of surface pressure gradient scheme defined from ln_dynspg_...  
    4342 
    4443   !! * Substitutions 
     
    6362      !!gm            the after velocity, in the 2 other (ua,va) are still the trends 
    6463      !! 
    65       !! ** Method  :   Three schemes: 
     64      !! ** Method  :   Two schemes: 
    6665      !!              - explicit computation      : the spg is evaluated at now 
    67       !!              - filtered computation      : the Roulet & madec (2000) technique is used 
    6866      !!              - split-explicit computation: a time splitting technique is used 
    6967      !! 
     
    9997 
    10098      IF(      ln_apr_dyn                                                &   ! atmos. pressure 
    101          .OR.  ( .NOT.lk_dynspg_ts .AND. (ln_tide_pot .AND. lk_tide) )   &   ! tide potential (no time slitting) 
     99         .OR.  ( .NOT.ln_dynspg_ts .AND. (ln_tide_pot .AND. lk_tide) )   &   ! tide potential (no time slitting) 
    102100         .OR.  nn_ice_embd == 2  ) THEN                                      ! embedded sea-ice 
    103101         ! 
     
    109107         END DO          
    110108         ! 
    111          IF( ln_apr_dyn .AND. (.NOT. lk_dynspg_ts) ) THEN                    !==  Atmospheric pressure gradient (added later in time-split case) ==! 
     109         IF( ln_apr_dyn .AND. (.NOT. ln_dynspg_ts) ) THEN                    !==  Atmospheric pressure gradient (added later in time-split case) ==! 
    112110            zg_2 = grav * 0.5 
    113111            DO jj = 2, jpjm1                          ! gradient of Patm using inverse barometer ssh 
     
    122120         ! 
    123121         !                                    !==  tide potential forcing term  ==! 
    124          IF( .NOT.lk_dynspg_ts .AND. ( ln_tide_pot .AND. lk_tide )  ) THEN   ! N.B. added directly at sub-time-step in ts-case 
     122         IF( .NOT.ln_dynspg_ts .AND. ( ln_tide_pot .AND. lk_tide )  ) THEN   ! N.B. added directly at sub-time-step in ts-case 
    125123            ! 
    126124            CALL upd_tide( kt )                      ! update tide potential 
     
    190188      !!                  ***  ROUTINE dyn_spg_init  *** 
    191189      !!                 
    192       !! ** Purpose :   Control the consistency between cpp options for  
     190      !! ** Purpose :   Control the consistency between namelist options for  
    193191      !!              surface pressure gradient schemes 
    194192      !!---------------------------------------------------------------------- 
    195       INTEGER ::   ioptio 
     193      INTEGER ::   ioptio, ios 
     194      ! 
     195      NAMELIST/namdyn_spg/ ln_dynspg_exp, ln_dynspg_ts 
    196196      !!---------------------------------------------------------------------- 
    197197      ! 
    198198      IF( nn_timing == 1 )  CALL timing_start('dyn_spg_init') 
    199199      ! 
    200       IF(lwp) THEN             ! Control print 
     200      REWIND( numnam_ref )              ! Namelist namdyn_spg in reference namelist : Free surface 
     201      READ  ( numnam_ref, namdyn_spg, IOSTAT = ios, ERR = 901) 
     202901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_spg in reference namelist', lwp ) 
     203 
     204      REWIND( numnam_cfg )              ! Namelist namdyn_spg in configuration namelist : Free surface 
     205      READ  ( numnam_cfg, namdyn_spg, IOSTAT = ios, ERR = 902 ) 
     206902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_spg in configuration namelist', lwp ) 
     207      IF(lwm) WRITE ( numond, namdyn_spg ) 
     208      ! 
     209      IF(lwp) THEN             ! Namelist print 
    201210         WRITE(numout,*) 
    202211         WRITE(numout,*) 'dyn_spg_init : choice of the surface pressure gradient scheme' 
    203212         WRITE(numout,*) '~~~~~~~~~~~' 
    204          WRITE(numout,*) '     Explicit free surface                  lk_dynspg_exp = ', lk_dynspg_exp 
    205          WRITE(numout,*) '     Free surface with time splitting       lk_dynspg_ts  = ', lk_dynspg_ts 
    206       ENDIF 
    207  
    208       IF( lk_dynspg_ts ) CALL dyn_spg_ts_init( nit000 ) 
    209       ! (do it now, to set nn_baro, used to allocate some arrays later on) 
    210       !                        ! allocate dyn_spg arrays 
    211       IF( lk_dynspg_ts ) THEN 
    212          IF( dynspg_oce_alloc() /= 0 )   CALL ctl_stop('STOP', 'dyn_spg_init: failed to allocate dynspg_oce arrays') 
     213         WRITE(numout,*) '     Explicit free surface                  ln_dynspg_exp = ', ln_dynspg_exp 
     214         WRITE(numout,*) '     Free surface with time splitting       ln_dynspg_ts  = ', ln_dynspg_ts 
     215      ENDIF 
     216 
     217      IF( ln_dynspg_ts ) THEN 
     218         CALL dyn_spg_ts_init( nit000  ) ! do it first, to set nn_baro, used to allocate some arrays later on 
     219         !                               ! allocate dyn_spg arrays 
    213220         IF( dyn_spg_ts_alloc() /= 0 )   CALL ctl_stop('STOP', 'dyn_spg_init: failed to allocate dynspg_ts  arrays') 
    214221         IF ((neuler/=0).AND.(ln_bt_fw)) CALL ts_rst( nit000, 'READ' ) 
     
    217224      !                        ! Control of surface pressure gradient scheme options 
    218225      ioptio = 0 
    219       IF(lk_dynspg_exp)   ioptio = ioptio + 1 
    220       IF(lk_dynspg_ts )   ioptio = ioptio + 1 
     226      IF(ln_dynspg_exp)   ioptio = ioptio + 1 
     227      IF(ln_dynspg_ts )   ioptio = ioptio + 1 
    221228      ! 
    222229      IF(  ioptio > 1  .OR. ( ioptio == 0 .AND. .NOT. lk_c1d ) )   & 
    223            &   CALL ctl_stop( ' Choose only one surface pressure gradient scheme with a key cpp' ) 
    224       IF( ( lk_dynspg_ts .OR. lk_dynspg_exp ) .AND. ln_isfcav )   & 
    225            &   CALL ctl_stop( ' dynspg_ts and dynspg_exp not tested with ice shelf cavity ' ) 
    226       ! 
    227       IF( lk_dynspg_exp)   nspg =  0 
    228       IF( lk_dynspg_ts )   nspg =  1 
    229  
     230           &   CALL ctl_stop( ' Choose only one surface pressure gradient scheme' ) 
     231      IF( ln_dynspg_ts .AND. ln_isfcav )   & 
     232           &   CALL ctl_stop( ' dynspg_ts not tested with ice shelf cavity ' ) 
     233      ! 
     234      IF( ln_dynspg_exp)   nspg =  0 
     235      IF( ln_dynspg_ts )   nspg =  1 
    230236      ! 
    231237      IF(lwp) THEN 
Note: See TracChangeset for help on using the changeset viewer.