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 14360 for NEMO/branches/2021 – NEMO

Changeset 14360 for NEMO/branches/2021


Ignore:
Timestamp:
2021-01-28T18:15:06+01:00 (3 years ago)
Author:
mathiot
Message:

update speeding ticket code + minor fixes in velocity used in icb_ground for stage 3 and 4

Location:
NEMO/branches/2021/ticket2581_NEMO4.0-HEAD_icb_speeding_ticket
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/ticket2581_NEMO4.0-HEAD_icb_speeding_ticket/cfgs/SHARED/namelist_ref

    r13511 r14360  
    536536   rn_test_box             = 108.0,  116.0, -66.0, -58.0 
    537537   ln_use_calving          = .false. ! Use calving data even when nn_test_icebergs > 0 
    538    rn_speed_limit          = 0.      ! CFL speed limit for a berg 
     538   rn_speed_limit          = 0.      ! CFL speed limit for a berg (safe value is 0.4, see #2581) 
    539539 
    540540   cn_dir      = './'      !  root directory for the calving data location 
  • NEMO/branches/2021/ticket2581_NEMO4.0-HEAD_icb_speeding_ticket/src/OCE/ICB/icbdyn.F90

    r13263 r14360  
    1414   USE dom_oce        ! NEMO ocean domain 
    1515   USE phycst         ! NEMO physical constants 
     16   USE in_out_manager                      ! IO parameters 
    1617   ! 
    1718   USE icb_oce        ! define iceberg arrays 
     
    8586         !                                         !**   A1 = A(X1,V1) 
    8687         CALL icb_accel( berg , zxi1, ze1, zuvel1, zuvel1, zax1,     & 
    87             &                   zyj1, ze2, zvvel1, zvvel1, zay1, zdt_2 ) 
     88            &                   zyj1, ze2, zvvel1, zvvel1, zay1, zdt_2, 1./2. ) 
    8889         ! 
    8990         zu1 = zuvel1 / ze1                           !**   V1 in d(i,j)/dt 
     
    102103         !                                         !**   A2 = A(X2,V2) 
    103104         CALL icb_accel( berg , zxi2, ze1, zuvel2, zuvel1, zax2,    & 
    104             &                   zyj2, ze2, zvvel2, zvvel1, zay2, zdt_2 ) 
     105            &                   zyj2, ze2, zvvel2, zvvel1, zay2, zdt_2, 1./2. ) 
    105106         ! 
    106107         zu2 = zuvel2 / ze1                           !**   V2 in d(i,j)/dt 
     
    113114         zyj3  = zyj1  + zdt_2 * zv2   ;   zvvel3 = zvvel1 + zdt_2 * zay2 
    114115         ! 
    115          CALL icb_ground( zxi3, zxi1, zu3,   & 
    116             &                zyj3, zyj1, zv3, ll_bounced ) 
     116         CALL icb_ground( zxi3, zxi1, zu2,   & 
     117            &             zyj3, zyj1, zv2, ll_bounced ) 
    117118 
    118119         !                                         !**   A3 = A(X3,V3) 
    119120         CALL icb_accel( berg , zxi3, ze1, zuvel3, zuvel1, zax3,    & 
    120             &                   zyj3, ze2, zvvel3, zvvel1, zay3, zdt ) 
     121            &                   zyj3, ze2, zvvel3, zvvel1, zay3, zdt, 1. ) 
    121122         ! 
    122123         zu3 = zuvel3 / ze1                           !**   V3 in d(i,j)/dt 
     
    129130         zyj4 = zyj1 + zdt * zv3   ;   zvvel4 = zvvel1 + zdt * zay3 
    130131 
    131          CALL icb_ground( zxi4, zxi1, zu4,   & 
    132             &             zyj4, zyj1, zv4, ll_bounced ) 
     132         CALL icb_ground( zxi4, zxi1, zu3,   & 
     133            &             zyj4, zyj1, zv3, ll_bounced ) 
    133134 
    134135         !                                         !**   A4 = A(X4,V4) 
    135136         CALL icb_accel( berg , zxi4, ze1, zuvel4, zuvel1, zax4,    & 
    136             &                   zyj4, ze2, zvvel4, zvvel1, zay4, zdt ) 
     137            &                   zyj4, ze2, zvvel4, zvvel1, zay4, zdt, 1. ) 
    137138 
    138139         zu4 = zuvel4 / ze1                           !**   V4 in d(i,j)/dt 
     
    235236 
    236237   SUBROUTINE icb_accel( berg , pxi, pe1, puvel, puvel0, pax,                & 
    237       &                         pyj, pe2, pvvel, pvvel0, pay, pdt ) 
     238      &                         pyj, pe2, pvvel, pvvel0, pay, pdt, pcfl_scale ) 
    238239      !!---------------------------------------------------------------------- 
    239240      !!                  ***  ROUTINE icb_accel  *** 
     
    244245      !!---------------------------------------------------------------------- 
    245246      TYPE(iceberg ), POINTER, INTENT(in   ) ::   berg             ! berg 
     247      REAL(wp)               , INTENT(in   ) ::   pcfl_scale 
    246248      REAL(wp)               , INTENT(in   ) ::   pxi   , pyj      ! berg position in (i,j) referential 
    247249      REAL(wp)               , INTENT(in   ) ::   puvel , pvvel    ! berg velocity [m/s] 
     
    361363         zspeed = SQRT( zuveln*zuveln + zvveln*zvveln )    ! Speed of berg 
    362364         IF( zspeed > 0._wp ) THEN 
    363             zloc_dx = MIN( pe1, pe2 )                          ! minimum grid spacing 
    364             zspeed_new = zloc_dx / pdt * rn_speed_limit        ! Speed limit as a factor of dx / dt 
     365            zloc_dx = MIN( pe1, pe2 )                                ! minimum grid spacing 
     366            ! cfl scale is function of the RK4 step 
     367            zspeed_new = zloc_dx / pdt * rn_speed_limit * pcfl_scale ! Speed limit as a factor of dx / dt 
    365368            IF( zspeed_new < zspeed ) THEN 
    366                zuveln = zuveln * ( zspeed_new / zspeed )        ! Scale velocity to reduce speed 
    367                zvveln = zvveln * ( zspeed_new / zspeed )        ! without changing the direction 
     369               zuveln = zuveln * ( zspeed_new / zspeed )             ! Scale velocity to reduce speed 
     370               zvveln = zvveln * ( zspeed_new / zspeed )             ! without changing the direction 
     371               pax = (zuveln - puvel0)/pdt 
     372               pay = (zvveln - pvvel0)/pdt 
     373               WRITE(numout,*) 'speeding ticket (zspeed_new, zspeed): ',zspeed_new, zspeed, pdt, pcfl_scale    
     374               CALL FLUSH(numout) 
    368375               CALL icb_dia_speed() 
    369376            ENDIF 
Note: See TracChangeset for help on using the changeset viewer.