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 2643 for branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

Ignore:
Timestamp:
2011-03-02T19:38:35+01:00 (13 years ago)
Author:
cetlod
Message:

Changed TOP/PISCES to use dynamic memory & improve the others TOP modules

Location:
branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90

    r2636 r2643  
    2525   USE traadv_eiv      ! eddy induced velocity     (tra_adv_eiv    routine) 
    2626   USE ldftra_oce      ! lateral diffusion coefficient on tracers 
    27    USE in_out_manager  ! I/O manager 
    28    USE lib_mpp         ! MPP library 
    2927   USE prtctl_trc      ! Print control 
    3028 
     
    5048CONTAINS 
    5149 
    52    FUNCTION trc_adv_alloc() 
     50   INTEGER FUNCTION trc_adv_alloc() 
    5351      !!---------------------------------------------------------------------- 
    5452      !!                  ***  ROUTINE trc_adv_alloc  *** 
    5553      !!---------------------------------------------------------------------- 
    56       INTEGER :: trc_adv_alloc 
    57       !!---------------------------------------------------------------------- 
    58  
    59       ALLOCATE(r2dt(jpk), Stat=trc_adv_alloc) 
    60  
    61       IF(trc_adv_alloc /= 0)THEN 
    62          CALL ctl_warn('trc_adv_alloc : failed to allocate array.') 
    63       END IF 
     54 
     55      ALLOCATE( r2dt(jpk), STAT=trc_adv_alloc ) 
     56 
     57      IF( trc_adv_alloc /= 0 ) CALL ctl_warn('trc_adv_alloc : failed to allocate array.') 
    6458 
    6559   END FUNCTION trc_adv_alloc 
     
    7569      !!---------------------------------------------------------------------- 
    7670      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 
    77       USE wrk_nemo, ONLY: zun => wrk_3d_1, zvn => wrk_3d_2, & 
    78                           zwn => wrk_3d_3   ! effective velocity 
     71      USE wrk_nemo, ONLY: zun => wrk_3d_4, zvn => wrk_3d_5, & 
     72                          zwn => wrk_3d_6   ! effective velocity 
    7973      !! 
    8074      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     
    8478      !!---------------------------------------------------------------------- 
    8579 
    86       IF(wrk_in_use(3, 1,2,3))THEN 
     80      IF( wrk_in_use(3, 4,5,6) ) THEN 
    8781         CALL ctl_stop('trc_adv : requested workspace arrays unavailable.') 
    8882         RETURN 
     
    10498      DO jk = 1, jpkm1 
    10599         !                                                ! eulerian transport only 
    106          zun(:,:,jk) = e2u(:,:) * fse3u(:,:,jk) * un(:,:,jk) 
    107          zvn(:,:,jk) = e1v(:,:) * fse3v(:,:,jk) * vn(:,:,jk) 
    108          zwn(:,:,jk) = e1t(:,:) * e2t(:,:)      * wn(:,:,jk) 
     100         zun(:,:,jk) = e2u  (:,:) * fse3u(:,:,jk) * un(:,:,jk) 
     101         zvn(:,:,jk) = e1v  (:,:) * fse3v(:,:,jk) * vn(:,:,jk) 
     102         zwn(:,:,jk) = e1e2t(:,:)                 * wn(:,:,jk) 
    109103         ! 
    110104      END DO 
     
    150144      END IF 
    151145      ! 
    152       IF(wrk_not_released(3, 1,2,3))THEN 
    153          CALL ctl_stop('trc_adv : failed to release workspace arrays.') 
    154       END IF 
     146      IF( wrk_not_released(3, 4,5,6) ) CALL ctl_stop('trc_adv : failed to release workspace arrays.') 
    155147      ! 
    156148   END SUBROUTINE trc_adv 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90

    r2528 r2643  
    2727   USE trdtra 
    2828   USE prtctl_trc      ! Print control 
    29    USE in_out_manager  ! I/O manager 
    30    USE lib_mpp         ! distribued memory computing library 
    31    USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    3229 
    3330   IMPLICIT NONE 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90

    r2636 r2643  
    5757      !!                   ***  ROUTINE trc_nxt_alloc  *** 
    5858      !!---------------------------------------------------------------------- 
    59       USE lib_mpp, ONLY: ctl_warn 
    60       !!---------------------------------------------------------------------- 
    6159      ! 
    62       ALLOCATE( r2dt(jpk), Stat=trc_nxt_alloc) 
     60      ALLOCATE( r2dt(jpk), STAT=trc_nxt_alloc) 
    6361      ! 
    6462      IF( trc_nxt_alloc /= 0 )   CALL ctl_warn('trc_nxt_alloc : failed to allocate array') 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90

    r2528 r2643  
    1717   USE trdmod_oce 
    1818   USE trdtra 
    19    USE lib_mpp 
    2019   USE prtctl_trc          ! Print control for debbuging 
    2120 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90

    r2636 r2643  
    2121   USE trdmod_oce 
    2222   USE trdtra 
    23    USE lib_mpp         ! MPP library 
    2423 
    2524   IMPLICIT NONE 
     
    5958      !!---------------------------------------------------------------------- 
    6059      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 
    61       USE wrk_nemo, zemps => wrk_2d_1 
     60      USE wrk_nemo, zemps  => wrk_2d_1 
     61      USE wrk_nemo, ztrtrd => wrk_3d_1 
    6262      ! 
    6363      INTEGER, INTENT( in ) ::   kt          ! ocean time-step index 
     
    6565      INTEGER  ::   ji, jj, jn           ! dummy loop indices 
    6666      REAL(wp) ::   zsrau, zse3t   ! temporary scalars 
    67       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrtrd 
    6867      CHARACTER (len=22) :: charout 
    6968      !!---------------------------------------------------------------------- 
    7069 
    71       IF(wrk_in_use(2, 1))THEN 
     70      IF( wrk_in_use(2, 1) .OR.  wrk_in_use(3, 1) ) THEN 
    7271         CALL ctl_stop('trc_sbc: requested workspace array unavailable.')   ;   RETURN 
    7372      END IF 
     
    7978      ENDIF 
    8079 
    81  
    82       IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) 
    8380 
    8481      IF( lk_offline ) THEN          ! emps in dynamical files contains emps - rnf 
     
    115112      END DO                                                     ! tracer loop 
    116113      !                                                          ! =========== 
    117       IF( l_trdtrc ) DEALLOCATE( ztrtrd ) 
    118  
    119114      IF( ln_ctl )   THEN 
    120115         WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout) 
     
    122117      ENDIF 
    123118 
    124       IF( wrk_not_released(2, 1) )   CALL ctl_stop('trc_sbc: failed to release workspace array') 
    125       ! 
     119      IF( wrk_not_released(2, 1) .OR. wrk_not_released(3, 1) )   & 
     120      &       CALL ctl_stop('trc_sbc: failed to release workspace array.') 
     121 
    126122   END SUBROUTINE trc_sbc 
    127123 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90

    r2636 r2643  
    2323   USE trdtra 
    2424   USE prtctl_trc      ! Print control 
    25    USE in_out_manager  ! I/O manager 
    26    USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    27    USE lib_mpp         ! MPP library 
    2825 
    2926   IMPLICIT NONE 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90

    r2636 r2643  
    244244      !!---------------------------------------------------------------------- 
    245245 
    246       IF(wrk_in_use(2, 1))THEN 
    247          CALL ctl_stop('trd_mld_bio_zint : requested workspace array unavailable.') 
    248          RETURN 
     246      IF( wrk_in_use(2, 1) ) THEN 
     247         CALL ctl_stop('trd_mld_bio_zint : requested workspace array unavailable.') ; RETURN 
    249248      END IF 
    250249 
     
    329328      END DO 
    330329 
    331       IF(wrk_not_released(2, 1))THEN 
    332          CALL ctl_stop('trd_mld_bio_zint : failed to release workspace array.') 
    333       END IF 
     330      IF( wrk_not_released(2, 1) ) CALL ctl_stop('trd_mld_bio_zint : failed to release workspace array.') 
    334331#endif 
    335332 
     
    912909      IF( lrst_trc )   CALL trd_mld_trc_rst_write( kt )  ! this must be after the array swap above (III.3) 
    913910 
    914       IF(wrk_not_released(3, 1,2,3,4,5,6,7,8,9))THEN 
    915          CALL ctl_stop('trd_mld_trc : failed to release workspace arrays.') 
    916       END IF 
     911      IF( wrk_not_released(3, 1,2,3,4,5,6,7,8,9) ) & 
     912      &   CALL ctl_stop('trd_mld_trc : failed to release workspace arrays.') 
    917913      ! 
    918914   END SUBROUTINE trd_mld_trc 
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90

    r2636 r2643  
    116116      tmltrd_csum_ub_bio                         !: before (prev. analysis period) cumulated sum over the 
    117117                                                 !: upper triangle 
    118 # endif 
     118#endif 
     119 
    119120   !!---------------------------------------------------------------------- 
    120121   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     
    155156               tmltrdm_trc(jpi,jpj,jptra),                   & 
    156157               Stat=ierr(1)) 
    157 # endif 
     158#endif 
     159 
    158160# if defined key_lobster 
    159161      ALLOCATE(tmltrd_bio(jpi,jpj,jpdiabio),         & 
Note: See TracChangeset for help on using the changeset viewer.