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_ts.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_ts.F90

    r5836 r5902  
    1111   !!             3.5  ! 2013-07  (J. Chanut) Switch to Forward-backward time stepping 
    1212   !!             3.6  ! 2013-11  (A. Coward) Update for z-tilde compatibility 
     13   !!             3.7  ! 2015-11  (J. Chanut) free surface simplification 
    1314   !!--------------------------------------------------------------------- 
    14 #if defined key_dynspg_ts 
    1515   !!---------------------------------------------------------------------- 
    16    !!   'key_dynspg_ts'         split explicit free surface 
     16   !!                       split explicit free surface 
    1717   !!---------------------------------------------------------------------- 
    1818   !!   dyn_spg_ts  : compute surface pressure gradient trend using a time- 
     
    2323   USE sbc_oce         ! surface boundary condition: ocean 
    2424   USE sbcisf          ! ice shelf variable (fwfisf) 
    25    USE dynspg_oce      ! surface pressure gradient variables 
    2625   USE phycst          ! physical constants 
    2726   USE dynvor          ! vorticity term 
    2827   USE bdy_par         ! for lk_bdy 
    29    USE bdytides        ! open boundary condition data      
    3028   USE bdydyn2d        ! open boundary conditions on barotropic variables 
    3129   USE sbctide         ! tides 
     
    4240   USE sbcapr          ! surface boundary condition: atmospheric pressure 
    4341   USE dynadv, ONLY: ln_dynadv_vec 
     42   USE bdytides 
    4443#if defined key_agrif 
    4544   USE agrif_opa_interp ! agrif 
     
    6766   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  ftnw, ftne   ! triad of coriolis parameter 
    6867   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  ftsw, ftse   ! (only used with een vorticity scheme) 
    69  
    70    ! Arrays below are saved to allow testing of the "no time averaging" option 
    71    ! If this option is not retained, these could be replaced by temporary arrays 
    72    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  sshbb_e, sshb_e, & ! Instantaneous barotropic arrays 
    73                                                    ubb_e, ub_e,     & 
    74                                                    vbb_e, vb_e 
    7568 
    7669   !! * Substitutions 
     
    8881      !!                  ***  routine dyn_spg_ts_alloc  *** 
    8982      !!---------------------------------------------------------------------- 
    90       INTEGER :: ierr(3) 
     83      INTEGER :: ierr(4) 
    9184      !!---------------------------------------------------------------------- 
    9285      ierr(:) = 0 
    9386 
    94       ALLOCATE( sshb_e(jpi,jpj), sshbb_e(jpi,jpj), & 
    95          &      ub_e(jpi,jpj)  , vb_e(jpi,jpj)   , & 
    96          &      ubb_e(jpi,jpj) , vbb_e(jpi,jpj)  , STAT= ierr(1) ) 
     87      ALLOCATE( ssha_e(jpi,jpj),  sshn_e(jpi,jpj), sshb_e(jpi,jpj), sshbb_e(jpi,jpj), & 
     88         &        ua_e(jpi,jpj),    ub_e(jpi,jpj),   ubb_e(jpi,jpj), & 
     89         &        va_e(jpi,jpj),    vb_e(jpi,jpj),   vbb_e(jpi,jpj), & 
     90         &        hu_e(jpi,jpj),   hur_e(jpi,jpj),   hv_e(jpi,jpj),   hvr_e(jpi,jpj), STAT= ierr(1) ) 
    9791 
    9892      ALLOCATE( wgtbtp1(3*nn_baro), wgtbtp2(3*nn_baro), zwz(jpi,jpj), STAT= ierr(2) ) 
     
    10195         &                          ftsw(jpi,jpj) , ftse(jpi,jpj) , STAT=ierr(3) ) 
    10296 
     97      ALLOCATE( ub2_b(jpi,jpj), vb2_b(jpi,jpj), un_adv(jpi,jpj), vn_adv(jpi,jpj), & 
     98#if defined key_agrif 
     99         &      ub2_i_b(jpi,jpj), vb2_i_b(jpi,jpj)                              , & 
     100#endif 
     101         &      STAT= ierr(4)) 
     102 
    103103      dyn_spg_ts_alloc = MAXVAL(ierr(:)) 
    104104 
    105105      IF( lk_mpp                )   CALL mpp_sum( dyn_spg_ts_alloc ) 
    106       IF( dyn_spg_ts_alloc /= 0 )   CALL ctl_warn('dynspg_oce_alloc: failed to allocate arrays') 
     106      IF( dyn_spg_ts_alloc /= 0 )   CALL ctl_warn('dyn_spg_ts_alloc: failed to allocate arrays') 
    107107      ! 
    108108   END FUNCTION dyn_spg_ts_alloc 
     
    11641164   END SUBROUTINE dyn_spg_ts_init 
    11651165 
    1166 #else 
    1167    !!--------------------------------------------------------------------------- 
    1168    !!   Default case :   Empty module   No split explicit free surface 
    1169    !!--------------------------------------------------------------------------- 
    1170 CONTAINS 
    1171    INTEGER FUNCTION dyn_spg_ts_alloc()    ! Dummy function 
    1172       dyn_spg_ts_alloc = 0 
    1173    END FUNCTION dyn_spg_ts_alloc 
    1174    SUBROUTINE dyn_spg_ts( kt )            ! Empty routine 
    1175       INTEGER, INTENT(in) :: kt 
    1176       WRITE(*,*) 'dyn_spg_ts: You should not have seen this print! error?', kt 
    1177    END SUBROUTINE dyn_spg_ts 
    1178    SUBROUTINE ts_rst( kt, cdrw )          ! Empty routine 
    1179       INTEGER         , INTENT(in) ::   kt         ! ocean time-step 
    1180       CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag 
    1181       WRITE(*,*) 'ts_rst    : You should not have seen this print! error?', kt, cdrw 
    1182    END SUBROUTINE ts_rst   
    1183    SUBROUTINE dyn_spg_ts_init( kt )       ! Empty routine 
    1184       INTEGER         , INTENT(in) ::   kt         ! ocean time-step 
    1185       WRITE(*,*) 'dyn_spg_ts_init   : You should not have seen this print! error?', kt 
    1186    END SUBROUTINE dyn_spg_ts_init 
    1187 #endif 
    1188     
    11891166   !!====================================================================== 
    11901167END MODULE dynspg_ts 
Note: See TracChangeset for help on using the changeset viewer.