Skip to content
Snippets Groups Projects
Commit 9bcf5bfb authored by Guillaume Samson's avatar Guillaume Samson :snowman2:
Browse files

Merge branch '74-ssh-constant-initialization-in-iceinit-is-not-compliant-with-vvl' into 'main'

Resolve "Issues with ssh initialization in iceinit with vvl and AGRIF"

Closes #74

See merge request nemo/nemo!120
parents cabbd821 676a31ce
No related branches found
No related tags found
No related merge requests found
...@@ -436,11 +436,7 @@ CONTAINS ...@@ -436,11 +436,7 @@ CONTAINS
! Override ssh adjustment in nested domains by the root-domain ssh adjustment; ! Override ssh adjustment in nested domains by the root-domain ssh adjustment;
! store the adjustment value in a global module variable to make it retrievable in nested domains ! store the adjustment value in a global module variable to make it retrievable in nested domains
IF( .NOT.Agrif_Root() ) THEN IF( .NOT.Agrif_Root() ) THEN
IF (.NOT.ln_init_chfrpar ) THEN ! child is not initialized from the parent zsshadj = Agrif_Parent(rsshadj)
zsshadj = Agrif_Parent(rsshadj)
ELSE ! child is initialized from the parent
zsshadj = 0._wp ! => 0 since ssh adjustement is already done
ENDIF
ELSE ELSE
rsshadj = zsshadj rsshadj = zsshadj
ENDIF ENDIF
...@@ -463,10 +459,10 @@ CONTAINS ...@@ -463,10 +459,10 @@ CONTAINS
#else #else
DO jk = 1, jpk DO jk = 1, jpk
DO_2D( nn_hls, nn_hls, nn_hls, nn_hls) DO_2D( nn_hls, nn_hls, nn_hls, nn_hls)
IF( snwice_mass(ji,jj) /= 0._wp ) THEN ! IF( snwice_mass(ji,jj) /= 0._wp ) THEN
e3t(ji,jj,jk,Kmm) = e3t_0(ji,jj,jk) * ( 1._wp + ssh(ji,jj,Kmm) * r1_ht_0(ji,jj) * tmask(ji,jj,jk) ) e3t(ji,jj,jk,Kmm) = e3t_0(ji,jj,jk) * ( 1._wp + ssh(ji,jj,Kmm) * r1_ht_0(ji,jj) * tmask(ji,jj,jk) )
e3t(ji,jj,jk,Kbb) = e3t_0(ji,jj,jk) * ( 1._wp + ssh(ji,jj,Kbb) * r1_ht_0(ji,jj) * tmask(ji,jj,jk) ) e3t(ji,jj,jk,Kbb) = e3t_0(ji,jj,jk) * ( 1._wp + ssh(ji,jj,Kbb) * r1_ht_0(ji,jj) * tmask(ji,jj,jk) )
ENDIF ! ENDIF
END_2D END_2D
END DO END DO
! !
......
...@@ -34,7 +34,11 @@ MODULE agrif_oce_interp ...@@ -34,7 +34,11 @@ MODULE agrif_oce_interp
USE lib_mpp USE lib_mpp
USE vremap USE vremap
USE lbclnk USE lbclnk
#if defined key_si3
USE iceistate, ONLY: rsshadj, nn_iceini_file
USE sbc_oce , ONLY: ln_ice_embd
USE sbc_ice , ONLY: snwice_mass
#endif
IMPLICIT NONE IMPLICIT NONE
PRIVATE PRIVATE
...@@ -1108,7 +1112,21 @@ CONTAINS ...@@ -1108,7 +1112,21 @@ CONTAINS
!!---------------------------------------------------------------------- !!----------------------------------------------------------------------
! !
IF( before) THEN IF( before) THEN
#if defined key_si3
IF (l_ini_child.AND.(.NOT.(ln_rstart .OR. nn_iceini_file == 2))) THEN
IF( ln_ice_embd ) THEN
ptab(i1:i2,j1:j2) = ssh(i1:i2,j1:j2,Kmm_a) &
& + snwice_mass(i1:i2,j1:j2) * r1_rho0
ELSE
ptab(i1:i2,j1:j2) = ssh(i1:i2,j1:j2,Kmm_a) &
& + rsshadj * tmask(i1:i2,j1:j2,1)
ENDIF
ELSE
ptab(i1:i2,j1:j2) = ssh(i1:i2,j1:j2,Kmm_a)
ENDIF
#else
ptab(i1:i2,j1:j2) = ssh(i1:i2,j1:j2,Kmm_a) ptab(i1:i2,j1:j2) = ssh(i1:i2,j1:j2,Kmm_a)
#endif
ELSE ELSE
IF( l_ini_child ) THEN IF( l_ini_child ) THEN
ssh(i1:i2,j1:j2,Krhs_a) = ptab(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1) ssh(i1:i2,j1:j2,Krhs_a) = ptab(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1)
......
...@@ -151,8 +151,8 @@ CONTAINS ...@@ -151,8 +151,8 @@ CONTAINS
ENDIF ENDIF
END_2D END_2D
! !
IF( PRESENT(l_mask) .AND. l_mask ) THEN IF( PRESENT(l_mask) ) THEN
zqsrout(:,:) = float(imask_night(:,:)) IF ( l_mask ) zqsrout(:,:) = float(imask_night(:,:))
ENDIF ENDIF
! !
END FUNCTION sbc_dcy END FUNCTION sbc_dcy
......
...@@ -164,7 +164,7 @@ CONTAINS ...@@ -164,7 +164,7 @@ CONTAINS
END_2D END_2D
END DO END DO
! !
IF (nn_hls==1) CALL lbc_lnk( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp , pgtv(:,:,:), 'V', -1.0_wp ) ! Lateral boundary cond. IF (nn_hls==1) CALL lbc_lnk( 'zpshde', pgtu, 'U', -1.0_wp , pgtv, 'V', -1.0_wp ) ! Lateral boundary cond.
! !
IF( PRESENT( prd ) ) THEN !== horizontal derivative of density anomalies (rd) ==! (optional part) IF( PRESENT( prd ) ) THEN !== horizontal derivative of density anomalies (rd) ==! (optional part)
pgru(:,:) = 0._wp pgru(:,:) = 0._wp
...@@ -343,7 +343,7 @@ CONTAINS ...@@ -343,7 +343,7 @@ CONTAINS
END_2D END_2D
END DO END DO
! !
IF (nn_hls==1) CALL lbc_lnk( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp , pgtv(:,:,:), 'V', -1.0_wp ) ! Lateral boundary cond. IF (nn_hls==1) CALL lbc_lnk( 'zpshde', pgtu, 'U', -1.0_wp , pgtv, 'V', -1.0_wp ) ! Lateral boundary cond.
! horizontal derivative of density anomalies (rd) ! horizontal derivative of density anomalies (rd)
IF( PRESENT( prd ) ) THEN ! depth of the partial step level IF( PRESENT( prd ) ) THEN ! depth of the partial step level
...@@ -436,7 +436,7 @@ CONTAINS ...@@ -436,7 +436,7 @@ CONTAINS
END_2D END_2D
! !
END DO END DO
IF (nn_hls==1) CALL lbc_lnk( 'zpshde', pgtui(:,:,:), 'U', -1.0_wp , pgtvi(:,:,:), 'V', -1.0_wp ) ! Lateral boundary cond. IF (nn_hls==1) CALL lbc_lnk( 'zpshde', pgtui, 'U', -1.0_wp , pgtvi, 'V', -1.0_wp ) ! Lateral boundary cond.
IF( PRESENT( prd ) ) THEN !== horizontal derivative of density anomalies (rd) ==! (optional part) IF( PRESENT( prd ) ) THEN !== horizontal derivative of density anomalies (rd) ==! (optional part)
! !
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment