Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regional BC blending and BCs into GSI #16

Merged
merged 12 commits into from
Apr 8, 2020
14 changes: 13 additions & 1 deletion driver/fvGFS/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ subroutine atmosphere_init (Time_init, Time, Time_step, Grid_box, area)
! --- initiate the start for a restarted regional forecast
if ( Atm(mytile)%gridstruct%regional .and. Atm(mytile)%flagstruct%warm_start ) then

call start_regional_restart(Atm(1), &
call start_regional_restart(Atm(1), dt_atmos, &
isc, iec, jsc, jec, &
isd, ied, jsd, jed )
endif
Expand Down Expand Up @@ -1630,6 +1630,18 @@ subroutine atmosphere_state_update (Time, IPD_Data, IAU_Data, Atm_block, flip_vc

call nullify_domain()
call timing_on('FV_DIAG')

do k=1, Atm(n)%npz
do j=lbound(Atm(n)%pt,2),ubound(Atm(n)%pt,2)
do i=lbound(Atm(n)%pt,1),ubound(Atm(n)%pt,1)
if(Atm(n)%pt(i,j,k)>400.)then
Copy link
Collaborator

@junwang-noaa junwang-noaa Apr 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be added later, but If we have bad Temperature >400, can we stop model from continue running (call mpp_error)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you turn on the namelist "range_warn" the call to fv_diag will check the temperature for the data domain. An FMS "NOTE" will be emitted for temperatures outside the range of (150 - 350).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this block since I'm sure I put it there for debugging.

write(0,44351)i,j,k,Atm(n)%pt(i,j,k)
44351 format(' BAD T atmosphere_state_update before fv_diag pt(',i3,',',i3,',',i3,')=',e12.5)
endif
enddo
enddo
enddo

call fv_diag(Atm(mytile:mytile), zvir, fv_time, Atm(mytile)%flagstruct%print_freq)
first_diag = .false.
call timing_off('FV_DIAG')
Expand Down
5 changes: 5 additions & 0 deletions model/fv_arrays.F90
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ module fv_arrays_mod
!< The default value is 4 (recommended); fourth-order interpolation
!< is used unless c2l_ord = 2.

integer :: nrows_blend = 0 !< # of blending rows in the outer integration domain.

real(kind=R_GRID) :: dx_const = 1000. !< Specifies the (uniform) grid-cell-width in the x-direction
!< on a doubly-periodic grid (grid_type = 4) in meters.
Expand All @@ -1006,6 +1007,10 @@ module fv_arrays_mod

integer :: bc_update_interval = 3 !< Default setting for interval (hours) between external regional BC data files.

logical :: regional_bcs_from_gsi = .false. !< Default setting for using DA-updated BC files.

logical :: write_restart_with_bcs = .false. !< Default setting for writing restart files with boundary rows.

!>Convenience pointers
integer, pointer :: grid_number

Expand Down
15 changes: 14 additions & 1 deletion model/fv_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ module fv_control_mod
logical, pointer :: nested, twowaynest
logical, pointer :: regional
integer, pointer :: bc_update_interval
integer, pointer :: nrows_blend
logical, pointer :: regional_bcs_from_gsi
logical, pointer :: write_restart_with_bcs
integer, pointer :: parent_tile, refinement, nestbctype, nestupdate, nsponge, ioffset, joffset
real, pointer :: s_weight, update_blend

Expand Down Expand Up @@ -670,7 +673,8 @@ subroutine run_setup(Atm, dt_atmos, grids_on_this_pe, p_split)
nested, twowaynest, parent_grid_num, parent_tile, nudge_qv, &
refinement, nestbctype, nestupdate, nsponge, s_weight, &
ioffset, joffset, check_negative, nudge_ic, halo_update_type, gfs_phil, agrid_vel_rst, &
do_uni_zfull, adj_mass_vmr, fac_n_spl, fhouri, regional, bc_update_interval
do_uni_zfull, adj_mass_vmr, fac_n_spl, fhouri, regional, bc_update_interval, &
regional_bcs_from_gsi, write_restart_with_bcs, nrows_blend

namelist /test_case_nml/test_case, bubble_do, alpha, nsolitons, soliton_Umax, soliton_size
#ifdef MULTI_GASES
Expand Down Expand Up @@ -892,6 +896,12 @@ subroutine run_setup(Atm, dt_atmos, grids_on_this_pe, p_split)
Atm(n)%neststruct%refinement = -1
end if

if (Atm(n)%flagstruct%regional) then
if ( consv_te > 0.) then
call mpp_error(FATAL, 'The global energy fixer cannot be used on a regional grid. consv_te must be set to 0.')
end if
end if

if (Atm(n)%neststruct%nested) then
if (Atm(n)%flagstruct%grid_type >= 4 .and. Atm(n)%parent_grid%flagstruct%grid_type >= 4) then
Atm(n)%flagstruct%dx_const = Atm(n)%parent_grid%flagstruct%dx_const / real(Atm(n)%neststruct%refinement)
Expand Down Expand Up @@ -1233,6 +1243,9 @@ subroutine setup_pointers(Atm)
target_lon => Atm%flagstruct%target_lon
regional => Atm%flagstruct%regional
bc_update_interval => Atm%flagstruct%bc_update_interval
nrows_blend => Atm%flagstruct%nrows_blend
regional_bcs_from_gsi => Atm%flagstruct%regional_bcs_from_gsi
write_restart_with_bcs => Atm%flagstruct%write_restart_with_bcs
reset_eta => Atm%flagstruct%reset_eta
p_fac => Atm%flagstruct%p_fac
a_imp => Atm%flagstruct%a_imp
Expand Down
Loading