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 1601 for trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90 – NEMO

Ignore:
Timestamp:
2009-08-11T12:09:19+02:00 (15 years ago)
Author:
ctlod
Message:

Doctor naming of OPA namelist variables , see ticket: #526

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90

    r1556 r1601  
    1818   !!   'key_dynspg_flt'                              filtered free surface 
    1919   !!---------------------------------------------------------------------- 
    20    !!   dyn_spg_flt  : update the momentum trend with the surface pressure 
    21    !!                  gradient in the filtered free surface case with 
    22    !!                  vector optimization 
     20   !!   dyn_spg_flt  : update the momentum trend with the surface pressure gradient in the filtered free surface case  
    2321   !!   flt_rst      : read/write the time-splitting restart fields in the ocean restart file 
    2422   !!---------------------------------------------------------------------- 
     
    3129   USE phycst          ! physical constants 
    3230   USE domvvl          ! variable volume 
     31   USE solmat          ! matrix construction for elliptic solvers 
    3332   USE solver          ! solver initialization 
    3433   USE solpcg          ! preconditionned conjugate gradient solver 
     
    4443   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    4544   USE prtctl          ! Print control 
    46    USE solmat          ! matrix construction for elliptic solvers 
    4745   USE agrif_opa_interp 
    4846   USE iom 
     
    7674      !! ** Method  :   Filtered free surface formulation. The surface 
    7775      !!      pressure gradient is given by: 
    78       !!         spgu = 1/rau0 d/dx(ps) =  1/e1u di( sshn + rnu btda ) 
    79       !!         spgv = 1/rau0 d/dy(ps) =  1/e2v dj( sshn + rnu btda ) 
     76      !!         spgu = 1/rau0 d/dx(ps) =  1/e1u di( sshn + btda ) 
     77      !!         spgv = 1/rau0 d/dy(ps) =  1/e2v dj( sshn + btda ) 
    8078      !!      where sshn is the free surface elevation and btda is the after 
    8179      !!      time derivative of the free surface elevation 
     
    106104      USE oce, ONLY :   zvb   => sa   ! ta used as workspace 
    107105      !! 
    108       INTEGER, INTENT( in ) ::   kt       ! ocean time-step index 
    109       INTEGER, INTENT( out ) ::   kindic   ! solver convergence flag (<0 if not converge) 
     106      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
     107      INTEGER, INTENT(  out) ::   kindic   ! solver convergence flag (<0 if not converge) 
    110108      !!                                    
    111       INTEGER  ::   ji, jj, jk                          ! dummy loop indices 
    112       REAL(wp) ::   z2dt, z2dtg, zraur, znugdt          ! temporary scalars 
    113       REAL(wp) ::   znurau, zgcb, zbtd                  !   "          " 
    114       REAL(wp) ::   ztdgu, ztdgv                        !   "          " 
     109      INTEGER  ::   ji, jj, jk           ! dummy loop indices 
     110      REAL(wp) ::   z2dt, z2dtg, zraur   ! temporary scalars 
     111      REAL(wp) ::   zgcb, zbtd   !   -          - 
     112      REAL(wp) ::   ztdgu, ztdgv         !   -          - 
    115113      !!---------------------------------------------------------------------- 
    116114      ! 
     
    127125         ! read filtered free surface arrays in restart file 
    128126         ! when using agrif, sshn, gcx have to be read in istate 
    129          IF (.NOT. lk_agrif) CALL flt_rst( nit000, 'READ' )       ! read or initialize the following fields: 
     127         IF(.NOT. lk_agrif)   CALL flt_rst( nit000, 'READ' )      ! read or initialize the following fields: 
    130128         !                                                        ! gcx, gcxb 
    131129      ENDIF 
    132130 
    133131      ! Local constant initialization 
    134       z2dt = 2. * rdt                                       ! time step: leap-frog 
    135       IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt       ! time step: Euler if restart from rest 
    136       IF( neuler == 0 .AND. kt == nit000+1 ) CALL sol_mat(kt) 
     132      z2dt = 2. * rdt                                             ! time step: leap-frog 
     133      IF( neuler == 0 .AND. kt == nit000   )   z2dt = rdt         ! time step: Euler if restart from rest 
     134      IF( neuler == 0 .AND. kt == nit000+1 )   CALL sol_mat( kt ) 
    137135      z2dtg  = grav * z2dt 
    138136      zraur  = 1. / rauw 
    139       znugdt =  rnu * grav * z2dt 
    140       znurau =  znugdt * zraur 
    141137 
    142138      !! Explicit physics with thickness weighted updates 
     
    237233         END DO 
    238234      END DO 
    239  
    240       ! Boundary conditions on (spgu,spgv) 
    241       CALL lbc_lnk( spgu, 'U', -1. ) 
     235      CALL lbc_lnk( spgu, 'U', -1. )       ! lateral boundary conditions  
    242236      CALL lbc_lnk( spgv, 'V', -1. ) 
    243237 
     
    245239 
    246240      ! Right hand side of the elliptic equation and first guess 
    247       ! ----------------------------------------------------------- 
     241      ! -------------------------------------------------------- 
    248242      DO jj = 2, jpjm1 
    249243         DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    259253      END DO 
    260254      ! applied the lateral boundary conditions 
    261       IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 ) CALL lbc_lnk_e( gcb, c_solver_pt, 1. )    
     255      IF( nn_solv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 )  CALL lbc_lnk_e( gcb, c_solver_pt, 1. )    
    262256 
    263257#if defined key_agrif 
     
    265259         ! add contribution of gradient of after barotropic transport divergence  
    266260         IF( nbondi == -1 .OR. nbondi == 2 )   gcb(3     ,:) =   & 
    267             &    gcb(3     ,:) - znugdt * z2dt * laplacu(2     ,:) * gcdprc(3     ,:) * hu(2     ,:) * e2u(2     ,:) 
     261            &    gcb(3     ,:) - z2dtg * z2dt * laplacu(2     ,:) * gcdprc(3     ,:) * hu(2     ,:) * e2u(2     ,:) 
    268262         IF( nbondi ==  1 .OR. nbondi == 2 )   gcb(nlci-2,:) =   & 
    269             &    gcb(nlci-2,:) + znugdt * z2dt * laplacu(nlci-2,:) * gcdprc(nlci-2,:) * hu(nlci-2,:) * e2u(nlci-2,:) 
     263            &    gcb(nlci-2,:) + z2dtg * z2dt * laplacu(nlci-2,:) * gcdprc(nlci-2,:) * hu(nlci-2,:) * e2u(nlci-2,:) 
    270264         IF( nbondj == -1 .OR. nbondj == 2 )   gcb(:     ,3) =   & 
    271             &    gcb(:,3     ) - znugdt * z2dt * laplacv(:,2     ) * gcdprc(:,3     ) * hv(:,2     ) * e1v(:,2     ) 
     265            &    gcb(:,3     ) - z2dtg * z2dt * laplacv(:,2     ) * gcdprc(:,3     ) * hv(:,2     ) * e1v(:,2     ) 
    272266         IF( nbondj ==  1 .OR. nbondj == 2 )   gcb(:,nlcj-2) =   & 
    273             &    gcb(:,nlcj-2) + znugdt * z2dt * laplacv(:,nlcj-2) * gcdprc(:,nlcj-2) * hv(:,nlcj-2) * e1v(:,nlcj-2) 
     267            &    gcb(:,nlcj-2) + z2dtg * z2dt * laplacv(:,nlcj-2) * gcdprc(:,nlcj-2) * hv(:,nlcj-2) * e1v(:,nlcj-2) 
    274268      ENDIF 
    275269#endif 
     
    298292      kindic = 0 
    299293      IF( ncut == 0 ) THEN 
    300          IF( nsolv == 1 ) THEN         ! diagonal preconditioned conjuguate gradient 
    301             CALL sol_pcg( kindic ) 
    302          ELSEIF( nsolv == 2 ) THEN     ! successive-over-relaxation 
    303             CALL sol_sor( kindic ) 
    304          ELSE                          ! e r r o r in nsolv namelist parameter 
    305             WRITE(ctmp1,*) ' ~~~~~~~~~~~                not = ', nsolv 
    306             CALL ctl_stop( ' dyn_spg_flt : e r r o r, nsolv = 1 or 2', ctmp1 ) 
     294         IF    ( nn_solv == 1 ) THEN   ;   CALL sol_pcg( kindic )      ! diagonal preconditioned conjuguate gradient 
     295         ELSEIF( nn_solv == 2 ) THEN   ;   CALL sol_sor( kindic )      ! successive-over-relaxation 
    307296         ENDIF 
    308297      ENDIF 
     
    313302         DO ji = fs_2, fs_jpim1   ! vector opt. 
    314303            ! trend of Transport divergence gradient 
    315             ztdgu = znugdt * (gcx(ji+1,jj  ) - gcx(ji,jj) ) / e1u(ji,jj) 
    316             ztdgv = znugdt * (gcx(ji  ,jj+1) - gcx(ji,jj) ) / e2v(ji,jj) 
     304            ztdgu = z2dtg * (gcx(ji+1,jj  ) - gcx(ji,jj) ) / e1u(ji,jj) 
     305            ztdgv = z2dtg * (gcx(ji  ,jj+1) - gcx(ji,jj) ) / e2v(ji,jj) 
    317306            ! multiplied by z2dt 
    318307#if defined key_obc 
     
    336325      IF( .NOT. Agrif_Root() ) THEN 
    337326         ! caution : grad D (fine) = grad D (coarse) at coarse/fine interface 
    338          IF( nbondi == -1 .OR. nbondi == 2 ) spgu(2     ,:) = znugdt * z2dt * laplacu(2     ,:) * umask(2     ,:,1) 
    339          IF( nbondi ==  1 .OR. nbondi == 2 ) spgu(nlci-2,:) = znugdt * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1) 
    340          IF( nbondj == -1 .OR. nbondj == 2 ) spgv(:,2     ) = znugdt * z2dt * laplacv(:,2     ) * vmask(:     ,2,1) 
    341          IF( nbondj ==  1 .OR. nbondj == 2 ) spgv(:,nlcj-2) = znugdt * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1) 
     327         IF( nbondi == -1 .OR. nbondi == 2 ) spgu(2     ,:) = z2dtg * z2dt * laplacu(2     ,:) * umask(2     ,:,1) 
     328         IF( nbondi ==  1 .OR. nbondi == 2 ) spgu(nlci-2,:) = z2dtg * z2dt * laplacu(nlci-2,:) * umask(nlci-2,:,1) 
     329         IF( nbondj == -1 .OR. nbondj == 2 ) spgv(:,2     ) = z2dtg * z2dt * laplacv(:,2     ) * vmask(:     ,2,1) 
     330         IF( nbondj ==  1 .OR. nbondj == 2 ) spgv(:,nlcj-2) = z2dtg * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1) 
    342331      ENDIF 
    343332#endif       
Note: See TracChangeset for help on using the changeset viewer.