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 14170 for NEMO/trunk/src/NST/agrif_oce_sponge.F90 – NEMO

Ignore:
Timestamp:
2020-12-14T19:43:17+01:00 (4 years ago)
Author:
jchanut
Message:

#2222, 2129: 1) Corrected ssh initialization from parent in line with what has been introduced by Sibylle 2) Fixed bug in dyn interp with expliciit free surface 3) Added check on number of levels in child grid without vertical remapping (must be < jpk_parent) 4) Removed the constrain on initialization from parent only when starting from climatology (requires Euler first step though).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/NST/agrif_oce_sponge.F90

    r14086 r14170  
    441441                  N_in = mbkt_parent(ji,jj) 
    442442                  ! Input grid (account for partial cells if any): 
    443                   DO jk=1,N_in 
    444                      z_in(jk) = tabres(ji,jj,jk,n2) - tabres(ji,jj,k2,n2) 
    445                      tabin(jk,1:jpts) = tabres(ji,jj,jk,1:jpts) 
    446                   END DO 
     443                  IF ( N_in > 0 ) THEN  
     444                     DO jk=1,N_in 
     445                        z_in(jk) = tabres(ji,jj,jk,n2) - tabres(ji,jj,k2,n2) 
     446                        tabin(jk,1:jpts) = tabres(ji,jj,jk,1:jpts) 
     447                     END DO 
    447448                   
    448                   ! Intermediate grid: 
    449                   DO jk = 1, N_in 
    450                      h_in_i(jk) = e3t0_parent(ji,jj,jk) * &  
    451                        &       (1._wp + tabres(ji,jj,k2,n2)/(ht0_parent(ji,jj)*ssmask(ji,jj) + 1._wp - ssmask(ji,jj))) 
    452                   END DO 
    453                   z_in_i(1) = 0.5_wp * h_in_i(1) 
    454                   DO jk=2,N_in 
    455                      z_in_i(jk) = z_in_i(jk-1) + 0.5_wp * ( h_in_i(jk) + h_in_i(jk-1) ) 
    456                   END DO 
    457                   z_in_i(1:N_in) = z_in_i(1:N_in)  - tabres(ji,jj,k2,n2) 
    458  
     449                     ! Intermediate grid: 
     450                     DO jk = 1, N_in 
     451                        h_in_i(jk) = e3t0_parent(ji,jj,jk) * &  
     452                          &       (1._wp + tabres(ji,jj,k2,n2)/(ht0_parent(ji,jj)*ssmask(ji,jj) + 1._wp - ssmask(ji,jj))) 
     453                     END DO 
     454                     z_in_i(1) = 0.5_wp * h_in_i(1) 
     455                     DO jk=2,N_in 
     456                        z_in_i(jk) = z_in_i(jk-1) + 0.5_wp * ( h_in_i(jk) + h_in_i(jk-1) ) 
     457                     END DO 
     458                     z_in_i(1:N_in) = z_in_i(1:N_in)  - tabres(ji,jj,k2,n2) 
     459                  END IF 
    459460                  ! Output (Child) grid: 
    460461                  N_out = mbkt(ji,jj) 
Note: See TracChangeset for help on using the changeset viewer.