Changeset 989


Ignore:
Timestamp:
11/08/19 17:23:11 (5 years ago)
Author:
jisesh
Message:

devel: Added nudging outside the boundary of the domain in addidion to inside nudging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/src/dissip/nudging_mod.f90

    r973 r989  
    1212  PRIVATE 
    1313  ! nudging will be active outside a disc of radius 'radius' centered at 'center_lon', 'center lat'. 
    14   REAL(rstd) :: center_lon, center_lat, nudging_radius, nudging_relaxation_time 
    15   !$OMP THREADPRIVATE(center_lon, center_lat, nudging_radius, nudging_relaxation_time) 
     14  REAL(rstd) :: center_lon, center_lat, nudging_radius, nudging_relaxation_time, & 
     15       nudging_relaxation_time_in,nudging_relaxation_time_out 
     16  !$OMP THREADPRIVATE(center_lon, center_lat, nudging_radius, nudging_relaxation_time,nudging_relaxation_time_in,nudging_relaxation_time_out) 
    1617  TYPE(t_field),POINTER :: f_relax_coef_e(:), f_target_ue(:), & 
    1718       f_relax_coef_i(:), f_target_theta_rhodz(:),f_target_ps(:) 
     
    4950    !nudging_time=0 
    5051 
    51     nudging_relaxation_time = 0. 
    52     CALL getin('nudging_relaxation_time', nudging_relaxation_time) 
    53     nudging_relaxation_time = nudging_relaxation_time/scale_factor 
     52    nudging_relaxation_time_in = 0. 
     53    nudging_relaxation_time_out = 0. 
     54    CALL getin('nudging_relaxation_time_in', nudging_relaxation_time_in) 
     55    CALL getin('nudging_relaxation_time_out', nudging_relaxation_time_out) 
     56    nudging_relaxation_time_in = nudging_relaxation_time_in/scale_factor 
     57    nudging_relaxation_time_out = nudging_relaxation_time_out/scale_factor 
     58    IF(nudging_relaxation_time_in .EQ. 0. .AND. nudging_relaxation_time_out .EQ. 0.) THEN 
     59        PRINT*," nudging_relaxation_time_in and nudging_relaxation_time_out values can not be 0. at the same time" 
     60    ENDIF 
    5461 
    5562    CALL getin("guided_nudging_field",guided_nudging_field) 
     
    114121       IF (c>0.99) c=1 
    115122       IF (c<-0.99) c=-1 
    116        relax_coef = .5*(1.+c) ! rescale to [0,1] range ; ! 1 inside circle, 0 outside 
     123       c = .5*(1.+c) ! rescale to [0,1] range ; ! 1 inside circle, 0 outside 
    117124    ELSE 
    118125       c = 0. 
    119126    END IF 
    120127 
    121     relax_coef = 1. - (1.-relax_coef) * dt / (dt + nudging_relaxation_time) 
     128    nudging_relaxation_time = c*nudging_relaxation_time_in + (1.-c)*nudging_relaxation_time_out  
     129    relax_coef = 1. - dt/(dt + nudging_relaxation_time) 
    122130  END FUNCTION relax_coef 
    123131 
Note: See TracChangeset for help on using the changeset viewer.