diff --git a/CMakeLists.txt b/CMakeLists.txt index de1ad50cf..def27a8e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,10 +108,10 @@ list(APPEND tools_srcs_extra tools/fv_iau_mod.F90) list(APPEND driver_srcs - driver/fvGFS/DYCORE_typedefs.F90 - driver/fvGFS/fv_nggps_diag.F90 - driver/fvGFS/fv_ufs_restart_io.F90 - driver/fvGFS/atmosphere.F90) + driver/UFS/DYCORE_typedefs.F90 + driver/UFS/fv_nggps_diag.F90 + driver/UFS/fv_ufs_restart_io.F90 + driver/UFS/atmosphere.F90) list(APPEND fv3_srcs ${model_srcs} ${tools_srcs}) diff --git a/docs/Doxyfile b/docs/Doxyfile index bdd6c4a75..53b833551 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -73,125 +73,62 @@ WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = -<<<<<<< HEAD -INPUT = ./documentation.dox \ - ./Preface.md \ - ./Foreword.md \ - ./Chapter1.md \ - ./Chapter2.md \ - ./Chapter3.md \ - ./Chapter4.md \ - ./Chapter5.md \ - ./Chapter6.md \ - ./Chapter7.md \ - ./Chapter8.md \ - ./Chapter9.md \ - ./appendixA.md \ - ./appendixB.md \ - ./appendixB1.md \ - ./appendixB2.md \ - ./AdvectionOperators.md \ - ./OverviewFV3Dycore.md \ - ./Links.md \ - ../model/gwdps.f \ - ../model/a2b_edge.F90 \ - ../model/boundary.F90 \ - ../model/dyn_core.F90 \ - ../model/fv_arrays.F90 \ - ../model/fv_cmp.F90 \ - ../model/fv_control.F90 \ - ../model/fv_dynamics.F90 \ - ../model/fv_fill.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 \ - ../model/multi_gases.F90 \ - ../model/nh_core.F90 \ - ../model/nh_utils.F90 \ - ../model/sw_core.F90 \ - ../model/tp_core.F90 \ - ../tools/external_ic.F90 \ - ../tools/external_sst.F90 \ - ../tools/fv_diagnostics.F90 \ - ../tools/fv_eta.F90 \ - ../tools/fv_grid_tools.F90 \ - ../tools/fv_iau_mod.F90 \ - ../tools/fv_io.F90 \ - ../tools/fv_mp_mod.F90 \ - ../tools/fv_nudge.F90 \ - ../tools/fv_restart.F90 \ - ../tools/fv_surf_map.F90 \ - ../tools/fv_timing.F90 \ - ../tools/fv_treat_da_inc.F90 \ - ../tools/init_hydro.F90 \ - ../tools/sim_nc_mod.F90 \ - ../tools/sorted_index.F90 \ - ../tools/test_cases.F90 \ - ../driver/fvGFS/atmosphere.F90 \ - ../driver/fvGFS/DYCORE_typedefs.F90 \ - ../driver/fvGFS/fv_nggps_diag.F90 -======= -INPUT = ./documentation.dox \ - ./Preface.md \ - ./Chapter1.md \ - ./Chapter2.md \ - ./Chapter3.md \ - ./Chapter4.md \ - ./appendixA.md \ - ./appendixB.md \ - ./appendixB1.md \ - ./appendixB2.md \ - ./AdvectionOperators.md \ - ./OverviewFV3Dycore.md \ - ./Links.md \ - ../model/a2b_edge.F90 \ - ../model/boundary.F90 \ - ../model/dyn_core.F90 \ - ../model/fv_arrays.F90 \ - ../model/fv_control.F90 \ - ../model/fv_dynamics.F90 \ - ../model/fv_fill.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 \ - ../model/multi_gases.F90 \ - ../model/nh_core.F90 \ - ../model/nh_utils.F90 \ - ../model/sw_core.F90 \ - ../model/tp_core.F90 \ - ../tools/coarse_grained_diagnostics.F90 \ - ../tools/coarse_grained_restart_files.F90 \ - ../tools/coarse_graining.F90 \ - ../tools/external_ic.F90 \ - ../tools/external_sst.F90 \ - ../tools/fv_diag_column.F90 \ - ../tools/fv_diagnostics.F90 \ - ../tools/fv_eta.F90 \ - ../tools/fv_grid_tools.F90 \ - ../tools/fv_iau_mod.F90 \ - ../tools/fv_io.F90 \ - ../tools/fv_mp_mod.F90 \ - ../tools/fv_nudge.F90 \ - ../tools/fv_restart.F90 \ - ../tools/fv_surf_map.F90 \ - ../tools/fv_timing.F90 \ - ../tools/fv_treat_da_inc.F90 \ - ../tools/init_hydro.F90 \ - ../tools/sim_nc_mod.F90 \ - ../tools/sorted_index.F90 \ - ../tools/test_cases.F90 \ - ../driver/fvGFS/atmosphere.F90 \ - ../driver/fvGFS/DYCORE_typedefs.F90 \ - ../driver/fvGFS/fv_nggps_diag.F90 ->>>>>>> 6944f421bba37887394ef9552d8b88869f82dd49 +INPUT = ./documentation.dox \ + ./Preface.md \ + ./Chapter1.md \ + ./Chapter2.md \ + ./Chapter3.md \ + ./Chapter4.md \ + ./appendixA.md \ + ./appendixB.md \ + ./appendixB1.md \ + ./appendixB2.md \ + ./AdvectionOperators.md \ + ./OverviewFV3Dycore.md \ + ./Links.md \ + ../model/a2b_edge.F90 \ + ../model/boundary.F90 \ + ../model/dyn_core.F90 \ + ../model/fv_arrays.F90 \ + ../model/fv_control.F90 \ + ../model/fv_dynamics.F90 \ + ../model/fv_fill.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 \ + ../model/multi_gases.F90 \ + ../model/nh_core.F90 \ + ../model/nh_utils.F90 \ + ../model/sw_core.F90 \ + ../model/tp_core.F90 \ + ../tools/coarse_grained_diagnostics.F90 \ + ../tools/coarse_grained_restart_files.F90 \ + ../tools/coarse_graining.F90 \ + ../tools/external_ic.F90 \ + ../tools/external_sst.F90 \ + ../tools/fv_diag_column.F90 \ + ../tools/fv_diagnostics.F90 \ + ../tools/fv_eta.F90 \ + ../tools/fv_grid_tools.F90 \ + ../tools/fv_iau_mod.F90 \ + ../tools/fv_io.F90 \ + ../tools/fv_mp_mod.F90 \ + ../tools/fv_nudge.F90 \ + ../tools/fv_restart.F90 \ + ../tools/fv_surf_map.F90 \ + ../tools/fv_timing.F90 \ + ../tools/fv_treat_da_inc.F90 \ + ../tools/init_hydro.F90 \ + ../tools/sim_nc_mod.F90 \ + ../tools/sorted_index.F90 \ + ../tools/test_cases.F90 \ + ../driver/UFS/atmosphere.F90 \ + ../driver/UFS/DYCORE_typedefs.F90 \ + ../driver/UFS/fv_nggps_diag.F90 INPUT_ENCODING = UTF-8 FILE_PATTERNS = RECURSIVE = YES diff --git a/driver/fvGFS/DYCORE_typedefs.F90 b/driver/UFS/DYCORE_typedefs.F90 similarity index 100% rename from driver/fvGFS/DYCORE_typedefs.F90 rename to driver/UFS/DYCORE_typedefs.F90 diff --git a/driver/fvGFS/atmosphere.F90 b/driver/UFS/atmosphere.F90 similarity index 91% rename from driver/fvGFS/atmosphere.F90 rename to driver/UFS/atmosphere.F90 index 5675669c4..b9abdb28d 100644 --- a/driver/fvGFS/atmosphere.F90 +++ b/driver/UFS/atmosphere.F90 @@ -110,7 +110,11 @@ module atmosphere_mod ! ! ! IPD_typedefs_mod -! IPD_data_type, kind_phys => IPD_kind_phys +! IPD_control_type, kind_phys +! +! +! GFS_typedefs_mod +! GFS_statein_type, GFS_stateout_type, GFS_sfcprop_type ! ! ! mpp_mod @@ -176,7 +180,8 @@ module atmosphere_mod NO_TRACER, get_tracer_names use DYCORE_typedefs, only: DYCORE_data_type #ifdef GFS_TYPES -use GFS_typedefs, only: IPD_data_type => GFS_data_type, IPD_control_type => GFS_control_type, kind_phys +use GFS_typedefs, only: IPD_control_type => GFS_control_type, kind_phys +use GFS_typedefs, only: GFS_statein_type, GFS_stateout_type, GFS_sfcprop_type #else use IPD_typedefs, only: IPD_data_type, IPD_control_type, kind_phys => IPD_kind_phys #endif @@ -245,7 +250,7 @@ module atmosphere_mod ! version number of this module ! Include variable "version" to be written to log file. #include -character(len=20) :: mod_name = 'fvGFS/atmosphere_mod' +character(len=20) :: mod_name = 'UFS/atmosphere_mod' !---- private data ---- type (time_type) :: Time_step_atmos @@ -1500,15 +1505,17 @@ end subroutine get_stock_pe !>@brief The subroutine 'atmosphere_state_update' is an API to apply tendencies !! and compute a consistent prognostic state. - subroutine atmosphere_state_update (Time, IPD_Data, IAU_Data, Atm_block, flip_vc) + subroutine atmosphere_state_update (Time, IPD_Control, IPD_Statein, IPD_Stateout, IAU_Data, Atm_block, flip_vc) type(time_type), intent(in) :: Time - type(IPD_data_type), intent(in) :: IPD_Data(:) + type(IPD_control_type), intent(in) :: IPD_Control + type(GFS_statein_type), intent(in) :: IPD_Statein + type(GFS_stateout_type), intent(inout) :: IPD_Stateout type(IAU_external_data_type), intent(in) :: IAU_Data type(block_control_type), intent(in) :: Atm_block logical, intent(in) :: flip_vc !--- local variables --- type(time_type) :: Time_prev, Time_next - integer :: i, j, ix, k, k1, n, w_diff, nt_dyn, iq + integer :: i, j, ix, im, k, k1, n, w_diff, nt_dyn, iq integer :: nb, blen, nwat, dnats, nq_adv real(kind=kind_phys):: rcp, q0, qwat(nq), qt, rdt real psum, qsum, psumb, qsumb, betad @@ -1573,7 +1580,8 @@ subroutine atmosphere_state_update (Time, IPD_Data, IAU_Data, Atm_block, flip_vc do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - IPD_Data(nb)%Stateout%gq0(ix,k,:) = IPD_Data(nb)%Stateout%gq0(ix,k,:) + IAU_Data%tracer_inc(i,j,k1,:)*dt_atmos + im = IPD_control%chunk_begin(nb)+ix-1 + IPD_Stateout%gq0(im,k,:) = IPD_Stateout%gq0(im,k,:) + IAU_Data%tracer_inc(i,j,k1,:)*dt_atmos enddo enddo enddo @@ -1584,25 +1592,27 @@ subroutine atmosphere_state_update (Time, IPD_Data, IAU_Data, Atm_block, flip_vc !--- put u/v tendencies into haloed arrays u_dt and v_dt !$OMP parallel do default (none) & !$OMP shared (rdt, n, nq, dnats, npz, ncnst, nwat, mygrid, u_dt, v_dt, t_dt,& -!$OMP Atm, IPD_Data, Atm_block, sphum, liq_wat, rainwat, ice_wat, & +!$OMP Atm, IPD_Control, IPD_Statein, IPD_Stateout, Atm_block, sphum, liq_wat, rainwat, ice_wat, & #ifdef MULTI_GASES !$OMP num_gas, & #endif !$OMP snowwat, graupel, nq_adv, flip_vc) & -!$OMP private (nb, blen, i, j, k, k1, ix, q0, qwat, qt, tracer_name) +!$OMP private (nb, blen, i, j, k, k1, ix, im, q0, qwat, qt, tracer_name) do nb = 1,Atm_block%nblks !SJL: perform vertical filling to fix the negative humidity if the SAS convection scheme is used ! This call may be commented out if RAS or other positivity-preserving CPS is used. blen = Atm_block%blksz(nb) - if (Atm(n)%flagstruct%fill_gfs) call fill_gfs(blen, npz, IPD_Data(nb)%Statein%prsi, IPD_Data(nb)%Stateout%gq0, 1.e-9_kind_phys) + if (Atm(n)%flagstruct%fill_gfs) call fill_gfs(blen, npz, IPD_Statein%prsi(IPD_control%chunk_begin(nb):IPD_control%chunk_end(nb),:), & + IPD_Stateout%gq0(IPD_control%chunk_begin(nb):IPD_control%chunk_end(nb),:,:), 1.e-9_kind_phys) !LMH 28sep18: If the name of a tracer ends in 'nopbl' then do NOT update it; !override this by setting Stateout%gq0(:,:,iq) to the input value do iq = 1, nq call get_tracer_names (MODEL_ATMOS, iq, tracer_name) if (index(tracer_name, 'nopbl') > 0) then - IPD_Data(nb)%Stateout%gq0(:,:,iq) = IPD_Data(nb)%Statein%qgrs(:,:,iq) + IPD_Stateout%gq0(IPD_control%chunk_begin(nb):IPD_control%chunk_end(nb),:,iq) = & + IPD_Statein%qgrs(IPD_control%chunk_begin(nb):IPD_control%chunk_end(nb),:,iq) endif enddo @@ -1616,22 +1626,25 @@ subroutine atmosphere_state_update (Time, IPD_Data, IAU_Data, Atm_block, flip_vc do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - u_dt(i,j,k1) = u_dt(i,j,k1) + (IPD_Data(nb)%Stateout%gu0(ix,k) - IPD_Data(nb)%Statein%ugrs(ix,k)) * rdt - v_dt(i,j,k1) = v_dt(i,j,k1) + (IPD_Data(nb)%Stateout%gv0(ix,k) - IPD_Data(nb)%Statein%vgrs(ix,k)) * rdt -! t_dt(i,j,k1) = (IPD_Data(nb)%Stateout%gt0(ix,k) - IPD_Data(nb)%Statein%tgrs(ix,k)) * rdt - t_dt(i,j,k1) = t_dt(i,j,k1) + (IPD_Data(nb)%Stateout%gt0(ix,k) - IPD_Data(nb)%Statein%tgrs(ix,k)) * rdt + im = IPD_control%chunk_begin(nb)+ix-1 + u_dt(i,j,k1) = u_dt(i,j,k1) + (IPD_Stateout%gu0(im,k) - IPD_Statein%ugrs(im,k)) * rdt + v_dt(i,j,k1) = v_dt(i,j,k1) + (IPD_Stateout%gv0(im,k) - IPD_Statein%vgrs(im,k)) * rdt +! t_dt(i,j,k1) = (IPD_Stateout%gt0(im,k) - IPD_Statein%tgrs(im,k)) * rdt + t_dt(i,j,k1) = t_dt(i,j,k1) + (IPD_Stateout%gt0(im,k) - IPD_Statein%tgrs(im,k)) * rdt ! SJL notes: ! ---- DO not touch the code below; dry mass conservation may change due to 64bit <-> 32bit conversion +! DH notes: +! ---- Oops I did it again ... ! GFS total air mass = dry_mass + water_vapor (condensate excluded) ! GFS mixing ratios = tracer_mass / (dry_mass + vapor_mass) ! FV3 total air mass = dry_mass + [water_vapor + condensate ] ! FV3 mixing ratios = tracer_mass / (dry_mass+vapor_mass+cond_mass) if(flip_vc) then - q0 = IPD_Data(nb)%Statein%prsi(ix,k) - IPD_Data(nb)%Statein%prsi(ix,k+1) + q0 = IPD_Statein%prsi(im,k) - IPD_Statein%prsi(im,k+1) else - q0 = IPD_Data(nb)%Statein%prsi(ix,k+1) - IPD_Data(nb)%Statein%prsi(ix,k) + q0 = IPD_Statein%prsi(im,k+1) - IPD_Statein%prsi(im,k) endif - qwat(1:nq_adv) = q0*IPD_Data(nb)%Stateout%gq0(ix,k,1:nq_adv) + qwat(1:nq_adv) = q0*IPD_Stateout%gq0(im,k,1:nq_adv) ! ********************************************************************************************************** ! Dry mass: the following way of updating delp is key to mass conservation with hybrid 32-64 bit computation ! ********************************************************************************************************** @@ -1645,7 +1658,7 @@ subroutine atmosphere_state_update (Time, IPD_Data, IAU_Data, Atm_block, flip_vc #endif Atm(n)%delp(i,j,k1) = q0 Atm(n)%q(i,j,k1,1:nq_adv) = qwat(1:nq_adv) / q0 -! if (dnats .gt. 0) Atm(n)%q(i,j,k1,nq_adv+1:nq) = IPD_Data(nb)%Stateout%gq0(ix,k,nq_adv+1:nq) +! if (dnats .gt. 0) Atm(n)%q(i,j,k1,nq_adv+1:nq) = IPD_Stateout%gq0(im,k,nq_adv+1:nq) enddo enddo @@ -1662,7 +1675,8 @@ subroutine atmosphere_state_update (Time, IPD_Data, IAU_Data, Atm_block, flip_vc do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - Atm(mygrid)%qdiag(i,j,k1,iq) = IPD_Data(nb)%Stateout%gq0(ix,k,iq) + im = IPD_control%chunk_begin(nb)+ix-1 + Atm(mygrid)%qdiag(i,j,k1,iq) = IPD_Stateout%gq0(im,k,iq) enddo enddo enddo @@ -2057,8 +2071,9 @@ end subroutine adiabatic_init #define _DBL_(X) X #define _RL_(X) X #endif - subroutine atmos_phys_driver_statein (IPD_Data, Atm_block,flip_vc) - type (IPD_data_type), intent(inout) :: IPD_Data(:) + subroutine atmos_phys_driver_statein (IPD_Control, IPD_Statein, Atm_block,flip_vc) + type (IPD_control_type), intent(in) :: IPD_Control + type (GFS_statein_type), intent(inout) :: IPD_Statein type (block_control_type), intent(in) :: Atm_block logical, intent(in) :: flip_vc !-------------------------------------- @@ -2068,7 +2083,7 @@ subroutine atmos_phys_driver_statein (IPD_Data, Atm_block,flip_vc) real(kind=kind_phys), parameter :: qmin = 1.0e-10 real(kind=kind_phys) :: pk0inv, ptop, pktop real(kind=kind_phys) :: rTv, dm, qgrs_rad - integer :: nb, blen, npz, i, j, k, ix, k1, kz, dnats, nq_adv + integer :: nb, blen, npz, i, j, k, ix, im, k1, kz, dnats, nq_adv #ifdef MULTI_GASES real :: q_grs(nq), q_min @@ -2087,19 +2102,27 @@ subroutine atmos_phys_driver_statein (IPD_Data, Atm_block,flip_vc) dnats = Atm(mygrid)%flagstruct%dnats nq_adv = nq - dnats + !-- level interface geopotential height (relative to the surface) + if(flip_vc) then + IPD_Statein%phii(:,1) = 0.0_kind_phys + else + IPD_Statein%phii(:,npz+1) = 0.0_kind_phys + endif + IPD_Statein%prsik(:,:) = 1.e25_kind_phys + !--------------------------------------------------------------------- ! use most up to date atmospheric properties when running serially !--------------------------------------------------------------------- !$OMP parallel do default (none) & -!$OMP shared (Atm_block, Atm, IPD_Data, npz, nq, ncnst, sphum, liq_wat, & +!$OMP shared (Atm_block, Atm, IPD_Control, IPD_Statein, npz, nq, ncnst, sphum, liq_wat, & !$OMP ice_wat, rainwat, snowwat, graupel, pk0inv, ptop, & !$OMP pktop, zvir, mygrid, dnats, nq_adv, flip_vc) & #ifdef MULTI_GASES -!$OMP private (dm, nb, blen, i, j, ix, k1, kz, rTv, qgrs_rad, q_min, q_grs) +!$OMP private (dm, nb, blen, i, j, ix, im, k1, kz, rTv, qgrs_rad, q_min, q_grs) #else -!$OMP private (dm, nb, blen, i, j, ix, k1, kz, rTv, qgrs_rad) +!$OMP private (dm, nb, blen, i, j, ix, im, k1, kz, rTv, qgrs_rad) #endif do nb = 1,Atm_block%nblks @@ -2108,14 +2131,6 @@ subroutine atmos_phys_driver_statein (IPD_Data, Atm_block,flip_vc) blen = Atm_block%blksz(nb) - !-- level interface geopotential height (relative to the surface) - if(flip_vc) then - IPD_Data(nb)%Statein%phii(:,1) = 0.0_kind_phys - else - IPD_Data(nb)%Statein%phii(:,npz+1) = 0.0_kind_phys - endif - IPD_Data(nb)%Statein%prsik(:,:) = 1.e25_kind_phys - do k = 1, npz !Indices for FV's vertical coordinate, for which 1 = top !here, k is the index for GFS's vertical coordinate, for which 1 = @@ -2129,45 +2144,46 @@ subroutine atmos_phys_driver_statein (IPD_Data, Atm_block,flip_vc) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) + im = IPD_control%chunk_begin(nb)+ix-1 - IPD_Data(nb)%Statein%tgrs(ix,k) = _DBL_(_RL_(Atm(mygrid)%pt(i,j,k1))) - IPD_Data(nb)%Statein%ugrs(ix,k) = _DBL_(_RL_(Atm(mygrid)%ua(i,j,k1))) - IPD_Data(nb)%Statein%vgrs(ix,k) = _DBL_(_RL_(Atm(mygrid)%va(i,j,k1))) - if(associated(IPD_Data(nb)%Statein%wgrs) .and. .not. Atm(mygrid)%flagstruct%hydrostatic) then - IPD_Data(nb)%Statein%wgrs(ix,k) = _DBL_(_RL_(Atm(mygrid)%w(i,j,k1))) + IPD_Statein%tgrs(im,k) = _DBL_(_RL_(Atm(mygrid)%pt(i,j,k1))) + IPD_Statein%ugrs(im,k) = _DBL_(_RL_(Atm(mygrid)%ua(i,j,k1))) + IPD_Statein%vgrs(im,k) = _DBL_(_RL_(Atm(mygrid)%va(i,j,k1))) + if(associated(IPD_Statein%wgrs) .and. .not. Atm(mygrid)%flagstruct%hydrostatic) then + IPD_Statein%wgrs(im,k) = _DBL_(_RL_(Atm(mygrid)%w(i,j,k1))) endif - IPD_Data(nb)%Statein%vvl(ix,k) = _DBL_(_RL_(Atm(mygrid)%omga(i,j,k1))) - IPD_Data(nb)%Statein%prsl(ix,k) = _DBL_(_RL_(Atm(mygrid)%delp(i,j,k1))) ! Total mass - if (Atm(mygrid)%flagstruct%do_skeb)IPD_Data(nb)%Statein%diss_est(ix,k) = _DBL_(_RL_(Atm(mygrid)%diss_est(i,j,k1))) + IPD_Statein%vvl(im,k) = _DBL_(_RL_(Atm(mygrid)%omga(i,j,k1))) + IPD_Statein%prsl(im,k) = _DBL_(_RL_(Atm(mygrid)%delp(i,j,k1))) ! Total mass + if (Atm(mygrid)%flagstruct%do_skeb) IPD_Statein%diss_est(im,k) = _DBL_(_RL_(Atm(mygrid)%diss_est(i,j,k1))) if(flip_vc) then if (.not.Atm(mygrid)%flagstruct%hydrostatic .and. (.not.Atm(mygrid)%flagstruct%use_hydro_pressure)) & - IPD_Data(nb)%Statein%phii(ix,k+1) = IPD_Data(nb)%Statein%phii(ix,k) - _DBL_(_RL_(Atm(mygrid)%delz(i,j,k1)*grav)) + IPD_Statein%phii(im,k+1) = IPD_Statein%phii(im,k) - _DBL_(_RL_(Atm(mygrid)%delz(i,j,k1)*grav)) else if (.not.Atm(mygrid)%flagstruct%hydrostatic .and. (.not.Atm(mygrid)%flagstruct%use_hydro_pressure)) & - IPD_Data(nb)%Statein%phii(ix,kz) = IPD_Data(nb)%Statein%phii(ix,kz+1) - _DBL_(_RL_(Atm(mygrid)%delz(i,j,kz)*grav)) + IPD_Statein%phii(im,kz) = IPD_Statein%phii(im,kz+1) - _DBL_(_RL_(Atm(mygrid)%delz(i,j,kz)*grav)) endif ! Convert to tracer mass: - IPD_Data(nb)%Statein%qgrs(ix,k,1:nq_adv) = _DBL_(_RL_(Atm(mygrid)%q(i,j,k1,1:nq_adv))) & - * IPD_Data(nb)%Statein%prsl(ix,k) + IPD_Statein%qgrs(im,k,1:nq_adv) = _DBL_(_RL_(Atm(mygrid)%q(i,j,k1,1:nq_adv))) & + * IPD_Statein%prsl(im,k) if (dnats > 0) & - IPD_Data(nb)%Statein%qgrs(ix,k,nq_adv+1:nq) = _DBL_(_RL_(Atm(mygrid)%q(i,j,k1,nq_adv+1:nq))) + IPD_Statein%qgrs(im,k,nq_adv+1:nq) = _DBL_(_RL_(Atm(mygrid)%q(i,j,k1,nq_adv+1:nq))) !--- SHOULD THESE BE CONVERTED TO MASS SINCE THE DYCORE DOES NOT TOUCH THEM IN ANY WAY??? !--- See Note in state update... if ( ncnst > nq) & - IPD_Data(nb)%Statein%qgrs(ix,k,nq+1:ncnst) = _DBL_(_RL_(Atm(mygrid)%qdiag(i,j,k1,nq+1:ncnst))) + IPD_Statein%qgrs(im,k,nq+1:ncnst) = _DBL_(_RL_(Atm(mygrid)%qdiag(i,j,k1,nq+1:ncnst))) ! Remove the contribution of condensates to delp (mass): if ( Atm(mygrid)%flagstruct%nwat == 6 ) then - IPD_Data(nb)%Statein%prsl(ix,k) = IPD_Data(nb)%Statein%prsl(ix,k) & - - IPD_Data(nb)%Statein%qgrs(ix,k,liq_wat) & - - IPD_Data(nb)%Statein%qgrs(ix,k,ice_wat) & - - IPD_Data(nb)%Statein%qgrs(ix,k,rainwat) & - - IPD_Data(nb)%Statein%qgrs(ix,k,snowwat) & - - IPD_Data(nb)%Statein%qgrs(ix,k,graupel) + IPD_Statein%prsl(im,k) = IPD_Statein%prsl(im,k) & + - IPD_Statein%qgrs(im,k,liq_wat) & + - IPD_Statein%qgrs(im,k,ice_wat) & + - IPD_Statein%qgrs(im,k,rainwat) & + - IPD_Statein%qgrs(im,k,snowwat) & + - IPD_Statein%qgrs(im,k,graupel) else !variable condensate numbers - IPD_Data(nb)%Statein%prsl(ix,k) = IPD_Data(nb)%Statein%prsl(ix,k) & - - sum(IPD_Data(nb)%Statein%qgrs(ix,k,2:Atm(mygrid)%flagstruct%nwat)) + IPD_Statein%prsl(im,k) = IPD_Statein%prsl(im,k) & + - sum(IPD_Statein%qgrs(im,k,2:Atm(mygrid)%flagstruct%nwat)) endif enddo enddo @@ -2175,89 +2191,98 @@ subroutine atmos_phys_driver_statein (IPD_Data, Atm_block,flip_vc) ! Re-compute pressure (dry_mass + water_vapor) derived fields: if(flip_vc) then do i=1,blen - IPD_Data(nb)%Statein%prsi(i,npz+1) = ptop + im = IPD_control%chunk_begin(nb)+i-1 + IPD_Statein%prsi(im,npz+1) = ptop enddo do k=npz,1,-1 do i=1,blen - IPD_Data(nb)%Statein%prsi(i,k) = IPD_Data(nb)%Statein%prsi(i,k+1) + IPD_Data(nb)%Statein%prsl(i,k) - IPD_Data(nb)%Statein%prsik(i,k) = log( IPD_Data(nb)%Statein%prsi(i,k) ) + im = IPD_control%chunk_begin(nb)+i-1 + IPD_Statein%prsi(im,k) = IPD_Statein%prsi(im,k+1) + IPD_Statein%prsl(im,k) + IPD_Statein%prsik(im,k) = log( IPD_Statein%prsi(im,k) ) ! Redefine mixing ratios for GFS == tracer_mass / (dry_air_mass + water_vapor_mass) - IPD_Data(nb)%Statein%qgrs(i,k,1:nq_adv) = IPD_Data(nb)%Statein%qgrs(i,k,1:nq_adv) & - / IPD_Data(nb)%Statein%prsl(i,k) + IPD_Statein%qgrs(im,k,1:nq_adv) = IPD_Statein%qgrs(im,k,1:nq_adv) & + / IPD_Statein%prsl(im,k) enddo enddo else do i=1,blen - IPD_Data(nb)%Statein%prsi(i, 1) = ptop + im = IPD_control%chunk_begin(nb)+i-1 + IPD_Statein%prsi(im,1) = ptop enddo do k=1,npz do i=1,blen - IPD_Data(nb)%Statein%prsi(i,k+1) = IPD_Data(nb)%Statein%prsi(i,k) + IPD_Data(nb)%Statein%prsl(i,k) - IPD_Data(nb)%Statein%prsik(i,k) = log( IPD_Data(nb)%Statein%prsi(i,k) ) + im = IPD_control%chunk_begin(nb)+i-1 + IPD_Statein%prsi(im,k+1) = IPD_Statein%prsi(im,k) + IPD_Statein%prsl(im,k) + IPD_Statein%prsik(im,k) = log( IPD_Statein%prsi(im,k) ) ! Redefine mixing ratios for GFS == tracer_mass / (dry_air_mass + water_vapor_mass) - IPD_Data(nb)%Statein%qgrs(i,k,1:nq_adv) = IPD_Data(nb)%Statein%qgrs(i,k,1:nq_adv) & - / IPD_Data(nb)%Statein%prsl(i,k) + IPD_Statein%qgrs(im,k,1:nq_adv) = IPD_Statein%qgrs(im,k,1:nq_adv) & + / IPD_Statein%prsl(im,k) enddo enddo endif do i=1,blen - IPD_Data(nb)%Statein%pgr(i) = IPD_Data(nb)%Statein%prsi(i,1) ! surface pressure for GFS - IPD_Data(nb)%Statein%prsik(i,npz+1) = log(ptop) + im = IPD_control%chunk_begin(nb)+i-1 + IPD_Statein%pgr(im) = IPD_Statein%prsi(im,1) ! surface pressure for GFS + IPD_Statein%prsik(im,npz+1) = log(ptop) enddo do k=1,npz do i=1,blen + im = IPD_control%chunk_begin(nb)+i-1 ! Geo-potential at interfaces: #ifdef MULTI_GASES - q_grs(1:nq_adv) = IPD_Data(nb)%Statein%qgrs(i,k,1:nq_adv) + q_grs(1:nq_adv) = IPD_Statein%qgrs(im,k,1:nq_adv) q_min = qmin - rTv = rdgas*IPD_Data(nb)%Statein%tgrs(i,k)*virq_max(q_grs(:),q_min) + rTv = rdgas*IPD_Statein%tgrs(im,k)*virq_max(q_grs(:),q_min) #else - qgrs_rad = max(qmin,IPD_Data(nb)%Statein%qgrs(i,k,sphum)) - rTv = rdgas*IPD_Data(nb)%Statein%tgrs(i,k)*(1.+zvir*qgrs_rad) + qgrs_rad = max(qmin,IPD_Statein%qgrs(im,k,sphum)) + rTv = rdgas*IPD_Statein%tgrs(im,k)*(1.+zvir*qgrs_rad) #endif if ( Atm(mygrid)%flagstruct%hydrostatic .or. Atm(mygrid)%flagstruct%use_hydro_pressure ) & - IPD_Data(nb)%Statein%phii(i,k+1) = IPD_Data(nb)%Statein%phii(i,k) & - + rTv*(IPD_Data(nb)%Statein%prsik(i,k) & - - IPD_Data(nb)%Statein%prsik(i,k+1)) + IPD_Statein%phii(im,k+1) = IPD_Statein%phii(im,k) & + + rTv*(IPD_Statein%prsik(im,k) & + - IPD_Statein%prsik(im,k+1)) ! Layer mean pressure by perfect gas law: - dm = IPD_Data(nb)%Statein%prsl(i,k) - IPD_Data(nb)%Statein%prsl(i,k) = dm*rTv/(IPD_Data(nb)%Statein%phii(i,k+1) & - - IPD_Data(nb)%Statein%phii(i,k)) + dm = IPD_Statein%prsl(im,k) + IPD_Statein%prsl(im,k) = dm*rTv/(IPD_Statein%phii(im,k+1) & + - IPD_Statein%phii(im,k)) !!! Ensure subgrid MONOTONICITY of Pressure: SJL 09/11/2016 if ( .not.Atm(mygrid)%flagstruct%hydrostatic ) then ! If violated, replaces it with hydrostatic pressure - IPD_Data(nb)%Statein%prsl(i,k) = min(IPD_Data(nb)%Statein%prsl(i,k), & - IPD_Data(nb)%Statein%prsi(i,k) - 0.01*dm) - IPD_Data(nb)%Statein%prsl(i,k) = max(IPD_Data(nb)%Statein%prsl(i,k), & - IPD_Data(nb)%Statein%prsi(i,k+1) + 0.01*dm) + IPD_Statein%prsl(im,k) = min(IPD_Statein%prsl(im,k), & + IPD_Statein%prsi(im,k) - 0.01*dm) + IPD_Statein%prsl(im,k) = max(IPD_Statein%prsl(im,k), & + IPD_Statein%prsi(im,k+1) + 0.01*dm) endif enddo enddo do k = 1,npz do i=1,blen + im = IPD_control%chunk_begin(nb)+i-1 ! Exner function layer center: large sensitivity to non-hydro runs with moist kappa - IPD_Data(nb)%Statein%prslk(i,k) = exp( kappa*log(IPD_Data(nb)%Statein%prsl(i,k)/p00) ) + IPD_Statein%prslk(im,k) = exp( kappa*log(IPD_Statein%prsl(im,k)/p00) ) !-- layer center geopotential; geometric midpoint - IPD_Data(nb)%Statein%phil(i,k) = 0.5_kind_phys*(IPD_Data(nb)%Statein%phii(i,k) & - + IPD_Data(nb)%Statein%phii(i,k+1)) + IPD_Statein%phil(im,k) = 0.5_kind_phys*(IPD_Statein%phii(im,k) & + + IPD_Statein%phii(im,k+1)) enddo enddo ! Compute Exner function at layer "interfaces" do i=1,blen + im = IPD_control%chunk_begin(nb)+i-1 ! Top & Bottom edges computed hydrostaticlly - IPD_Data(nb)%Statein%prsik(i, 1) = exp( kappa*IPD_Data(nb)%Statein%prsik(i,1) )*pk0inv ! bottom - IPD_Data(nb)%Statein%prsik(i,npz+1) = pktop ! TOA + IPD_Statein%prsik(im, 1) = exp( kappa*IPD_Statein%prsik(im,1) )*pk0inv ! bottom + IPD_Statein%prsik(im,npz+1) = pktop ! TOA enddo if ( Atm(mygrid)%flagstruct%hydrostatic .or. Atm(mygrid)%flagstruct%use_hydro_pressure ) then do k=2,npz do i=1,blen - IPD_Data(nb)%Statein%prsik(i,k) = exp( kappa*IPD_Data(nb)%Statein%prsik(i,k) )*pk0inv + im = IPD_control%chunk_begin(nb)+i-1 + IPD_Statein%prsik(im,k) = exp( kappa*IPD_Statein%prsik(im,k) )*pk0inv enddo enddo endif @@ -2365,17 +2390,17 @@ end subroutine atmos_phys_qdt_diag !>@brief The subroutine 'atmosphere_fill_grid_cpl' is to downscale/pass the !! coupling variables (e.g., sea surface temperature) received by the parent grid !! down into the nested grid(s). -!>@details First the coupling field(s) is retreived from the IPD_data structure, +!>@details First the coupling field(s) is retreived from the Sfcprop structure, !! and then loops through nested grids and call the fill_nest_grid_cpl to actually !! communicate and fill the nested grid(s) for coupling variables from its parent. -!! After that the updated coupling field(s) is put back to the IPD_data structure. +!! After that the updated coupling field(s) is put back to the Sfcprop structure. !! Note: Currently, only sea surface temperature is passed down into the nest(s). - subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) + subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, Sfcprop) type(block_control_type), intent(in) :: Atm_block !< Physics block layout type(IPD_control_type), intent(in) :: IPD_control !< Physics metadata - type(IPD_data_type), intent(inout) :: IPD_data(:) !< Physics variable data + type(GFS_sfcprop_type), intent(inout) :: Sfcprop !< Physics variable data - integer :: nb, blen, ix, i, j, n + integer :: nb, blen, ix, i, j, n, im character*255 :: message ! Deal with tsfco (sea surface temperature) @@ -2386,7 +2411,8 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - Atm(mygrid)%parent2nest_2d(i,j) = IPD_Data(nb)%Sfcprop%tsfco(ix) + im = IPD_control%chunk_begin(nb)+ix-1 + Atm(mygrid)%parent2nest_2d(i,j) = Sfcprop%tsfco(im) enddo enddo ! Loop through and fill all nested grids @@ -2402,8 +2428,9 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - if (IPD_data(nb)%Sfcprop%oceanfrac(ix) > 0.) then - IPD_data(nb)%Sfcprop%tsfco(ix) = Atm(mygrid)%parent2nest_2d(i,j) + im = IPD_control%chunk_begin(nb)+ix-1 + if (Sfcprop%oceanfrac(im) > 0.) then + Sfcprop%tsfco(im) = Atm(mygrid)%parent2nest_2d(i,j) endif enddo enddo @@ -2418,7 +2445,8 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - Atm(mygrid)%parent2nest_2d(i,j) = IPD_Data(nb)%Sfcprop%usfco(ix) + im = IPD_control%chunk_begin(nb)+ix-1 + Atm(mygrid)%parent2nest_2d(i,j) = Sfcprop%usfco(im) enddo enddo ! Loop through and fill all nested grids @@ -2434,10 +2462,11 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - if (IPD_data(nb)%Sfcprop%oceanfrac(ix) > 0.) then - IPD_data(nb)%Sfcprop%usfco(ix) = Atm(mygrid)%parent2nest_2d(i,j) + im = IPD_control%chunk_begin(nb)+ix-1 + if (Sfcprop%oceanfrac(im) > 0.) then + Sfcprop%usfco(im) = Atm(mygrid)%parent2nest_2d(i,j) else - IPD_data(nb)%Sfcprop%usfco(ix) = 0.0_kind_phys + Sfcprop%usfco(im) = 0.0_kind_phys endif enddo enddo @@ -2449,7 +2478,8 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - Atm(mygrid)%parent2nest_2d(i,j) = IPD_Data(nb)%Sfcprop%vsfco(ix) + im = IPD_control%chunk_begin(nb)+ix-1 + Atm(mygrid)%parent2nest_2d(i,j) = Sfcprop%vsfco(im) enddo enddo ! Loop through and fill all nested grids @@ -2465,10 +2495,11 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - if (IPD_data(nb)%Sfcprop%oceanfrac(ix) > 0.) then - IPD_data(nb)%Sfcprop%vsfco(ix) = Atm(mygrid)%parent2nest_2d(i,j) + im = IPD_control%chunk_begin(nb)+ix-1 + if (Sfcprop%oceanfrac(im) > 0.) then + Sfcprop%vsfco(im) = Atm(mygrid)%parent2nest_2d(i,j) else - IPD_data(nb)%Sfcprop%vsfco(ix) = 0.0_kind_phys + Sfcprop%vsfco(im) = 0.0_kind_phys endif enddo enddo @@ -2484,7 +2515,8 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - Atm(mygrid)%parent2nest_2d(i,j) = IPD_Data(nb)%Sfcprop%zorlwav(ix) + im = IPD_control%chunk_begin(nb)+ix-1 + Atm(mygrid)%parent2nest_2d(i,j) = Sfcprop%zorlwav(im) enddo enddo ! Loop through and fill all nested grids @@ -2500,9 +2532,10 @@ subroutine atmosphere_fill_nest_cpl(Atm_block, IPD_control, IPD_data) do ix = 1, blen i = Atm_block%index(nb)%ii(ix) j = Atm_block%index(nb)%jj(ix) - if (IPD_data(nb)%Sfcprop%oceanfrac(ix) > 0.) then - IPD_data(nb)%Sfcprop%zorlwav(ix) = Atm(mygrid)%parent2nest_2d(i,j) - ! IPD_data(nb)%Sfcprop%zorlw(ix) = Atm(mygrid)%parent2nest_2d(i,j) + im = IPD_control%chunk_begin(nb)+ix-1 + if (Sfcprop%oceanfrac(im) > 0.) then + Sfcprop%zorlwav(im) = Atm(mygrid)%parent2nest_2d(i,j) + ! Sfcprop%zorlw(im) = Atm(mygrid)%parent2nest_2d(i,j) endif enddo enddo diff --git a/driver/fvGFS/fv_nggps_diag.F90 b/driver/UFS/fv_nggps_diag.F90 similarity index 100% rename from driver/fvGFS/fv_nggps_diag.F90 rename to driver/UFS/fv_nggps_diag.F90 diff --git a/driver/fvGFS/fv_ufs_restart_io.F90 b/driver/UFS/fv_ufs_restart_io.F90 similarity index 100% rename from driver/fvGFS/fv_ufs_restart_io.F90 rename to driver/UFS/fv_ufs_restart_io.F90 diff --git a/model/fv_arrays.F90 b/model/fv_arrays.F90 index e6e65a690..cddf08cd6 100644 --- a/model/fv_arrays.F90 +++ b/model/fv_arrays.F90 @@ -855,13 +855,13 @@ module fv_arrays_mod !< If .false., heating from the physics is applied simply as a temperature !< tendency. The default value is .true.; ignored if hydrostatic = .true. logical :: use_hydro_pressure = .false. !< Whether to compute hydrostatic pressure for input to the physics. - !< Currently only enabled for the fvGFS model. + !< Currently only enabled for the UFS model. !< Ignored in hydrostatic simulations. The default is .false. logical :: do_uni_zfull = .false. !< Whether to compute z_full (the height of each modellayer, !< as opposed to z_half, the height of each model interface) !< as the midpoint of the layer, as is done for the nonhydrostatic !< solver, instead of the height of the location where p = p the mean - !< pressure in the layer. This option is not available for fvGFS or + !< pressure in the layer. This option is not available for UFS or !< the solo_core. The default is .false. logical :: hybrid_z = .false. !< Whether to use a hybrid-height coordinate, instead of !< the usual sigma-p coordinate. The default value is .false. diff --git a/tools/fv_nudge.F90 b/tools/fv_nudge.F90 index f79f5f919..24e9f7d3a 100644 --- a/tools/fv_nudge.F90 +++ b/tools/fv_nudge.F90 @@ -26,7 +26,7 @@ !>@brief The module fv_nwp_nudge contains routines for nudging !! to input analyses. -!>note This module is currently not supported in fvGFS of FV3GFS +!>note This module is currently not supported in UFS module fv_nwp_nudge_mod