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/OPA_SRC/DYN/dynspg_flt.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/OPA_SRC/DYN/dynspg_flt.F90

    r2528 r2715  
    3131   USE dynadv          ! advection  
    3232   USE solmat          ! matrix construction for elliptic solvers 
    33    USE solver          ! solver initialization 
    3433   USE solpcg          ! preconditionned conjugate gradient solver 
    3534   USE solsor          ! Successive Over-relaxation solver 
     
    6362   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    6463   !! $Id$ 
    65    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    66    !!---------------------------------------------------------------------- 
    67  
     64   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     65   !!---------------------------------------------------------------------- 
    6866CONTAINS 
    6967 
     
    105103      !! References : Roullet and Madec 1999, JGR. 
    106104      !!--------------------------------------------------------------------- 
    107       USE oce, ONLY :   zub   => ta   ! ta used as workspace 
    108       USE oce, ONLY :   zvb   => sa   ! ta used as workspace 
     105      USE oce, ONLY:   zub   => ta , zvb   => sa   ! (ta,sa) used as workspace 
    109106      !! 
    110107      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
    111108      INTEGER, INTENT(  out) ::   kindic   ! solver convergence flag (<0 if not converge) 
    112109      !!                                    
    113       INTEGER  ::   ji, jj, jk           ! dummy loop indices 
    114       REAL(wp) ::   z2dt, z2dtg          ! temporary scalars 
    115       REAL(wp) ::   zgcb, zbtd   !   -          - 
    116       REAL(wp) ::   ztdgu, ztdgv         !   -          - 
     110      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     111      REAL(wp) ::   z2dt, z2dtg, zgcb, zbtd, ztdgu, ztdgv   ! local scalars 
    117112      !!---------------------------------------------------------------------- 
    118113      ! 
     
    123118        
    124119         ! set to zero free surface specific arrays 
    125          spgu(:,:) = 0.e0                     ! surface pressure gradient (i-direction) 
    126          spgv(:,:) = 0.e0                     ! surface pressure gradient (j-direction) 
    127          CALL solver_init( nit000 )           ! Elliptic solver initialisation 
     120         spgu(:,:) = 0._wp                     ! surface pressure gradient (i-direction) 
     121         spgv(:,:) = 0._wp                     ! surface pressure gradient (j-direction) 
    128122 
    129123         ! read filtered free surface arrays in restart file 
     
    205199      DO jj = 2, jpjm1 
    206200         DO ji = fs_2, fs_jpim1   ! vector opt. 
    207             spgu(ji,jj) = 0.e0 
    208             spgv(ji,jj) = 0.e0 
     201            spgu(ji,jj) = 0._wp 
     202            spgv(ji,jj) = 0._wp 
    209203         END DO 
    210204      END DO 
     
    282276      ncut = 0 
    283277      ! if rnorme is 0, the solution is 0, the solver is not called 
    284       IF( rnorme == 0.e0 ) THEN 
    285          gcx(:,:) = 0.e0 
    286          res   = 0.e0 
     278      IF( rnorme == 0._wp ) THEN 
     279         gcx(:,:) = 0._wp 
     280         res   = 0._wp 
    287281         niter = 0 
    288282         ncut  = 999 
     
    356350 
    357351   SUBROUTINE flt_rst( kt, cdrw ) 
    358      !!--------------------------------------------------------------------- 
    359      !!                   ***  ROUTINE ts_rst  *** 
    360      !! 
    361      !! ** Purpose : Read or write filtered free surface arrays in restart file 
    362      !!---------------------------------------------------------------------- 
    363      INTEGER         , INTENT(in) ::   kt         ! ocean time-step 
    364      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag 
    365      !!---------------------------------------------------------------------- 
    366  
    367      IF( TRIM(cdrw) == 'READ' ) THEN 
    368         IF( iom_varid( numror, 'gcx', ldstop = .FALSE. ) > 0 ) THEN 
     352      !!--------------------------------------------------------------------- 
     353      !!                   ***  ROUTINE ts_rst  *** 
     354      !! 
     355      !! ** Purpose : Read or write filtered free surface arrays in restart file 
     356      !!---------------------------------------------------------------------- 
     357      INTEGER         , INTENT(in) ::   kt         ! ocean time-step 
     358      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag 
     359      !!---------------------------------------------------------------------- 
     360      ! 
     361      IF( TRIM(cdrw) == 'READ' ) THEN 
     362         IF( iom_varid( numror, 'gcx', ldstop = .FALSE. ) > 0 ) THEN 
    369363! Caution : extra-hallow 
    370364! gcx and gcxb are defined as: DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) 
    371            CALL iom_get( numror, jpdom_autoglo, 'gcx' , gcx (1:jpi,1:jpj) ) 
    372            CALL iom_get( numror, jpdom_autoglo, 'gcxb', gcxb(1:jpi,1:jpj) ) 
    373            IF( neuler == 0 )   gcxb(:,:) = gcx (:,:) 
    374         ELSE 
    375            gcx (:,:) = 0.e0 
    376            gcxb(:,:) = 0.e0 
    377         ENDIF 
    378      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN 
     365            CALL iom_get( numror, jpdom_autoglo, 'gcx' , gcx (1:jpi,1:jpj) ) 
     366            CALL iom_get( numror, jpdom_autoglo, 'gcxb', gcxb(1:jpi,1:jpj) ) 
     367            IF( neuler == 0 )   gcxb(:,:) = gcx (:,:) 
     368         ELSE 
     369            gcx (:,:) = 0.e0 
     370            gcxb(:,:) = 0.e0 
     371         ENDIF 
     372      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN 
    379373! Caution : extra-hallow 
    380374! gcx and gcxb are defined as: DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) 
    381         CALL iom_rstput( kt, nitrst, numrow, 'gcx' , gcx (1:jpi,1:jpj) ) 
    382         CALL iom_rstput( kt, nitrst, numrow, 'gcxb', gcxb(1:jpi,1:jpj) ) 
    383      ENDIF 
    384      ! 
     375         CALL iom_rstput( kt, nitrst, numrow, 'gcx' , gcx (1:jpi,1:jpj) ) 
     376         CALL iom_rstput( kt, nitrst, numrow, 'gcxb', gcxb(1:jpi,1:jpj) ) 
     377      ENDIF 
     378      ! 
    385379   END SUBROUTINE flt_rst 
    386380 
Note: See TracChangeset for help on using the changeset viewer.