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 2630 – NEMO

Changeset 2630


Ignore:
Timestamp:
2011-02-28T12:19:20+01:00 (13 years ago)
Author:
trackstand2
Message:

Changed TOP/C14b to use dynamic memory

Location:
branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO
Files:
3 edited

Legend:

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

    r2629 r2630  
    3636   !!   nemo_closefile : close remaining open files 
    3737   !!   nemo_alloc     : dynamical allocation 
    38    !!   nemo_partition : ??? 
    39    !!   nemo_partition : ??? 
    40    !!   factorise      : ??? 
     38   !!   nemo_partition : calculate MPP domain decomposition 
     39   !!   factorise      : calculate the factors of the no. of MPI processes 
    4140   !!---------------------------------------------------------------------- 
    4241   USE step_oce        ! module used in the ocean time stepping module 
     
    471470     USE trc_oce,      ONLY: trc_oce_alloc 
    472471 
    473       
    474472#if defined key_obc 
    475473     USE obcdta ,      ONLY: obc_dta_alloc 
     
    477475#endif 
    478476 
    479       USE wrk_nemo,     ONLY: wrk_alloc 
     477      USE wrk_nemo,    ONLY: wrk_alloc 
    480478 
    481479      INTEGER :: ierr 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90

    r2528 r2630  
    44   !! TOP : Bomb C14 main module 
    55   !!====================================================================== 
    6    !! History     -   ! 1994-05 ( J. Orr ) origial code 
     6   !! History     -   ! 1994-05 ( J. Orr ) original code 
    77   !!            1.0  ! 2006-02 ( J.M. Molines )  Free form + modularity 
    88   !!            2.0  ! 2008-12 ( C. Ethe ) reorganisation 
     9   !!            4.0  ! 2011-02 ( A.R. Porter, STFC Daresbury ) Dynamic memory 
    910   !!---------------------------------------------------------------------- 
    1011#if defined key_c14b 
     
    2526 
    2627   !! * Routine accessibility 
    27    PUBLIC   trc_sms_c14b       ! called in ???     
     28   PUBLIC   trc_sms_c14b       ! called in trcsms.F90 
     29   PUBLIC   trc_sms_c14b_alloc ! called in nemogcm.F90 
    2830 
    2931   !! * Module variables 
     
    3739   INTEGER , PUBLIC    ::   nyear_beg        ! initial year (aa)  
    3840 
    39    REAL(wp), PUBLIC, DIMENSION(jpmaxrec,jpzon) ::  bomb   !: C14 atm data (3 zones) 
    40    REAL(wp), PUBLIC, DIMENSION(jpi,jpj ,jpzon) ::  fareaz !: Spatial Interpolation Factors 
    41    REAL(wp), PUBLIC, DIMENSION(jpmaxrec2)      ::  spco2  !: Atmospheric CO2 
     41   REAL(wp), PUBLIC,           DIMENSION(jpmaxrec,jpzon) ::  bomb   !: C14 atm data (3 zones) 
     42   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  fareaz !: Spatial Interpolation Factors 
     43   REAL(wp), PUBLIC,                DIMENSION(jpmaxrec2)  ::  spco2  !: Atmospheric CO2 
    4244   
    43    REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   qtr_c14      !: flux at surface 
    44    REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   qint_c14     !: cumulative flux 
     45   REAL(wp), PUBLIC, ALLOCATABLE, SAVE,   DIMENSION(:,:)  ::   qtr_c14      !: flux at surface 
     46   REAL(wp), PUBLIC, ALLOCATABLE, SAVE,   DIMENSION(:,:)  ::   qint_c14     !: cumulative flux 
    4547 
    4648   REAL(wp) :: xlambda, xdecay, xaccum       ! C14 decay coef.   
     
    6062 
    6163CONTAINS 
     64 
     65  FUNCTION trc_sms_c14b_alloc() 
     66     !!---------------------------------------------------------------------- 
     67     !!                  ***  ROUTINE trc_sms_c14b_alloc  *** 
     68     !!---------------------------------------------------------------------- 
     69     INTEGER :: trc_sms_c14b_alloc  ! Return value 
     70     !!---------------------------------------------------------------------- 
     71 
     72     ALLOCATE(fareaz(jpi,jpj ,jpzon), & 
     73              qtr_c14(jpi,jpj)      , & 
     74              qint_c14(jpi,jpj)     , Stat=trc_sms_c14b_alloc) 
     75 
     76     IF (trc_sms_c14b_alloc /= 0) CALL ctl_warn('trc_sms_c14b_alloc : failed to allocate arrays.') 
     77 
     78  END FUNCTION trc_sms_c14b_alloc 
     79 
    6280 
    6381  SUBROUTINE trc_sms_c14b( kt ) 
     
    96114     !! 
    97115     !!---------------------------------------------------------------------- 
     116     USE wrk_nemo, ONLY: wrk_use, wrk_release 
     117     USE wrk_nemo, ONLY: zatmbc14 => wrk_2d_1 
     118     USE wrk_nemo, ONLY:     zw3d => wrk_3d_1 
    98119     !! * Arguments 
    99120     INTEGER, INTENT( in ) ::   kt    ! ocean time-step index 
     
    110131       imonth2, in1, in2 
    111132          
    112      REAL(wp), DIMENSION(jpi,jpj) ::  &  
    113        zatmbc14 
    114  
    115133     REAL(wp), DIMENSION(jpzon)   ::  & 
    116134       zonbc14              !: time interp atm C14 
     
    126144       zpv  ,        &      !: piston velocity  
    127145       zdemi, ztra 
    128 #if defined key_diatrc  && defined key_iomput 
    129       REAL(wp), DIMENSION(jpi,jpj,jpk) :: zw3d 
    130 #endif 
    131146      !!---------------------------------------------------------------------- 
     147 
     148      IF( (.NOT. wrk_use(2, 1)) .OR. (.NOT. wrk_use(3, 1)) )THEN 
     149         CALL ctl_stop('trc_sms_c14b : requested workspace arrays unavailable.') 
     150         RETURN 
     151      END IF 
    132152 
    133153      IF( kt == nit000 )  THEN 
     
    311331      END IF 
    312332 
     333      IF( (.NOT. wrk_release(2, 1)) .OR. (.NOT. wrk_release(3, 1)) )THEN 
     334         CALL ctl_stop('trc_sms_c14b : failed to release workspace arrays.') 
     335      END IF 
     336 
    313337    END SUBROUTINE trc_sms_c14b 
    314338 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r2628 r2630  
    204204     USE trcsms_cfc     , ONLY:   trc_sms_cfc_alloc 
    205205#endif 
     206#if defined key_c14b 
     207     USE trcsms_c14b    , ONLY:   trc_sms_c14b_alloc 
     208#endif 
    206209#if defined key_lobster 
    207210      USE sms_lobster   , ONLY:   sms_lobster_alloc      ! LOBSTER-related alloc routines... 
     
    228231      ierr = ierr + trd_mld_trc_alloc() 
    229232#endif 
     233#if defined key_cfc 
     234      ierr = ierr + trc_sms_cfc_alloc() 
     235#endif 
     236#if defined key_c14b 
     237      ierr = ierr + trc_sms_c14b_alloc() 
     238#endif 
    230239      ! 
    231240#if defined key_lobster 
Note: See TracChangeset for help on using the changeset viewer.