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 2715 for trunk/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 – NEMO

Ignore:
Timestamp:
2011-03-30T17:58:35+02:00 (13 years ago)
Author:
rblod
Message:

First attempt to put dynamic allocation on the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90

    r2528 r2715  
    66   !! History:   -   ! 2005-04 (M. Vancoppenolle) Original code 
    77   !!           3.0  ! 2008-03 (C. Ethe) restart files in using IOM interface 
     8   !!           4.0  ! 2011-02 (G. Madec) dynamical allocation 
    89   !!---------------------------------------------------------------------- 
    910#if defined key_lim3 
     
    2223   USE in_out_manager   ! I/O manager 
    2324   USE iom              ! I/O library 
     25   USE lib_mpp          ! MPP library 
    2426 
    2527   IMPLICIT NONE 
     
    3436 
    3537   !!---------------------------------------------------------------------- 
    36    !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010) 
     38   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) 
    3739   !! $Id$ 
    3840   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    9092      !! ** purpose  :   output of sea-ice variable in a netcdf file 
    9193      !!---------------------------------------------------------------------- 
     94      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
     95      USE wrk_nemo, ONLY:   z2d  => wrk_2d_1   ! 2D workspace 
     96      ! 
    9297      INTEGER, INTENT(in) ::   kt     ! number of iteration 
    9398      !! 
     
    96101      CHARACTER(len=15) ::   znam 
    97102      CHARACTER(len=1)  ::   zchar, zchar1 
    98       REAL(wp), DIMENSION(jpi,jpj) :: z2d 
    99       !!---------------------------------------------------------------------- 
     103      !!---------------------------------------------------------------------- 
     104 
     105      IF( wrk_in_use(2, 1) ) THEN 
     106         CALL ctl_stop( 'lim_rst_write : requested workspace arrays unavailable' )   ;   RETURN 
     107      END IF 
    100108 
    101109      iter = kt + nn_fsbc - 1   ! ice restarts are written at kt == nitrst - nn_fsbc + 1 
     
    287295      ENDIF 
    288296      ! 
     297      IF( wrk_not_released(2, 1) )   CALL ctl_stop( 'lim_rst_write : failed to release workspace arrays' ) 
     298      ! 
    289299   END SUBROUTINE lim_rst_write 
    290300 
     
    296306      !! ** purpose  :   read of sea-ice variable restart in a netcdf file 
    297307      !!---------------------------------------------------------------------- 
     308      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
     309      USE wrk_nemo, ONLY:   z2d  => wrk_2d_1   ! 2D workspace 
     310      ! 
    298311      INTEGER :: ji, jj, jk, jl, indx 
    299312      REAL(wp) ::   zfice, ziter 
    300313      REAL(wp) ::   zs_inf, z_slope_s, zsmax, zsmin, zalpha, zindb   ! local scalars used for the salinity profile 
    301314      REAL(wp), DIMENSION(nlay_i)  ::   zs_zero  
    302       REAL(wp), DIMENSION(jpi,jpj) ::   z2d 
    303315      CHARACTER(len=15) ::   znam 
    304316      CHARACTER(len=1)  ::   zchar, zchar1 
     
    307319      !!---------------------------------------------------------------------- 
    308320 
     321      IF( wrk_in_use(2, 1) ) THEN 
     322         CALL ctl_stop( 'lim_rst_read : requested workspace arrays unavailable.' )   ;   RETURN 
     323      ENDIF 
     324 
    309325      IF(lwp) THEN 
    310326         WRITE(numout,*) 
    311327         WRITE(numout,*) 'lim_rst_read : read ice NetCDF restart file' 
    312          WRITE(numout,*) '~~~~~~~~~~~~~~' 
     328         WRITE(numout,*) '~~~~~~~~~~~~~' 
    313329      ENDIF 
    314330 
     
    554570      CALL iom_close( numrir ) 
    555571      ! 
     572      IF( wrk_not_released(2, 1) ) THEN 
     573         CALL ctl_stop( 'lim_rst_read : failed to release workspace arrays.' ) 
     574      END IF 
     575      ! 
    556576   END SUBROUTINE lim_rst_read 
    557577 
Note: See TracChangeset for help on using the changeset viewer.