Skip to content

Commit

Permalink
Merge pull request #56 from climbfuji/ccpp-api-update
Browse files Browse the repository at this point in the history
CCPP API and SDF update
  • Loading branch information
climbfuji authored Apr 25, 2018
2 parents 5d0769a + b2f2df2 commit 66f1a06
Show file tree
Hide file tree
Showing 24 changed files with 447 additions and 237 deletions.
8 changes: 5 additions & 3 deletions examples/suite.xsd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://dtcenter.org/gmtb/users/ccpp/2018/04/23"
xmlns:namens="https://dtcenter.org/gmtb/users/ccpp/2018/04/23">

<!-- definition of function pointer type -->
<xs:complexType name="functionPointer">
Expand All @@ -22,7 +24,7 @@
</xs:complexType>
</xs:element>

<xs:element name="ipd">
<xs:element name="group">
<xs:complexType>
<xs:choice>
<xs:element ref="subcycle" minOccurs="1" maxOccurs="unbounded"/>
Expand All @@ -35,7 +37,7 @@
<xs:complexType>
<xs:sequence>
<xs:element name="init" type="functionPointer" minOccurs="0" maxOccurs="1"/>
<xs:element ref="ipd" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="group" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="finalize" type="functionPointer" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
Expand Down
4 changes: 2 additions & 2 deletions examples/suite_EXAMPLE.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>

<suite name="EXAMPLE">
<ipd part="1">
<group part="1">
<subcycle loop="1">
<scheme lib="check" ver="0.0.1">test</scheme>
</subcycle>
</ipd>
</group>
</suite>

18 changes: 9 additions & 9 deletions examples/suite_GFS_operational_2017.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<suite name="GFS_operational_2017" lib="gfsphys" ver="1">
<init>IPD_initialize</init>
<ipd part="1">
<group name="time_vary">
<subcycle loop="1">
<scheme>IPD_setup_step</scheme>
</subcycle>
</ipd>
<ipd part="2">
</group>
<group name="radiation">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset_run</scheme>
<scheme>GFS_rrtmg_pre_run</scheme>
Expand All @@ -21,8 +21,8 @@
<!-- <scheme>GFS_diagtoscreen_run</scheme> -->
<!-- <scheme>GFS_interstitialtoscreen_run</scheme> -->
</subcycle>
</ipd>
<ipd part="3">
</group>
<group name="physics">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_phys_reset_run</scheme>
<scheme>get_prs_fv3_run</scheme>
Expand Down Expand Up @@ -92,12 +92,12 @@
<!-- <scheme>GFS_diagtoscreen_run</scheme> -->
<!-- <scheme>GFS_interstitialtoscreen_run</scheme> -->
</subcycle>
</ipd>
<ipd part="4">
</group>
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics_run</scheme>
<!-- <scheme>GFS_diagtoscreen_run</scheme> -->
</subcycle>
</ipd>
<!-- <finalize>IPD_finalize</finalize> -->
</group>
<finalize>IPD_finalize</finalize>
</suite>
20 changes: 0 additions & 20 deletions examples/suite_RAP.xml

This file was deleted.

14 changes: 0 additions & 14 deletions examples/suite_SCM.xml

This file was deleted.

14 changes: 7 additions & 7 deletions examples/suite_scm_GFS_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<suite name="GFS_operational_2017" lib="ccppphys" ver="0.0.1">
<init>GFS_initialize_scm_run</init>
<ipd part="1">
<group name="time_vary">
<subcycle loop="1">
<scheme>GFS_phys_time_vary_1_run</scheme>
<scheme>GFS_rad_time_vary_run</scheme>
<scheme>GFS_phys_time_vary_2_run</scheme>
<!-- <scheme>GFS_diagtoscreen_run</scheme> -->
</subcycle>
</ipd>
<ipd part="2">
</group>
<group name="radiation">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset_run</scheme>
<scheme>GFS_rrtmg_pre_run</scheme>
Expand All @@ -24,8 +24,8 @@
<!-- <scheme>GFS_diagtoscreen_run</scheme> -->
<!-- <scheme>GFS_interstitialtoscreen_run</scheme> -->
</subcycle>
</ipd>
<ipd part="3">
</group>
<group name="physics">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_phys_reset_run</scheme>
<scheme>get_prs_fv3_run</scheme>
Expand Down Expand Up @@ -95,6 +95,6 @@
<!-- <scheme>GFS_diagtoscreen_run</scheme> -->
<!-- <scheme>GFS_interstitialtoscreen_run</scheme> -->
</subcycle>
</ipd>
<!-- <finalize>IPD_finalize</finalize> -->
</group>
<finalize>GFS_finalize_scm_run</finalize> <!-- need to add this one? -->
</suite>
2 changes: 1 addition & 1 deletion schemes/check/check_noop.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ subroutine noop_cap(ptr) bind(c)
call c_f_pointer(ptr, cdata)

print *, 'In noop_cap'
print *, cdata%suite%ipds(1)%subcycles(1)%schemes(1)%name
print *, cdata%suite%groups(1)%subcycles(1)%schemes(1)%name

end subroutine noop_cap

Expand Down
1 change: 1 addition & 0 deletions scripts/ccpp_prebuild_config_SCM.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Add all physics scheme files relative to basedir
SCHEME_FILES = [
'ccpp-physics/GFS_layer/GFS_initialize_scm.F90',
'ccpp-physics/GFS_layer/GFS_finalize_scm.F90',
'ccpp-physics/physics/GFS_DCNV_generic.f90',
'ccpp-physics/physics/GFS_MP_generic_post.f90',
'ccpp-physics/physics/GFS_MP_generic_pre.f90',
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set(SOURCES
ccpp_xml.F90
ccpp_xml.h
ccpp_xml.c
ccpp_api.F90
)

#------------------------------------------------------------------------------
Expand Down
46 changes: 46 additions & 0 deletions src/ccpp_api.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
!
! This work (Common Community Physics Package), identified by NOAA, NCAR,
! CU/CIRES, is free of known copyright restrictions and is placed in the
! public domain.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
! THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
! IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
! CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
!

!>
!! @brief CCPP API module.
!!
!! @details This module exposes calls to CCPP routines to the users.
!
module ccpp_api

use ccpp_types, only: CCPP_STR_LEN, &
ccpp_t
use ccpp_errors, only: ccpp_error, &
ccpp_debug
use ccpp, only: ccpp_init, &
ccpp_finalize
use ccpp_fcall, only: ccpp_physics_init, &
ccpp_physics_run, &
ccpp_physics_finalize
use ccpp_fields, only: ccpp_field_add, &
ccpp_field_get

implicit none

public :: CCPP_STR_LEN, &
ccpp_t, &
ccpp_error, &
ccpp_debug, &
ccpp_init, &
ccpp_finalize, &
ccpp_physics_init, &
ccpp_physics_run, &
ccpp_physics_finalize, &
ccpp_field_add

end module ccpp_api
Loading

0 comments on commit 66f1a06

Please sign in to comment.