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

Remove dynamic CCPP build #18

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 2 additions & 46 deletions driver/fvGFS/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -270,30 +270,13 @@ module atmosphere_mod
!! and diagnostics.
subroutine atmosphere_init (Time_init, Time, Time_step, Grid_box, area)
#ifdef CCPP
#ifdef STATIC
! For static builds, the ccpp_physics_{init,run,finalize} calls
! are not pointing to code in the CCPP framework, but to auto-generated
! ccpp_suite_cap and ccpp_group_*_cap modules behind a ccpp_static_api
use ccpp_api, only: ccpp_init
use ccpp_static_api, only: ccpp_physics_init
#else
use iso_c_binding, only: c_loc
use ccpp_api, only: ccpp_init, &
ccpp_physics_init, &
ccpp_field_add, &
ccpp_error
#endif
use CCPP_data, only: ccpp_suite, &
cdata => cdata_tile, &
CCPP_interstitial
#ifdef OPENMP
use omp_lib
#endif
#ifndef STATIC
! Begin include auto-generated list of modules for ccpp
#include "ccpp_modules_fast_physics.inc"
! End include auto-generated list of modules for ccpp
#endif
#endif
type (time_type), intent(in) :: Time_init, Time, Time_step
type(grid_box_type), intent(inout) :: Grid_box
Expand Down Expand Up @@ -443,15 +426,8 @@ subroutine atmosphere_init (Time_init, Time, Time_step, Grid_box, area)
#ifdef CCPP
! Do CCPP fast physics initialization before call to adiabatic_init (since this calls fv_dynamics)

! Initialize the cdata structure
call ccpp_init(trim(ccpp_suite), cdata, ierr)
if (ierr/=0) then
cdata%errmsg = ' atmosphere_dynamics: error in ccpp_init: ' // trim(cdata%errmsg)
call mpp_error (FATAL, cdata%errmsg)
end if

! For fast physics running over the entire domain, block and thread
! number are not used; set to safe values
! For fast physics running over the entire domain, block
! and thread number are not used; set to safe values
cdata%blk_no = 1
cdata%thrd_no = 1

Expand Down Expand Up @@ -487,18 +463,9 @@ subroutine atmosphere_init (Time_init, Time, Time_step, Grid_box, area)
#endif
mpirank=mpp_pe(), mpiroot=mpp_root_pe())

#ifndef STATIC
! Populate cdata structure with fields required to run fast physics (auto-generated).
#include "ccpp_fields_fast_physics.inc"
#endif

if (Atm(mytile)%flagstruct%do_sat_adj) then
! Initialize fast physics
#ifdef STATIC
call ccpp_physics_init(cdata, suite_name=trim(ccpp_suite), group_name="fast_physics", ierr=ierr)
#else
call ccpp_physics_init(cdata, group_name="fast_physics", ierr=ierr)
#endif
if (ierr/=0) then
cdata%errmsg = ' atmosphere_dynamics: error in ccpp_physics_init for group fast_physics: ' // trim(cdata%errmsg)
call mpp_error (FATAL, cdata%errmsg)
Expand Down Expand Up @@ -715,15 +682,8 @@ end subroutine atmosphere_dynamics
!! FV3 dynamical core responsible for writing out a restart and final diagnostic state.
subroutine atmosphere_end (Time, Grid_box, restart_endfcst)
#ifdef CCPP
#ifdef STATIC
! For static builds, the ccpp_physics_{init,run,finalize} calls
! are not pointing to code in the CCPP framework, but to auto-generated
! ccpp_suite_cap and ccpp_group_*_cap modules behind a ccpp_static_api
use ccpp_static_api, only: ccpp_physics_finalize
use CCPP_data, only: ccpp_suite
#else
use ccpp_api, only: ccpp_physics_finalize
#endif
use CCPP_data, only: cdata => cdata_tile
#endif
type (time_type), intent(in) :: Time
Expand All @@ -735,11 +695,7 @@ subroutine atmosphere_end (Time, Grid_box, restart_endfcst)

if (Atm(mytile)%flagstruct%do_sat_adj) then
! Finalize fast physics
#ifdef STATIC
call ccpp_physics_finalize(cdata, suite_name=trim(ccpp_suite), group_name="fast_physics", ierr=ierr)
#else
call ccpp_physics_finalize(cdata, group_name="fast_physics", ierr=ierr)
#endif
if (ierr/=0) then
cdata%errmsg = ' atmosphere_dynamics: error in ccpp_physics_finalize for group fast_physics: ' // trim(cdata%errmsg)
call mpp_error (FATAL, cdata%errmsg)
Expand Down
25 changes: 5 additions & 20 deletions model/fv_mapz.F90
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,10 @@ module fv_mapz_mod
#ifndef CCPP
use fv_cmp_mod, only: qs_init, fv_sat_adj
#else
#ifdef STATIC
! For static builds, the ccpp_physics_{init,run,finalize} calls
! are not pointing to code in the CCPP framework, but to auto-generated
! ccpp_suite_cap and ccpp_group_*_cap modules behind a ccpp_static_api
use ccpp_api, only: ccpp_initialized
use ccpp_static_api, only: ccpp_physics_run
use CCPP_data, only: ccpp_suite
#else
use ccpp_api, only: ccpp_initialized, ccpp_physics_run
#endif
use CCPP_data, only: cdata => cdata_tile, CCPP_interstitial
use CCPP_data, only: cdata => cdata_tile
use CCPP_data, only: CCPP_interstitial
#endif
#ifdef MULTI_GASES
use multi_gases_mod, only: virq, virqd, vicpqd, vicvqd, num_gas
Expand Down Expand Up @@ -259,7 +252,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
endif

!$OMP parallel do default(none) shared(is,ie,js,je,km,pe,ptop,kord_tm,hydrostatic, &
!$OMP pt,pk,rg,peln,q,nwat,liq_wat,rainwat,ice_wat,snowwat, &
!$OMP pt,pk,rg,peln,q,nwat,liq_wat,rainwat,ice_wat,snowwat, &
!$OMP graupel,q_con,sphum,cappa,r_vir,rcp,k1k,delp, &
!$OMP delz,akap,pkz,te,u,v,ps, gridstruct, last_step, &
!$OMP ak,bk,nq,isd,ied,jsd,jed,kord_tr,fill, adiabatic, &
Expand Down Expand Up @@ -627,9 +620,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
!$OMP ng,gridstruct,E_Flux,pdt,dtmp,reproduce_sum,q, &
!$OMP mdt,cld_amt,cappa,dtdt,out_dt,rrg,akap,do_sat_adj, &
!$OMP kord_tm,cdata,CCPP_interstitial) &
#ifdef STATIC
!$OMP shared(ccpp_suite) &
#endif
#ifdef MULTI_GASES
!$OMP shared(num_gas) &
#endif
Expand All @@ -643,9 +634,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
!$OMP ng,gridstruct,E_Flux,pdt,dtmp,reproduce_sum,q, &
!$OMP mdt,cld_amt,cappa,dtdt,out_dt,rrg,akap,do_sat_adj, &
!$OMP fast_mp_consv,kord_tm,cdata, CCPP_interstitial) &
#ifdef STATIC
!$OMP shared(ccpp_suite) &
#endif
#ifdef MULTI_GASES
!$OMP shared(num_gas) &
#endif
Expand Down Expand Up @@ -808,15 +797,11 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
if ( do_sat_adj ) then
call timing_on('sat_adj2')
#ifdef CCPP
if (ccpp_initialized(cdata)) then
#ifdef STATIC
if (cdata%initialized()) then
call ccpp_physics_run(cdata, suite_name=trim(ccpp_suite), group_name='fast_physics', ierr=ierr)
#else
call ccpp_physics_run(cdata, group_name='fast_physics', ierr=ierr)
#endif
if (ierr/=0) call mpp_error(FATAL, "Call to ccpp_physics_run for group 'fast_physics' failed")
else
call mpp_error (FATAL, 'Lagrangian_to_Eulerian: can not call CCPP fast physics because cdata not initialized')
call mpp_error (FATAL, 'Lagrangian_to_Eulerian: can not call CCPP fast physics because CCPP not initialized')
endif
#else
!$OMP do
Expand Down