Skip to content

Commit

Permalink
FV3: this commits #refs 47772 .
Browse files Browse the repository at this point in the history
Change-Id: I1c71b8cb9334dfa41ce7b961db413246d040e97e
  • Loading branch information
TomBlack-NOAA committed Jul 23, 2018
1 parent e8fc934 commit 0787850
Show file tree
Hide file tree
Showing 37 changed files with 6,914 additions and 510 deletions.
41 changes: 39 additions & 2 deletions atmos_cubed_sphere/driver/fvGFS/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ module atmosphere_mod
use block_control_mod, only: block_control_type
use constants_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks
use time_manager_mod, only: time_type, get_time, set_time, operator(+), &
operator(-)
operator(-), operator(/), time_type_to_real
use fms_mod, only: file_exist, open_namelist_file, &
close_file, error_mesg, FATAL, &
check_nml_error, stdlog, &
write_version_number, &
set_domain, &
read_data, &
mpp_clock_id, mpp_clock_begin, &
mpp_clock_end, CLOCK_SUBCOMPONENT, &
clock_flag_default, nullify_domain
Expand Down Expand Up @@ -185,6 +186,9 @@ module atmosphere_mod
use fv_sg_mod, only: fv_subgrid_z
use fv_update_phys_mod, only: fv_update_phys
use fv_nwp_nudge_mod, only: fv_nwp_nudge_init, fv_nwp_nudge_end, do_adiabatic_init
use fv_regional_mod, only: start_regional_restart, read_new_bc_data
use fv_regional_mod, only: a_step, p_step
use fv_regional_mod, only: current_time_in_seconds

use mpp_domains_mod, only: mpp_get_data_domain, mpp_get_compute_domain

Expand Down Expand Up @@ -268,6 +272,9 @@ subroutine atmosphere_init (Time_init, Time, Time_step, Grid_box, area)
character(len=32) :: tracer_name, tracer_units
real :: ps1, ps2

current_time_in_seconds = time_type_to_real( Time - Time_init )
if (mpp_pe() == 0) write(*,"('atmosphere_init: current_time_seconds = ',f9.1)")current_time_in_seconds

call timing_on('ATMOS_INIT')
allocate(pelist(mpp_npes()))
call mpp_get_current_pelist(pelist)
Expand All @@ -292,6 +299,11 @@ subroutine atmosphere_init (Time_init, Time, Time_step, Grid_box, area)

Atm(mytile)%Time_init = Time_init

a_step=0
if(Atm(mytile)%flagstruct%warm_start)then
a_step=nint(current_time_in_seconds/dt_atmos)
endif

!----- write version and namelist to log file -----
call write_version_number ( 'fvGFS/ATMOSPHERE_MOD', version )

Expand Down Expand Up @@ -388,6 +400,14 @@ subroutine atmosphere_init (Time_init, Time, Time_step, Grid_box, area)

call timing_off('ATMOS_INIT')

! --- 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), &
isc, iec, jsc, jec, &
isd, ied, jsd, jed )
endif

if ( Atm(mytile)%flagstruct%na_init>0 ) then
call nullify_domain ( )
if ( .not. Atm(mytile)%flagstruct%hydrostatic ) then
Expand Down Expand Up @@ -480,12 +500,27 @@ subroutine atmosphere_dynamics ( Time )
integer :: itrac, n, psc
integer :: k, w_diff, nt_dyn

type(time_type) :: atmos_time
integer :: atmos_time_step

!---- Call FV dynamics -----

call mpp_clock_begin (id_dynam)

n = mytile

a_step = a_step + 1
!
!*** If this is a regional run then read in the next boundary data when it is time.
!
if(Atm(n)%flagstruct%regional)then

call read_new_bc_data(Atm(n), Time, Time_step_atmos, p_split, &
isd, ied, jsd, jed )
endif

do psc=1,abs(p_split)
p_step = psc
call timing_on('fv_dynamics')
!uc/vc only need be same on coarse grid? However BCs do need to be the same
call fv_dynamics(npx, npy, npz, nq, Atm(n)%ng, dt_atmos/real(abs(p_split)),&
Expand Down Expand Up @@ -688,14 +723,16 @@ end subroutine set_atmosphere_pelist
!! the "domain2d" variable associated with the coupling grid and the
!! decomposition for the current cubed-sphere tile.
!>@detail Coupling is done using the mass/temperature grid with no halos.
subroutine atmosphere_domain ( fv_domain, layout )
subroutine atmosphere_domain ( fv_domain, layout, regional )
type(domain2d), intent(out) :: fv_domain
integer, intent(out) :: layout(2)
logical, intent(out) :: regional
! returns the domain2d variable associated with the coupling grid
! note: coupling is done using the mass/temperature grid with no halos

fv_domain = Atm(mytile)%domain_for_coupler
layout(1:2) = Atm(mytile)%layout(1:2)
regional = Atm(mytile)%flagstruct%regional

end subroutine atmosphere_domain

Expand Down
7 changes: 4 additions & 3 deletions atmos_cubed_sphere/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif

LIBRARY = libfv3core.a

FFLAGS += -I../fms -I../fms/include -I../gfsphysics -I ../ipd -I../io -I../namphysics
FFLAGS += -I../fms -I../fms/include -I../gfsphysics -I../ipd -I../io -I../namphysics

SRCS_f =

Expand All @@ -37,6 +37,7 @@ SRCS_F90 = \
./model/fv_grid_utils.F90 \
./model/fv_mapz.F90 \
./model/fv_nesting.F90 \
./model/fv_regional_bc.F90 \
./model/fv_sg.F90 \
./model/fv_tracer2d.F90 \
./model/fv_update_phys.F90 \
Expand Down Expand Up @@ -65,7 +66,7 @@ SRCS_F90 = \
./driver/fvGFS/fv_nggps_diag.F90 \
./driver/fvGFS/atmosphere.F90

SRCS_c =
SRCS_c =

DEPEND_FILES = $(SRCS_f) $(SRCS_f90) $(SRCS_F) $(SRCS_F90)

Expand Down Expand Up @@ -102,7 +103,7 @@ $(LIBRARY): $(OBJS)
clean:
@echo "Cleaning fv3core ... "
@echo
$(RM) -f $(LIBRARY) *__genmod.f90 */*.o */*/*.o *.mod *.lst *.i depend
$(RM) -f $(LIBRARY) *__genmod.f90 */*.o */*/*.o *.mod *.i90 *.lst *.i depend

MKDEPENDS = ../mkDepends.pl
include ../conf/make.rules
Expand Down
14 changes: 7 additions & 7 deletions atmos_cubed_sphere/model/a2b_edge.F90
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ subroutine a2b_ord4(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace

! Corners:
! 3-way extrapolation
if (gridstruct%nested) then
if (gridstruct%nested .or. gridstruct%regional) then

do j=js-2,je+2
do i=is,ie+1
Expand Down Expand Up @@ -201,7 +201,7 @@ subroutine a2b_ord4(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace
! Y-Interior:
!------------

if (gridstruct%nested) then
if (gridstruct%nested .or. gridstruct%regional) then


do j=js,je+1
Expand Down Expand Up @@ -257,7 +257,7 @@ subroutine a2b_ord4(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace
end if
!--------------------------------------

if (gridstruct%nested) then
if (gridstruct%nested .or. gridstruct%regional) then

do j=js, je+1
do i=is,ie+1
Expand Down Expand Up @@ -463,7 +463,7 @@ subroutine a2b_ord4(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace
!------------
! X-Interior:
!------------
if (gridstruct%nested) then
if (gridstruct%nested .or. gridstruct%regional) then

do j=js-2,je+2
do i=is, ie+1
Expand Down Expand Up @@ -534,7 +534,7 @@ subroutine a2b_ord4(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace
!------------
! Y-Interior:
!------------
if (gridstruct%nested) then
if (gridstruct%nested .or. gridstruct%regional) then

do j=js,je+1
do i=is-2, ie+2
Expand Down Expand Up @@ -602,7 +602,7 @@ subroutine a2b_ord4(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace

end if

if (gridstruct%nested) then
if (gridstruct%nested .or. gridstruct%regional) then

do j=js,je+1
do i=is,ie+1
Expand Down Expand Up @@ -722,7 +722,7 @@ subroutine a2b_ord2(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace

if (gridstruct%grid_type < 3) then

if (gridstruct%nested) then
if (gridstruct%nested .or. gridstruct%regional) then

do j=js-2,je+1+2
do i=is-2,ie+1+2
Expand Down
Loading

0 comments on commit 0787850

Please sign in to comment.