Skip to content

Commit e9eaddf

Browse files
Merge pull request #9 from climbfuji/update_gsd_develop_from_develop
gsd/develop: update from develop
2 parents af8915b + 1e0619f commit e9eaddf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1447
-359
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.o
22
*.mod
33
*.a
4+
*.pyc

.gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[submodule "atmos_cubed_sphere"]
22
path = atmos_cubed_sphere
3-
url = https://github.com/noaa-gsd/GFDL_atmos_cubed_sphere
3+
url = https://github.com/NOAA-GSD/GFDL_atmos_cubed_sphere
44
branch = gsd/develop
55
[submodule "ccpp/framework"]
66
path = ccpp/framework
7-
url = https://github.com/noaa-gsd/ccpp-framework
7+
url = https://github.com/NOAA-GSD/ccpp-framework
88
branch = gsd/develop
99
[submodule "ccpp/physics"]
1010
path = ccpp/physics
11-
url = https://github.com/noaa-gsd/ccpp-physics
11+
url = https://github.com/NOAA-GSD/ccpp-physics
1212
branch = gsd/develop

CMakeLists.txt

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
if( NOT DEFINED PHYS)
2+
set(PHYS gfs)
3+
endif()
4+
5+
if (PHYS MATCHES "nam")
6+
add_definitions(-DNAM_phys)
7+
endif()
8+
9+
if(CCPP)
10+
add_definitions(-DCCPP)
11+
if(STATIC)
12+
add_definitions(-DSTATIC)
13+
endif()
14+
endif()
15+
16+
add_subdirectory(cpl)
17+
add_subdirectory(${PHYS}physics)
18+
add_subdirectory(ipd)
19+
add_subdirectory(io)
20+
21+
# fv3core library
22+
23+
if(NOT CCPP)
24+
set(FAST_PHYSICS_SRCS_F90 atmos_cubed_sphere/model/fv_cmp.F90)
25+
endif()
26+
27+
add_library(
28+
fv3core
29+
30+
atmos_cubed_sphere/model/a2b_edge.F90
31+
atmos_cubed_sphere/model/multi_gases.F90
32+
atmos_cubed_sphere/model/boundary.F90
33+
atmos_cubed_sphere/model/dyn_core.F90
34+
atmos_cubed_sphere/model/fv_arrays.F90
35+
${FAST_PHYSICS_SRCS_F90}
36+
atmos_cubed_sphere/model/fv_control.F90
37+
atmos_cubed_sphere/model/fv_dynamics.F90
38+
atmos_cubed_sphere/model/fv_fill.F90
39+
atmos_cubed_sphere/model/fv_grid_utils.F90
40+
atmos_cubed_sphere/model/fv_mapz.F90
41+
atmos_cubed_sphere/model/fv_nesting.F90
42+
atmos_cubed_sphere/model/fv_regional_bc.F90
43+
atmos_cubed_sphere/model/fv_sg.F90
44+
atmos_cubed_sphere/model/fv_tracer2d.F90
45+
atmos_cubed_sphere/model/fv_update_phys.F90
46+
atmos_cubed_sphere/model/sw_core.F90
47+
atmos_cubed_sphere/model/tp_core.F90
48+
atmos_cubed_sphere/model/nh_core.F90
49+
atmos_cubed_sphere/model/nh_utils.F90
50+
atmos_cubed_sphere/tools/external_ic.F90
51+
atmos_cubed_sphere/tools/external_sst.F90
52+
atmos_cubed_sphere/tools/fv_diagnostics.F90
53+
atmos_cubed_sphere/tools/fv_eta.F90
54+
atmos_cubed_sphere/tools/fv_grid_tools.F90
55+
atmos_cubed_sphere/tools/fv_io.F90
56+
atmos_cubed_sphere/tools/fv_mp_mod.F90
57+
atmos_cubed_sphere/tools/fv_nudge.F90
58+
atmos_cubed_sphere/tools/fv_treat_da_inc.F90
59+
atmos_cubed_sphere/tools/fv_iau_mod.F90
60+
atmos_cubed_sphere/tools/fv_restart.F90
61+
atmos_cubed_sphere/tools/fv_surf_map.F90
62+
atmos_cubed_sphere/tools/fv_timing.F90
63+
atmos_cubed_sphere//tools/init_hydro.F90
64+
atmos_cubed_sphere/tools/sim_nc_mod.F90
65+
atmos_cubed_sphere/tools/sorted_index.F90
66+
atmos_cubed_sphere/tools/test_cases.F90
67+
atmos_cubed_sphere/driver/fvGFS/DYCORE_typedefs.F90
68+
atmos_cubed_sphere/driver/fvGFS/fv_nggps_diag.F90
69+
atmos_cubed_sphere/driver/fvGFS/atmosphere.F90
70+
)
71+
72+
set_property(SOURCE atmos_cubed_sphere/model/nh_utils.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FAST}")
73+
set_property(SOURCE atmos_cubed_sphere/model/fv_mapz.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FAST}")
74+
75+
target_link_libraries(fv3core PRIVATE fms)
76+
target_link_libraries(fv3core PRIVATE ${PHYS}physics)
77+
target_link_libraries(fv3core PRIVATE ipd)
78+
79+
target_include_directories(fv3core PRIVATE ${ESMF_MOD})
80+
81+
# end of fv3core
82+
83+
###############################################################################
84+
### ccpp
85+
###############################################################################
86+
if(CCPP)
87+
add_subdirectory(ccpp)
88+
add_subdirectory(ccpp/driver)
89+
add_dependencies(${PHYS}physics ccpp ccppphys)
90+
add_dependencies(ccppdriver ccpp ccppphys)
91+
add_dependencies(ccppphys ccpp)
92+
93+
target_include_directories(fv3core PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src)
94+
target_include_directories(fv3core PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/driver)
95+
endif()
96+
97+
set_target_properties(fv3core PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
98+
target_include_directories(fv3core PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/mod)
99+
100+
# When specifying an out-of-tree source a binary directory must be explicitly specified.
101+
#add_subdirectory(../stochastic_physics stochastic_physics)
102+
add_subdirectory(stochastic_physics)
103+
104+
add_library(
105+
fv3cap
106+
107+
atmos_model.F90
108+
fv3_cap.F90
109+
module_fv3_config.F90
110+
module_fcst_grid_comp.F90
111+
time_utils.F90
112+
)
113+
114+
if(CCPP)
115+
target_include_directories(fv3cap PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ccpp/driver/mod)
116+
endif()
117+
target_include_directories(fv3cap PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/stochastic_physics)
118+
target_compile_definitions(fv3cap PRIVATE -DESMF_VERSION_MAJOR=${ESMF_VERSION_MAJOR})
119+
target_include_directories(fv3cap PRIVATE ${ESMF_MOD})
120+
121+
target_link_libraries(fv3cap PRIVATE fms)
122+
target_link_libraries(fv3cap PRIVATE fv3cpl)
123+
target_link_libraries(fv3cap PRIVATE ${PHYS}physics)
124+
target_link_libraries(fv3cap PRIVATE ipd)
125+
target_link_libraries(fv3cap PRIVATE io)
126+
target_link_libraries(fv3cap PRIVATE fv3core)
127+
target_link_libraries(fv3cap PRIVATE stochastic_physics)
128+
129+
set_target_properties(fv3cap PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
130+
target_include_directories(fv3cap PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/mod)

atmos_cubed_sphere

atmos_model.F90

+29-7
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ module atmos_model_mod
113113
FV3GFS_diag_register, FV3GFS_diag_output, &
114114
DIAG_SIZE
115115
use fv_iau_mod, only: iau_external_data_type,getiauforcing,iau_initialize
116-
use module_fv3_config, only: output_1st_tstep_rst, first_kdt, nsout
116+
use module_fv3_config, only: output_1st_tstep_rst, first_kdt, nsout, &
117+
frestart, restart_endfcst
117118

118119
!-----------------------------------------------------------------------
119120

@@ -221,7 +222,8 @@ module atmos_model_mod
221222
logical,parameter :: flip_vc = .true.
222223
#endif
223224

224-
real(kind=IPD_kind_phys), parameter :: zero=0.0, one=1.0
225+
real(kind=IPD_kind_phys), parameter :: zero = 0.0_IPD_kind_phys, &
226+
one = 1.0_IPD_kind_phys
225227

226228
contains
227229

@@ -945,17 +947,19 @@ end subroutine update_atmos_model_state
945947
subroutine atmos_model_end (Atmos)
946948
type (atmos_data_type), intent(inout) :: Atmos
947949
!---local variables
948-
integer :: idx
950+
integer :: idx, seconds
949951
#ifdef CCPP
950952
integer :: ierr
951953
#endif
952954

953955
!-----------------------------------------------------------------------
954956
!---- termination routine for atmospheric model ----
955957

956-
call atmosphere_end (Atmos % Time, Atmos%grid)
957-
call FV3GFS_restart_write (IPD_Data, IPD_Restart, Atm_block, &
958-
IPD_Control, Atmos%domain)
958+
call atmosphere_end (Atmos % Time, Atmos%grid, restart_endfcst)
959+
if(restart_endfcst) then
960+
call FV3GFS_restart_write (IPD_Data, IPD_Restart, Atm_block, &
961+
IPD_Control, Atmos%domain)
962+
endif
959963

960964
#ifdef CCPP
961965
! Fast physics (from dynamics) are finalized in atmosphere_end above;
@@ -1458,6 +1462,24 @@ subroutine update_atmos_chemistry(state, rc)
14581462
enddo
14591463
enddo
14601464

1465+
! -- zero out accumulated fields
1466+
!$OMP parallel do default (none) &
1467+
!$OMP shared (nj, ni, Atm_block, IPD_Control, IPD_Data) &
1468+
!$OMP private (j, jb, i, ib, nb, ix)
1469+
do j = 1, nj
1470+
jb = j + Atm_block%jsc - 1
1471+
do i = 1, ni
1472+
ib = i + Atm_block%isc - 1
1473+
nb = Atm_block%blkno(ib,jb)
1474+
ix = Atm_block%ixp(ib,jb)
1475+
IPD_Data(nb)%coupling%rainc_cpl(ix) = zero
1476+
if (.not.IPD_Control%cplflx) then
1477+
IPD_Data(nb)%coupling%rain_cpl(ix) = zero
1478+
IPD_Data(nb)%coupling%snow_cpl(ix) = zero
1479+
end if
1480+
enddo
1481+
enddo
1482+
14611483
if (IPD_Control%debug) then
14621484
! -- diagnostics
14631485
write(6,'("update_atmos: prsi - min/max/avg",3g16.6)') minval(prsi), maxval(prsi), sum(prsi)/size(prsi)
@@ -1699,7 +1721,7 @@ subroutine assign_importdata(rc)
16991721
IPD_Data(nb)%Coupling%ficein_cpl(ix) = zero
17001722
if (IPD_Data(nb)%Sfcprop%oceanfrac(ix) > zero) then
17011723
if (datar8(i,j) >= IPD_control%min_seaice*IPD_Data(nb)%Sfcprop%oceanfrac(ix)) then
1702-
IPD_Data(nb)%Coupling%ficein_cpl(ix) = datar8(i,j)
1724+
IPD_Data(nb)%Coupling%ficein_cpl(ix) = max(zero, min(datar8(i,j),one))
17031725
! if (IPD_Data(nb)%Sfcprop%oceanfrac(ix) == one) IPD_Data(nb)%Sfcprop%slmsk(ix) = 2. !slmsk=2 crashes in gcycle on partial land points
17041726
IPD_Data(nb)%Sfcprop%slmsk(ix) = 2. !slmsk=2 crashes in gcycle on partial land points
17051727
IPD_Data(nb)%Coupling%slimskin_cpl(ix) = 4.

ccpp/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,20 @@ endif(MKL_DIR)
259259

260260
#------------------------------------------------------------------------------
261261
# Set netCDF flags for preprocessor, compiler and linker (if defined)
262+
# Legacy settings for old make build
262263
if(NETCDF_DIR)
263264
set (NETCDF_INC "-I${NETCDF_DIR}/include")
264265
set (NETCDF_LIB "-L${NETCDF_DIR}/lib -lnetcdff -lnetcdf")
265266
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${NETCDF_INC} ${NETCDF_LIB}")
266267
ADD_DEFINITIONS(-DNETCDF)
267268
message (STATUS "Enable netCDF support")
269+
# Settings for new cmake build
270+
elseif (NETCDF_INC_DIR AND NETCDF_LIBDIR)
271+
set (NETCDF_INC "-I${NETCDF_INC_DIR}")
272+
set (NETCDF_LIB "-L${NETCDF_LIBDIR} -lnetcdff -lnetcdf")
273+
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${NETCDF_INC} ${NETCDF_LIB}")
274+
ADD_DEFINITIONS(-DNETCDF)
275+
message (STATUS "Enable netCDF support")
268276
else(NETCDF_DIR)
269277
message (STATUS "Disable netCDF support")
270278
endif(NETCDF_DIR)

ccpp/config/ccpp_prebuild_config.py

-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@
231231
'FV3/ccpp/physics/physics/sfc_cice.f' : [ 'slow_physics' ],
232232
'FV3/ccpp/physics/physics/sfc_diff.f' : [ 'slow_physics' ],
233233
'FV3/ccpp/physics/physics/sfc_drv.f' : [ 'slow_physics' ],
234-
'FV3/ccpp/physics/physics/sfc_noahmp_pre.F90' : [ 'slow_physics' ],
235234
'FV3/ccpp/physics/physics/sfc_noahmp_drv.f' : [ 'slow_physics' ],
236235
'FV3/ccpp/physics/physics/sfc_nst.f' : [ 'slow_physics' ],
237236
'FV3/ccpp/physics/physics/sfc_ocean.F' : [ 'slow_physics' ],

ccpp/driver/CMakeLists.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
if(NOT DYN32)
3+
remove_definitions(-DOVERLOAD_R8)
4+
remove_definitions(-DOVERLOAD_R4)
5+
endif()
6+
7+
message ("Force 64 bits in CCPP_layer")
8+
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
9+
string (REPLACE "-i4 -real-size 32" "-i4 -real-size 64 -no-prec-div -no-prec-sqrt" CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
10+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
11+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8")
12+
endif()
13+
14+
add_library(
15+
ccppdriver
16+
17+
CCPP_driver.F90
18+
)
19+
20+
target_link_libraries(ccppdriver ${PHYS}physics)
21+
target_link_libraries(ccppdriver ccpp)
22+
target_link_libraries(ccppdriver ccppphys)
23+
24+
target_include_directories(ccppdriver PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src)
25+
26+
set_target_properties(ccppdriver PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
27+
target_include_directories(ccppdriver PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/mod)

ccpp/framework

ccpp/physics

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<suite name="FV3_GFS_2017_coupled" lib="ccppphys" ver="3">
4+
<!-- <init></init> -->
5+
<group name="time_vary">
6+
<subcycle loop="1">
7+
<scheme>GFS_time_vary_pre</scheme>
8+
<scheme>GFS_rrtmg_setup</scheme>
9+
<scheme>GFS_rad_time_vary</scheme>
10+
<scheme>GFS_phys_time_vary</scheme>
11+
</subcycle>
12+
</group>
13+
<group name="radiation">
14+
<subcycle loop="1">
15+
<scheme>GFS_suite_interstitial_rad_reset</scheme>
16+
<scheme>GFS_rrtmg_pre</scheme>
17+
<scheme>rrtmg_sw_pre</scheme>
18+
<scheme>rrtmg_sw</scheme>
19+
<scheme>rrtmg_sw_post</scheme>
20+
<scheme>rrtmg_lw_pre</scheme>
21+
<scheme>rrtmg_lw</scheme>
22+
<scheme>rrtmg_lw_post</scheme>
23+
<scheme>GFS_rrtmg_post</scheme>
24+
</subcycle>
25+
</group>
26+
<group name="physics">
27+
<subcycle loop="1">
28+
<scheme>GFS_suite_interstitial_phys_reset</scheme>
29+
<scheme>GFS_suite_stateout_reset</scheme>
30+
<scheme>get_prs_fv3</scheme>
31+
<scheme>GFS_suite_interstitial_1</scheme>
32+
<scheme>GFS_surface_generic_pre</scheme>
33+
<scheme>GFS_surface_composites_pre</scheme>
34+
<scheme>dcyc2t3</scheme>
35+
<scheme>GFS_surface_composites_inter</scheme>
36+
<scheme>GFS_suite_interstitial_2</scheme>
37+
</subcycle>
38+
<!-- Surface iteration loop -->
39+
<subcycle loop="2">
40+
<scheme>sfc_diff</scheme>
41+
<scheme>GFS_surface_loop_control_part1</scheme>
42+
<scheme>sfc_ocean</scheme>
43+
<scheme>lsm_noah</scheme>
44+
<scheme>sfc_cice</scheme>
45+
<scheme>sfc_sice</scheme>
46+
<scheme>GFS_surface_loop_control_part2</scheme>
47+
</subcycle>
48+
<!-- End of surface iteration loop -->
49+
<subcycle loop="1">
50+
<scheme>GFS_surface_composites_post</scheme>
51+
<scheme>dcyc2t3_post</scheme>
52+
<scheme>sfc_diag</scheme>
53+
<scheme>sfc_diag_post</scheme>
54+
<scheme>GFS_surface_generic_post</scheme>
55+
<scheme>GFS_PBL_generic_pre</scheme>
56+
<scheme>hedmf</scheme>
57+
<scheme>GFS_PBL_generic_post</scheme>
58+
<scheme>GFS_GWD_generic_pre</scheme>
59+
<scheme>cires_ugwp</scheme>
60+
<scheme>cires_ugwp_post</scheme>
61+
<scheme>GFS_GWD_generic_post</scheme>
62+
<scheme>rayleigh_damp</scheme>
63+
<scheme>GFS_suite_stateout_update</scheme>
64+
<scheme>ozphys</scheme>
65+
<scheme>GFS_DCNV_generic_pre</scheme>
66+
<scheme>get_phi_fv3</scheme>
67+
<scheme>GFS_suite_interstitial_3</scheme>
68+
<scheme>samfdeepcnv</scheme>
69+
<scheme>GFS_DCNV_generic_post</scheme>
70+
<scheme>GFS_SCNV_generic_pre</scheme>
71+
<scheme>samfshalcnv</scheme>
72+
<scheme>GFS_SCNV_generic_post</scheme>
73+
<scheme>GFS_suite_interstitial_4</scheme>
74+
<scheme>cnvc90</scheme>
75+
<scheme>GFS_MP_generic_pre</scheme>
76+
<scheme>zhaocarr_gscond</scheme>
77+
<scheme>zhaocarr_precpd</scheme>
78+
<scheme>GFS_MP_generic_post</scheme>
79+
<scheme>maximum_hourly_diagnostics</scheme>
80+
</subcycle>
81+
</group>
82+
<group name="stochastics">
83+
<subcycle loop="1">
84+
<scheme>GFS_stochastics</scheme>
85+
</subcycle>
86+
</group>
87+
<!-- <finalize></finalize> -->
88+
</suite>

ccpp/suites/suite_FV3_GFS_2017_gfdlmp_noahmp.xml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
<scheme>sfc_nst_pre</scheme>
4848
<scheme>sfc_nst</scheme>
4949
<scheme>sfc_nst_post</scheme>
50-
<scheme>sfc_noahmp_pre</scheme>
5150
<scheme>noahmpdrv</scheme>
5251
<scheme>sfc_sice</scheme>
5352
<scheme>GFS_surface_loop_control_part2</scheme>

0 commit comments

Comments
 (0)