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 12741 for NEMO – NEMO

Changeset 12741 for NEMO


Ignore:
Timestamp:
2020-04-12T12:15:05+02:00 (4 years ago)
Author:
clem
Message:

introduce a convergence test for rheology. Needed for the upcoming implementation of new rheologies and to compare EVP with aEVP

Location:
NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/cfgs/SHARED/field_def_nemo-ice.xml

    r12720 r12741  
    173173          <field id="frq_m"    unit="-"    /> 
    174174 
     175          <!-- rheology convergence tests --> 
     176          <field id="uice_cvg"   long_name="sea ice velocity convergence"   standard_name="sea_ice_velocity_convergence"   unit="m/s" /> 
     177 
    175178     <!-- ================= --> 
    176179          <!-- Add-ons for SIMIP --> 
  • NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/cfgs/SHARED/namelist_ice_ref

    r12734 r12741  
    9797      rn_relast     =   0.333         !     ratio of elastic timescale to ice time step: Telast = dt_ice * rn_relast  
    9898                                      !        advised value: 1/3 (rn_nevp=120) or 1/9 (rn_nevp=300) 
     99   ln_rhg_chkcvg    = .false.         !  check convergence of rheology (outputs: file ice_cvg.nc & variable uice_cvg) 
    99100/ 
    100101!------------------------------------------------------------------------------ 
     
    249250   ln_icediahsb     = .false.         !  output the heat, mass & salt budgets (T) or not (F) 
    250251   ln_icectl        = .false.         !  ice points output for debug (T or F) 
    251    iiceprt          =  10             !  i-index for debug 
    252    jiceprt          =  10             !  j-index for debug 
    253 / 
     252      iiceprt       =  10             !     i-index for debug 
     253      jiceprt       =  10             !     j-index for debug 
     254   ln_icediacvg     = .false.         !  check convergence of ice rheology (outputs: file ice_cvg.nc & variable uice_cvg) 
     255/ 
  • NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/doc/namelists/namdia

    r11703 r12741  
    88   ln_icediahsb     = .false.         !  output the heat, mass & salt budgets (T) or not (F) 
    99   ln_icectl        = .false.         !  ice points output for debug (T or F) 
    10    iiceprt          =  10             !  i-index for debug 
    11    jiceprt          =  10             !  j-index for debug 
     10      iiceprt       =  10             !     i-index for debug 
     11      jiceprt       =  10             !     j-index for debug 
    1212/ 
  • NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/doc/namelists/namdyn_rhg

    r11025 r12741  
    99      rn_relast     =   0.333         !     ratio of elastic timescale to ice time step: Telast = dt_ice * rn_relast  
    1010                                      !        advised value: 1/3 (rn_nevp=120) or 1/9 (rn_nevp=300) 
     11   ln_rhg_chkcvg    = .false.         !  check convergence of rheology (outputs: file ice_cvg.nc & variable uice_cvg) 
    1112/ 
  • NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/ice.F90

    r12733 r12741  
    155155   INTEGER , PUBLIC ::   nn_nevp          !: number of iterations for subcycling 
    156156   REAL(wp), PUBLIC ::   rn_relast        !: ratio => telast/rdt_ice (1/3 or 1/9 depending on nb of subcycling nevp)  
     157   LOGICAL , PUBLIC ::   ln_rhg_chkcvg    !: check ice rheology convergence  
    157158   ! 
    158159   !                                     !!** ice-advection namelist (namdyn_adv) ** 
  • NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icedyn_rhg.F90

    r11536 r12741  
    110110      INTEGER ::   ios, ioptio   ! Local integer output status for namelist read 
    111111      !! 
    112       NAMELIST/namdyn_rhg/  ln_rhg_EVP, ln_aEVP, rn_creepl, rn_ecc , nn_nevp, rn_relast 
     112      NAMELIST/namdyn_rhg/  ln_rhg_EVP, ln_aEVP, rn_creepl, rn_ecc , nn_nevp, rn_relast, ln_rhg_chkcvg 
    113113      !!------------------------------------------------------------------- 
    114114      ! 
     
    126126         WRITE(numout,*) '~~~~~~~~~~~~~~~' 
    127127         WRITE(numout,*) '   Namelist : namdyn_rhg:' 
    128          WRITE(numout,*) '      rheology EVP (icedyn_rhg_evp)                        ln_rhg_EVP = ', ln_rhg_EVP 
    129          WRITE(numout,*) '         use adaptive EVP (aEVP)                           ln_aEVP    = ', ln_aEVP 
    130          WRITE(numout,*) '         creep limit                                       rn_creepl  = ', rn_creepl 
    131          WRITE(numout,*) '         eccentricity of the elliptical yield curve        rn_ecc     = ', rn_ecc 
    132          WRITE(numout,*) '         number of iterations for subcycling               nn_nevp    = ', nn_nevp 
    133          WRITE(numout,*) '         ratio of elastic timescale over ice time step     rn_relast  = ', rn_relast 
     128         WRITE(numout,*) '      rheology EVP (icedyn_rhg_evp)                        ln_rhg_EVP    = ', ln_rhg_EVP 
     129         WRITE(numout,*) '         use adaptive EVP (aEVP)                           ln_aEVP       = ', ln_aEVP 
     130         WRITE(numout,*) '         creep limit                                       rn_creepl     = ', rn_creepl 
     131         WRITE(numout,*) '         eccentricity of the elliptical yield curve        rn_ecc        = ', rn_ecc 
     132         WRITE(numout,*) '         number of iterations for subcycling               nn_nevp       = ', nn_nevp 
     133         WRITE(numout,*) '         ratio of elastic timescale over ice time step     rn_relast     = ', rn_relast 
     134         WRITE(numout,*) '      check convergence of rheology                        ln_rhg_chkcvg = ', ln_rhg_chkcvg 
    134135      ENDIF 
    135136      ! 
  • NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/ICE/icedyn_rhg_evp.F90

    r11536 r12741  
    4141   USE prtctl         ! Print control 
    4242 
     43   USE netcdf         ! NetCDF library for convergence test 
    4344   IMPLICIT NONE 
    4445   PRIVATE 
     
    4950   !! * Substitutions 
    5051#  include "vectopt_loop_substitute.h90" 
     52 
     53   !! for convergence tests 
     54   INTEGER ::   ncvgid   ! netcdf file id 
     55   INTEGER ::   nvarid   ! netcdf variable id 
     56   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zmsk00, zmsk15 
    5157   !!---------------------------------------------------------------------- 
    5258   !! NEMO/ICE 4.0 , NEMO Consortium (2018) 
     
    125131      REAL(wp) ::   zvCr                                                ! critical ice volume above which ice is landfast 
    126132      ! 
    127       REAL(wp) ::   zresm                                               ! Maximal error on ice velocity 
    128133      REAL(wp) ::   zintb, zintn                                        ! dummy argument 
    129134      REAL(wp) ::   zfac_x, zfac_y 
     
    141146      REAL(wp), DIMENSION(jpi,jpj) ::   zds                             ! shear 
    142147      REAL(wp), DIMENSION(jpi,jpj) ::   zs1, zs2, zs12                  ! stress tensor components 
    143 !!$      REAL(wp), DIMENSION(jpi,jpj) ::   zu_ice, zv_ice, zresr           ! check convergence 
    144148      REAL(wp), DIMENSION(jpi,jpj) ::   zsshdyn                         ! array used for the calculation of ice surface slope: 
    145149      !                                                                 !    ocean surface (ssh_m) if ice is not embedded 
     
    160164      REAL(wp), PARAMETER          ::   zmmin  = 1._wp                  ! ice mass (kg/m2)  below which ice velocity becomes very small 
    161165      REAL(wp), PARAMETER          ::   zamin  = 0.001_wp               ! ice concentration below which ice velocity becomes very small 
     166      !! --- check convergence 
     167      REAL(wp), DIMENSION(jpi,jpj) ::   zu_ice, zv_ice 
    162168      !! --- diags 
    163       REAL(wp), DIMENSION(jpi,jpj) ::   zmsk00 
    164169      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zsig1, zsig2, zsig3 
    165170      !! --- SIMIP diags 
     
    174179      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_dyn_rhg_evp: EVP sea-ice rheology' 
    175180      ! 
    176 !!gm for Clem:  OPTIMIZATION:  I think zfmask can be computed one for all at the initialization.... 
     181      ! for diagnostics and convergence tests 
     182      ALLOCATE( zmsk00(jpi,jpj), zmsk15(jpi,jpj) ) 
     183      DO jj = 1, jpj 
     184         DO ji = 1, jpi 
     185            zmsk00(ji,jj) = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi06  ) ) ! 1 if ice    , 0 if no ice 
     186            zmsk15(ji,jj) = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - 0.15_wp ) ) ! 1 if 15% ice, 0 if less 
     187         END DO 
     188      END DO 
     189      ! 
     190      !!gm for Clem:  OPTIMIZATION:  I think zfmask can be computed one for all at the initialization.... 
    177191      !------------------------------------------------------------------------------! 
    178192      ! 0) mask at F points for the ice 
     
    345359         l_full_nf_update = jter == nn_nevp   ! false: disable full North fold update (performances) for iter = 1 to nn_nevp-1 
    346360         ! 
    347 !!$         IF(ln_ctl) THEN   ! Convergence test 
    348 !!$            DO jj = 1, jpjm1 
    349 !!$               zu_ice(:,jj) = u_ice(:,jj) ! velocity at previous time step 
    350 !!$               zv_ice(:,jj) = v_ice(:,jj) 
    351 !!$            END DO 
    352 !!$         ENDIF 
     361         ! convergence test 
     362         IF(ln_rhg_chkcvg) THEN 
     363            DO jj = 1, jpj 
     364               DO ji = 1, jpi 
     365                  zu_ice(ji,jj) = u_ice(ji,jj) * umask(ji,jj,1) ! velocity at previous time step 
     366                  zv_ice(ji,jj) = v_ice(ji,jj) * vmask(ji,jj,1) 
     367               END DO 
     368            END DO 
     369         ENDIF 
    353370 
    354371         ! --- divergence, tension & shear (Appendix B of Hunke & Dukowicz, 2002) --- ! 
     
    667684         ENDIF 
    668685 
    669 !!$         IF(ln_ctl) THEN   ! Convergence test 
    670 !!$            DO jj = 2 , jpjm1 
    671 !!$               zresr(:,jj) = MAX( ABS( u_ice(:,jj) - zu_ice(:,jj) ), ABS( v_ice(:,jj) - zv_ice(:,jj) ) ) 
    672 !!$            END DO 
    673 !!$            zresm = MAXVAL( zresr( 1:jpi, 2:jpjm1 ) ) 
    674 !!$            CALL mpp_max( 'icedyn_rhg_evp', zresm )   ! max over the global domain 
    675 !!$         ENDIF 
     686         ! convergence test 
     687         IF(ln_rhg_chkcvg) THEN 
     688            CALL rhg_cvg( kt, jter, nn_nevp, u_ice, v_ice, zu_ice, zv_ice ) 
     689         ENDIF 
    676690         ! 
    677691         !                                                ! ==================== ! 
     
    734748      ! 5) diagnostics 
    735749      !------------------------------------------------------------------------------! 
    736       DO jj = 1, jpj 
    737          DO ji = 1, jpi 
    738             zmsk00(ji,jj) = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi06 ) ) ! 1 if ice, 0 if no ice 
    739          END DO 
    740       END DO 
    741  
    742750      ! --- ice-ocean, ice-atm. & ice-oceanbottom(landfast) stresses --- ! 
    743751      IF(  iom_use('utau_oi') .OR. iom_use('vtau_oi') .OR. iom_use('utau_ai') .OR. iom_use('vtau_ai') .OR. & 
     
    796804         DEALLOCATE( zsig1 , zsig2 , zsig3 ) 
    797805      ENDIF 
    798        
     806 
    799807      ! --- SIMIP --- ! 
    800808      IF(  iom_use('dssh_dx') .OR. iom_use('dssh_dy') .OR. & 
     
    852860      ENDIF 
    853861      ! 
     862      ! --- convergence tests --- ! 
     863      IF( ln_rhg_chkcvg ) THEN 
     864         IF( iom_use('uice_cvg') ) THEN  ! output: u(t=nn_nevp) - u(t=nn_nevp-1) 
     865            CALL iom_put( 'uice_cvg', MAX( ABS( u_ice(:,:) - zu_ice(:,:) ) * umask(:,:,1) , & 
     866               &                           ABS( v_ice(:,:) - zv_ice(:,:) ) * vmask(:,:,1) ) * zmsk15(:,:) ) 
     867         ENDIF 
     868      ENDIF       
     869      ! 
     870      DEALLOCATE( zmsk00, zmsk15 ) 
     871      ! 
    854872   END SUBROUTINE ice_dyn_rhg_evp 
     873 
     874 
     875   SUBROUTINE rhg_cvg( kt, kiter, kitermax, pu, pv, pub, pvb ) 
     876      !!---------------------------------------------------------------------- 
     877      !!                    ***  ROUTINE rhg_cvg  *** 
     878      !!                      
     879      !! ** Purpose :   check convergence of oce rheology 
     880      !! 
     881      !! ** Method  :   create a file ice_cvg.nc containing the convergence of ice velocity 
     882      !!                during the sub timestepping of rheology so as: 
     883      !!                  uice_cvg = MAX( u(t+1) - u(t) , v(t+1) - v(t) ) 
     884      !!                This routine is called every sub-iteration, so it is cpu expensive 
     885      !! 
     886      !! ** Note    :   for the first sub-iteration, uice_cvg is set to 0 (too large otherwise)    
     887      !!---------------------------------------------------------------------- 
     888      INTEGER ,                 INTENT(in) ::   kt, kiter, kitermax       ! ocean time-step index 
     889      REAL(wp), DIMENSION(:,:), INTENT(in) ::   pu, pv, pub, pvb          ! now and before velocities 
     890      !! 
     891      INTEGER           ::   it, idtime, istatus 
     892      INTEGER           ::   ji, jj          ! dummy loop indices 
     893      REAL(wp)          ::   zresm           ! local real  
     894      CHARACTER(len=20) ::   clname 
     895      REAL(wp), DIMENSION(jpi,jpj) ::   zres           ! check convergence 
     896      !!---------------------------------------------------------------------- 
     897 
     898      ! create file 
     899      IF( kt == nit000 .AND. kiter == 1 ) THEN 
     900         ! 
     901         IF( lwp ) THEN 
     902            WRITE(numout,*) 
     903            WRITE(numout,*) 'rhg_cvg : ice rheology convergence control' 
     904            WRITE(numout,*) '~~~~~~~' 
     905         ENDIF 
     906         ! 
     907         IF( lwm ) THEN 
     908            clname = 'ice_cvg.nc' 
     909            IF( .NOT. Agrif_Root() )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
     910            istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, ncvgid ) 
     911            istatus = NF90_DEF_DIM( ncvgid, 'time'  , NF90_UNLIMITED, idtime ) 
     912            istatus = NF90_DEF_VAR( ncvgid, 'uice_cvg', NF90_DOUBLE   , (/ idtime /), nvarid ) 
     913            istatus = NF90_ENDDEF(ncvgid) 
     914         ENDIF 
     915         ! 
     916      ENDIF 
     917 
     918      ! time 
     919      it = ( kt - 1 ) * kitermax + kiter 
     920       
     921      ! convergence 
     922      IF( kiter == 1 ) THEN ! remove the first iteration for calculations of convergence (always very large) 
     923         zresm = 0._wp 
     924      ELSE 
     925         DO jj = 1, jpj 
     926            DO ji = 1, jpi 
     927               zres(ji,jj) = MAX( ABS( pu(ji,jj) - pub(ji,jj) ) * umask(ji,jj,1), & 
     928                  &               ABS( pv(ji,jj) - pvb(ji,jj) ) * vmask(ji,jj,1) ) * zmsk15(ji,jj) 
     929            END DO 
     930         END DO 
     931         zresm = MAXVAL( zres ) 
     932         CALL mpp_max( 'icedyn_rhg_evp', zresm )   ! max over the global domain 
     933      ENDIF 
     934 
     935      IF( lwm ) THEN 
     936         ! write variables 
     937         istatus = NF90_PUT_VAR( ncvgid, nvarid, (/zresm/), (/it/), (/1/) ) 
     938         ! close file 
     939         IF( kt == nitend )   istatus = NF90_CLOSE(ncvgid) 
     940      ENDIF 
     941       
     942   END SUBROUTINE rhg_cvg 
    855943 
    856944 
     
    910998   END SUBROUTINE rhg_evp_rst 
    911999 
     1000    
    9121001#else 
    9131002   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.