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 4616 for branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/OPA_SRC/module_example – NEMO

Ignore:
Timestamp:
2014-04-06T17:28:25+02:00 (10 years ago)
Author:
gm
Message:

#1260 : see the associated wiki page for explanation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/OPA_SRC/module_example

    r4147 r4616  
    1919   USE module_name1   ! brief description of the used module 
    2020   USE module_name2   ! .... 
     21   ! 
     22   USE in_out_manager ! I/O manager 
     23   USE prtctl         ! Print control 
     24   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
     25   USE lib_mpp        ! MPP library 
     26   USE wrk_nemo       ! Memory Allocation 
     27   USE timing         ! Timing 
    2128 
    2229   IMPLICIT NONE 
     
    8794      !!---------------------------------------------------------------------- 
    8895      USE toto_module      ! description of the module 
    89       USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
    90       USE wrk_nemo, ONLY:   zztab => wrk_2d_5                     ! 2D workspace 
    91       USE wrk_nemo, ONLY:   zwx => wrk_3d_12 , zwy => wrk_3d_13   ! 3D workspace 
    92       !! 
     96      ! 
    9397      INTEGER , INTENT(in   )                     ::   kt      ! short description  
    9498      INTEGER , INTENT(inout)                     ::   pvar1   !   -         - 
    9599      REAL(wp), INTENT(  out)                     ::   pvar2   !   -         - 
    96100      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pvar2   !   -         - 
    97       !! 
     101      ! 
    98102      INTEGER  ::   ji, jj, jk       ! dummy loop arguments  (DOCTOR : start with j, but not jp) 
    99103      INTEGER  ::   itoto, itata     ! temporary integers    (DOCTOR : start with i 
    100104      REAL(wp) ::   zmlmin, zbbrau   ! temporary scalars     (DOCTOR : start with z) 
    101105      REAL(wp) ::   zfact1, zfact2   ! do not use continuation lines in declaration 
     106      REAL(wp), POINTER, DIMENSION(:,:,:  ) ::  zwrku, zwrkv     ! 2D workspace as pointers 
     107      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  zavm, zavt       ! 3D workspace as pointers 
    102108      !!-------------------------------------------------------------------- 
    103109 
    104       IF( wrk_in_use(3, 12,13) .OR. wrk_in_use(2, 5 ) THEN 
    105          CALL ctl_stop('exa_mpl: requested workspace arrays unavailable')   ;   RETURN 
    106       ENDIF 
     110      IF( nn_timing == 1 )   CALL timing_start('exa_mpl') 
     111 
     112      CALL wrk_alloc( jpi, jpj, jpk, zavm , zavt  )         ! assign workspace pointers to already allocated arrays 
     113      CALL wrk_alloc( jpi, jpj     , zwrku, zwrkv ) 
    107114 
    108115      IF( kt == nit000  )   CALL exa_mpl_init    ! Initialization (first time-step only) 
     
    137144      CALL mpplnk2( avmu, 'U', 1. )              ! Lateral boundary conditions (unchanged sign) 
    138145      ! 
    139       IF( wrk_not_released(3, 12,13) .OR. wrk_not_released(2, 5 ) THEN 
    140          CALL ctl_stop('exa_mpl: failed to release workspace arrays')   ;   RETURN 
    141       ENDIF 
     146      CALL wrk_dealloc( jpi, jpj, jpk,       zfu_t , zfv_t , zfu_f , zfv_f, zfu_uw, zfv_vw, zfu, zfv, zfw ) 
     147      CALL wrk_dealloc( jpi, jpj, jpk, jpts, zlu_uu, zlv_vv, zlu_uv, zlv_vu                               ) 
     148      ! 
     149      IF( nn_timing == 1 )  CALL timing_stop('dyn_adv_ubs') 
    142150      ! 
    143151   END SUBROUTINE exa_mpl 
     
    157165      !!---------------------------------------------------------------------- 
    158166      INTEGER ::   ji, jj, jk, jit   ! dummy loop indices 
    159       INTEGER  ::   ios              ! Local integer output status for namelist read 
    160       !! 
     167      INTEGER ::   ios               ! Local integer output status for namelist read 
     168      ! 
    161169      NAMELIST/namexa/ exa_v1, exa_v2, nexa_0, sn_ex      
    162170      !!---------------------------------------------------------------------- 
    163171      ! 
    164       REWIND( numnam_ref )              ! Namelist namexa in reference namelist : Example 
     172      REWIND( numnam_ref )             ! Namelist namexa in reference namelist : Example 
    165173      READ  ( numnam_ref, namexa, IOSTAT = ios, ERR = 901) 
    166174901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namexa in reference namelist', lwp ) 
    167  
    168       REWIND( numnam_cfg )              ! Namelist namexa in configuration namelist : Example 
     175      ! 
     176      REWIND( numnam_cfg )             ! Namelist namexa in configuration namelist : Example 
    169177      READ  ( numnam_cfg, namexa, IOSTAT = ios, ERR = 902 ) 
    170178902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namexa in configuration namelist', lwp ) 
    171    ! Output namelist for control 
    172       WRITE ( numond, namexa ) 
     179      ! 
     180      WRITE ( numond, namexa )         ! Output namelist for control 
     181 
    173182      ! 
    174183      IF(lwp) THEN                              ! Control print 
Note: See TracChangeset for help on using the changeset viewer.