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 13141 for NEMO/branches/2020/dev_r12973_AGRIF_CMEMS/src/NST/agrif_user.F90 – NEMO

Ignore:
Timestamp:
2020-06-22T18:27:34+02:00 (4 years ago)
Author:
jchanut
Message:

#2129, corrections/add ons to initial state interpolation with AGRIF
1) add namelist flag for child grid initial state interpolation - ice not considered yet
2) provide depths and not thicknesses as inputs to vertical linear interpolation
3) extend initial state interpolation to a restart scenario for parent grid (warning should be added in that case in order to prevent users doing this at each model restart...)
The online interpolation seems to work fine in the VORTEX case (provided 0. is not considered as a special value in the initial velocity field, i.e. ln_spc_dyn=F)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12973_AGRIF_CMEMS/src/NST/agrif_user.F90

    r13133 r13141  
    5252      INTEGER :: jn 
    5353 
     54      IF(lwp) WRITE(numout,*) ' ' 
     55      IF(lwp) WRITE(numout,*) 'AGRIF: interp child initial state from parent' 
     56      IF(lwp) WRITE(numout,*) ' ' 
     57 
    5458      l_ini_child = .TRUE. 
    5559      Agrif_SpecialValue    = 0._wp 
    5660      Agrif_UseSpecialValue = .TRUE. 
     61      CALL Agrif_childgrid_to_parentgrid() 
     62      l_ini_child = .TRUE. 
     63      CALL Agrif_parentgrid_to_childgrid()   
    5764      uu(:,:,:,:) = 0.  ;  vv(:,:,:,:) = 0.   ;  ts(:,:,:,:,:) = 0. 
    5865        
     
    6168      ! Brutal fix to pas 1x1 refinment.  
    6269  !    IF(Agrif_Irhox() == 1) THEN 
    63          CALL Agrif_Init_Variable(tsini_id, procname=agrif_initts) 
     70  !       CALL Agrif_Init_Variable(tsini_id, procname=agrif_initts) 
    6471  !    ELSE 
    65    !      CALL Agrif_Init_Variable(tsini_id, procname=interptsn) 
     72      CALL Agrif_Init_Variable(tsini_id, procname=interptsn) 
    6673 
    6774  !    ENDIF 
     75! just for VORTEX because Parent velocities can actually be exactly zero 
     76!      Agrif_UseSpecialValue = .FALSE. 
    6877      Agrif_UseSpecialValue = ln_spc_dyn 
    6978      use_sign_north = .TRUE. 
    7079      sign_north = -1. 
    71   !    CALL Agrif_Init_Variable(uini_id , procname=interpun ) 
    72   !    CALL Agrif_Init_Variable(vini_id , procname=interpvn ) 
    73        use_sign_north = .FALSE. 
     80      CALL Agrif_Init_Variable(uini_id , procname=interpun ) 
     81      CALL Agrif_Init_Variable(vini_id , procname=interpvn ) 
     82      use_sign_north = .FALSE. 
    7483 
    7584      Agrif_UseSpecialValue = .FALSE.            ! 
    7685      l_ini_child = .FALSE. 
     86      CALL Agrif_childgrid_to_parentgrid() 
     87      l_ini_child = .FALSE. 
     88      CALL Agrif_parentgrid_to_childgrid()  
     89 
    7790      Krhs_a = Kaa ; Kmm_a = Kmm 
    7891 
     
    281294      mbkv_parent(:,:) = MAX( NINT( zk(:,:) ), 1 )    
    282295 
    283  
    284       CALL Agrif_Init_Variable(sshini_id, procname=agrif_initssh) 
    285       CALL lbc_lnk( 'Agrif_Init_Domain', ssh(:,:,Kbb), 'T', 1. ) 
    286       DO jk = 1, jpk 
    287             e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb)  ) & 
    288       &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    289                      &              + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) ) 
    290       END DO 
     296      IF ( ln_init_chfrpar ) THEN  
     297         CALL Agrif_Init_Variable(sshini_id, procname=agrif_initssh) 
     298         CALL lbc_lnk( 'Agrif_Init_Domain', ssh(:,:,Kbb), 'T', 1. ) 
     299         DO jk = 1, jpk 
     300               e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb)  ) & 
     301                        &             / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
     302                        &              + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) ) 
     303         END DO 
     304      ENDIF 
    291305 
    292306      ! check if masks and bathymetries match 
     
    850864      ! 
    851865      INTEGER  ::   ios                 ! Local integer output status for namelist read 
    852       NAMELIST/namagrif/ ln_agrif_2way, rn_sponge_tra, rn_sponge_dyn, rn_trelax_tra, rn_trelax_dyn, & 
     866      NAMELIST/namagrif/ ln_agrif_2way, ln_init_chfrpar, rn_sponge_tra, rn_sponge_dyn, rn_trelax_tra, rn_trelax_dyn, & 
    853867                       & ln_spc_dyn, ln_chk_bathy, ln_bry_south 
    854868      !!-------------------------------------------------------------------------------------- 
     
    866880         WRITE(numout,*) '   Namelist namagrif : set AGRIF parameters' 
    867881         WRITE(numout,*) '      Two way nesting activated ln_agrif_2way         = ', ln_agrif_2way 
     882         WRITE(numout,*) '      child initial state from parent ln_init_chfrpar = ', ln_init_chfrpar 
    868883         WRITE(numout,*) '      sponge coefficient for tracers    rn_sponge_tra = ', rn_sponge_tra, ' m^2/s' 
    869884         WRITE(numout,*) '      sponge coefficient for dynamics   rn_sponge_tra = ', rn_sponge_dyn, ' m^2/s' 
Note: See TracChangeset for help on using the changeset viewer.