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 2689 for branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_oce.F90 – NEMO

Ignore:
Timestamp:
2011-03-15T15:49:11+01:00 (13 years ago)
Author:
gm
Message:

dynamic mem: #785 ; bug correction (sshn_b allocated twice) + style in time splitting case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_oce.F90

    r2684 r2689  
    33   !!                       ***  MODULE dynspg_oce  *** 
    44   !!        
    5    !! Ocean dynamics: Define in memory surface pressure gradient variables 
     5   !! Ocean dynamics: Define in memory some surface pressure gradient variables 
    66   !!====================================================================== 
    77   !! History :  1.0  ! 2005-12  (C. Talandier, G. Madec)  Original code 
     
    99   !!---------------------------------------------------------------------- 
    1010   USE par_oce        ! ocean parameters 
     11   USE lib_mpp        ! MPP library 
    1112 
    1213   IMPLICIT NONE 
    1314   PUBLIC            
    1415 
     16   PUBLIC   dynspg_oce_alloc   ! called in dynspg.F90 
     17    
    1518   !                                                       !!! Surface pressure gradient logicals 
    1619#if   defined key_dynspg_exp  ||  defined key_esopa 
     
    3033#endif 
    3134 
    32 #if   defined key_dynspg_ts   ||   defined key_vvl   ||   defined key_esopa  
    33   !                                                                !!! Time splitting scheme (sub-time step variables)  
     35  !                                                                         !!! Time splitting scheme (key_dynspg_ts)  
     36   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshn_e, ssha_e   ! sea surface heigth (now, after, average) 
    3437   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ua_e  , va_e     ! barotropic velocities (after) 
    35    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshn_e, ssha_e   ! sea surface heigth (now, after, average) 
    3638   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hu_e  , hv_e     ! now ocean depth ( = Ho+sshn_e ) 
    37    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hur_e , hvr_e    ! inverse of the now depth ( = 1/(Ho+sshn_e) ) 
    38 #endif    !!---------------------------------------------------------------------- 
     39   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hur_e , hvr_e    ! inverse of hu_e and hv_e 
     40   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshn_b       ! before field without time-filter 
    3941 
    40    !! NEMO/OPA 4.0 , LODYC-IPSL  (2011) 
    41    !! $Id$  
     42   !!---------------------------------------------------------------------- 
     43   !! NEMO/OPA 4.0 , NEMO Consortium (2011) 
     44   !! $Id$ 
    4245   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     46   !!---------------------------------------------------------------------- 
     47CONTAINS 
     48 
     49   INTEGER FUNCTION dynspg_oce_alloc() 
     50      !!---------------------------------------------------------------------- 
     51      !!                  ***  routine dynspg_oce_alloc  *** 
     52      !!---------------------------------------------------------------------- 
     53      ALLOCATE( sshn_e(jpi,jpj) , ua_e(jpi,jpj) , hu_e(jpi,jpj) , hur_e(jpi,jpj) ,      & 
     54         &      ssha_e(jpi,jpj) , va_e(jpi,jpj) , hv_e(jpi,jpj) , hvr_e(jpi,jpj) ,      & 
     55         &      sshn_b(jpi,jpj)                                                  , STAT = dynspg_oce_alloc ) 
     56         ! 
     57      IF( lk_mpp                )   CALL mpp_sum ( dynspg_oce_alloc ) 
     58      IF( dynspg_oce_alloc /= 0 )   CALL ctl_warn('dynspg_oce_alloc: failed to allocate arrays') 
     59      ! 
     60   END FUNCTION dynspg_oce_alloc 
     61 
    4362   !!====================================================================== 
    4463END MODULE dynspg_oce 
Note: See TracChangeset for help on using the changeset viewer.