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 5930 for trunk/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90 – NEMO

Ignore:
Timestamp:
2015-11-26T17:07:10+01:00 (8 years ago)
Author:
jchanut
Message:

#1620 Merge free surface simplification into trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90

    r5836 r5930  
    3535   USE dtauvd          ! data: U & V current             (dta_uvd routine) 
    3636   USE domvvl          ! varying vertical mesh 
    37    USE dynspg_oce      ! pressure gradient schemes 
    38    USE dynspg_flt      ! filtered free surface 
    39    USE sol_oce         ! ocean solver variables 
    4037   ! 
    4138   USE in_out_manager  ! I/O manager 
     
    133130      ENDIF 
    134131      ! 
    135       IF( lk_agrif ) THEN                  ! read free surface arrays in restart file 
    136          IF( ln_rstart ) THEN 
    137             IF( lk_dynspg_flt )  THEN      ! read or initialize the following fields 
    138                !                           ! gcx, gcxb for agrif_opa_init 
    139                IF( sol_oce_alloc()  > 0 )   CALL ctl_stop('agrif sol_oce_alloc: allocation of arrays failed') 
    140                CALL flt_rst( nit000, 'READ' ) 
    141             ENDIF 
    142          ENDIF                             ! explicit case not coded yet with AGRIF 
    143       ENDIF 
    144       ! 
    145132      !  
    146133      ! Initialize "now" and "before" barotropic velocities: 
     
    445432      !!                 p=integral [ rau*g dz ] 
    446433      !!---------------------------------------------------------------------- 
    447       USE dynspg          ! surface pressure gradient             (dyn_spg routine) 
    448434      USE divhor          ! hor. divergence                       (div_hor routine) 
    449435      USE lbclnk          ! ocean lateral boundary condition (or mpp link) 
    450436      ! 
    451437      INTEGER ::   ji, jj, jk        ! dummy loop indices 
    452       INTEGER ::   indic             ! ??? 
    453438      REAL(wp) ::   zmsv, zphv, zmsu, zphu, zalfg     ! temporary scalars 
    454439      REAL(wp), POINTER, DIMENSION(:,:,:) :: zprn 
     
    517502      vb(:,:,:) = vn(:,:,:) 
    518503       
    519       ! WARNING !!!!! 
    520       ! after initializing u and v, we need to calculate the initial streamfunction bsf. 
    521       ! Otherwise, only the trend will be computed and the model will blow up (inconsistency). 
    522       ! to do that, we call dyn_spg with a special trick: 
    523       ! we fill ua and va with the velocities divided by dt, and the streamfunction will be brought to the 
    524       ! right value assuming the velocities have been set up in one time step. 
    525       ! we then set bsfd to zero (first guess for next step is d(psi)/dt = 0.) 
    526       !  sets up s false trend to calculate the barotropic streamfunction. 
    527  
    528       ua(:,:,:) = ub(:,:,:) / rdt 
    529       va(:,:,:) = vb(:,:,:) / rdt 
    530  
    531       ! calls dyn_spg. we assume euler time step, starting from rest. 
    532       indic = 0 
    533       CALL dyn_spg( nit000, indic )       ! surface pressure gradient 
    534       ! 
    535       ! the new velocity is ua*rdt 
    536       ! 
    537       CALL lbc_lnk( ua, 'U', -1. ) 
    538       CALL lbc_lnk( va, 'V', -1. ) 
    539  
    540       ub(:,:,:) = ua(:,:,:) * rdt 
    541       vb(:,:,:) = va(:,:,:) * rdt 
    542       ua(:,:,:) = 0.e0 
    543       va(:,:,:) = 0.e0 
    544       un(:,:,:) = ub(:,:,:) 
    545       vn(:,:,:) = vb(:,:,:) 
    546504      ! 
    547505!!gm  Check  here call to div_hor should not be necessary 
Note: See TracChangeset for help on using the changeset viewer.