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 2594 for branches/dev_r2586_dynamic_mem – NEMO

Ignore:
Timestamp:
2011-02-18T18:31:18+01:00 (13 years ago)
Author:
trackstand2
Message:

Removed F2003-only bounds-remapping and added _alloc routine instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90

    r2590 r2594  
    3131   PRIVATE 
    3232 
    33    PUBLIC tra_ldf_iso_grif   ! routine called by traldf.F90 
    34  
    35    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   psix_eiv 
    36    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   psiy_eiv 
    37    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   ah_wslp2 
     33   PUBLIC tra_ldf_iso_grif       ! routine called by traldf.F90 
     34   PUBLIC tra_ldf_iso_grif_alloc ! routine called by nemogcm.F90 
     35 
     36   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE       ::   psix_eiv 
     37   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE       ::   psiy_eiv 
     38   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE       ::   ah_wslp2 
     39   REAL(wp),         DIMENSION(:,:,:), ALLOCATABLE, SAVE ::   zdkt  ! 2D+1 workspace 
    3840 
    3941   !! * Substitutions 
     
    4850   !!---------------------------------------------------------------------- 
    4951CONTAINS 
     52 
     53  FUNCTION tra_ldf_iso_grif_alloc() 
     54      !!---------------------------------------------------------------------- 
     55      !!                ***  ROUTINE tra_ldf_iso_grif_alloc  *** 
     56      !!---------------------------------------------------------------------- 
     57      INTEGER :: tra_ldf_iso_grif_alloc 
     58      !!---------------------------------------------------------------------- 
     59 
     60      ALLOCATE(zdkt(jpi,jpj,0:1), Stat=tra_ldf_iso_grif_alloc) 
     61 
     62      IF(tra_ldf_iso_grif_alloc /= 0)THEN 
     63         CALL ctl_warn('tra_ldf_iso_grif_alloc : allocation of arrays failed.') 
     64      END IF 
     65 
     66  END FUNCTION tra_ldf_iso_grif_alloc 
     67 
    5068 
    5169  SUBROUTINE tra_ldf_iso_grif( kt, cdtype, pgu, pgv,              & 
     
    94112      USE wrk_nemo, ONLY: wrk_use, wrk_release 
    95113      USE wrk_nemo, ONLY: zdit => wrk_3d_1, zdjt => wrk_3d_2, ztfw => wrk_3d_3 
    96       USE wrk_nemo, ONLY: wrk_3d_4 ! For 2D+1 workspace 
     114      !USE wrk_nemo, ONLY: wrk_3d_4 ! For 2D+1 workspace 
    97115      USE wrk_nemo, ONLY: z2d => wrk_2d_1 ! Only used if key_diaar5 defined 
    98116      !! 
     
    111129      REAL(wp) ::  zmskv, zabe2, zcof2, zcoef4   !   -      - 
    112130      REAL(wp) ::  zcoef0, zbtr                  !   -      - 
    113       REAL(wp), POINTER, DIMENSION(:,:,:) ::   zdkt           ! 2D+1 workspace 
     131      !REAL(wp), POINTER, DIMENSION(:,:,:) ::   zdkt           ! 2D+1 workspace 
    114132      ! 
    115133      REAL(wp) ::   zslope_skew, zslope_iso, zslope2, zbu, zbv 
     
    121139      !!---------------------------------------------------------------------- 
    122140 
    123       ! Check that workspace arrays are free for use and set-up pointer into 
    124       ! sub-array of a 3D workspace 
    125       IF( (.NOT. wrk_use(3, 1,2,3,4)) .OR. (.NOT. wrk_use(2, 1)))THEN 
     141      ! Check that workspace arrays are free for use 
     142      IF( (.NOT. wrk_use(3, 1,2,3)) .OR. (.NOT. wrk_use(2, 1)))THEN 
    126143         CALL ctl_stop('tra_ldf_iso_grif : requested workspace arrays unavailable.') 
    127144         RETURN 
    128145      END IF 
    129       zdkt(1:jpi,1:jpj,0:1) => wrk_3d_4(:,:,1:2) 
     146      ! ARP - line below uses 'bounds re-mapping' which is only defined in 
     147      ! Fortran 2003 and up. We would be OK if code was written to use 
     148      ! zdkt(:,:,1:2) instead as then wouldn't need to re-map bounds. 
     149      ! As it is, we make zdkt a module array and allocate it in _alloc(). 
     150      !zdkt(1:jpi,1:jpj,0:1) => wrk_3d_4(:,:,1:2) 
    130151 
    131152      IF( kt == nit000 )  THEN 
Note: See TracChangeset for help on using the changeset viewer.