diff --git a/.github/workflows/ci_build_scm_ubuntu.yml b/.github/workflows/ci_build_scm_ubuntu.yml index 96f6fd9c1..86190ee5a 100644 --- a/.github/workflows/ci_build_scm_ubuntu.yml +++ b/.github/workflows/ci_build_scm_ubuntu.yml @@ -1,6 +1,7 @@ name: build the CCPP-SCM on latest Ubuntu runner -on: [pull_request,workflow_dispatch] +#on: [pull_request,workflow_dispatch] +on: [workflow_dispatch] jobs: build_scm: diff --git a/.github/workflows/ci_run_scm_DEPHY.yml b/.github/workflows/ci_run_scm_DEPHY.yml index ac80c0d63..2cb66b7de 100644 --- a/.github/workflows/ci_run_scm_DEPHY.yml +++ b/.github/workflows/ci_run_scm_DEPHY.yml @@ -1,6 +1,7 @@ name: run the SCM with DEPHY v1 data -on: [pull_request,workflow_dispatch] +#on: [pull_request,workflow_dispatch] +on: [workflow_dispatch] jobs: run-scm-DEPHY: diff --git a/.github/workflows/ci_scm_ccpp_prebuild.yml b/.github/workflows/ci_scm_ccpp_prebuild.yml index c50de5436..6018f15b9 100644 --- a/.github/workflows/ci_scm_ccpp_prebuild.yml +++ b/.github/workflows/ci_scm_ccpp_prebuild.yml @@ -1,7 +1,8 @@ # CI test to run SCM ccpp_prebuild script name: build -on: [push, pull_request, workflow_dispatch] +#on: [push, pull_request, workflow_dispatch] +on: [workflow_dispatch] jobs: build-linux: diff --git a/.github/workflows/ci_test_docker.yml b/.github/workflows/ci_test_docker.yml index 8651d727d..c9c391861 100644 --- a/.github/workflows/ci_test_docker.yml +++ b/.github/workflows/ci_test_docker.yml @@ -1,5 +1,4 @@ name: build and test docker - on: # not listing pull_request closed, since it would run when merged pull_request: diff --git a/.gitmodules b/.gitmodules index dc0798c32..694e265f2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,11 +1,11 @@ [submodule "ccpp-framework"] path = ccpp/framework - url = https://github.com/NCAR/ccpp-framework - branch = main + url = https://github.com/dustinswales/ccpp-framework + branch = capgen_in_scm [submodule "ccpp-physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = main + url = https://github.com/dustinswales/ccpp-physics + branch = feature/changes_for_capgen [submodule "CMakeModules"] path = CMakeModules url = https://github.com/noaa-emc/CMakeModules diff --git a/ccpp/config/ccpp_capgen_config.py b/ccpp/config/ccpp_capgen_config.py new file mode 100755 index 000000000..9c4db4be3 --- /dev/null +++ b/ccpp/config/ccpp_capgen_config.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +# CCPP Capgen config for CCPP Single Column Model (SCM) + +# if not specified as command-line argument +DEFAULT_BUILD_DIR = 'scm/bin' + +# Auto-generated makefile/cmakefile snippets that contain all type definitions +TYPEDEFS_MAKEFILE = '{build_dir}/physics/CCPP_TYPEDEFS.mk' +TYPEDEFS_CMAKEFILE = '{build_dir}/physics/CCPP_TYPEDEFS.cmake' +TYPEDEFS_SOURCEFILE = '{build_dir}/physics/CCPP_TYPEDEFS.sh' + +# Auto-generated makefile/cmakefile snippets that contain all schemes +SCHEMES_MAKEFILE = '{build_dir}/physics/CCPP_SCHEMES.mk' +SCHEMES_CMAKEFILE = '{build_dir}/physics/CCPP_SCHEMES.cmake' +SCHEMES_SOURCEFILE = '{build_dir}/physics/CCPP_SCHEMES.sh' + +# Auto-generated makefile/cmakefile snippets that contain all caps +CAPS_MAKEFILE = '{build_dir}/physics/CCPP_CAPS.mk' +CAPS_CMAKEFILE = '{build_dir}/physics/CCPP_CAPS.cmake' +CAPS_SOURCEFILE = '{build_dir}/physics/CCPP_CAPS.sh' + +# Auto-generated makefile/cmakefile snippets that contain all working precisions +KINDS_MAKEFILE = '{build_dir}/physics/CCPP_KINDS.mk' +KINDS_CMAKEFILE = '{build_dir}/physics/CCPP_KINDS.cmake' +KINDS_SOURCEFILE = '{build_dir}/physics/CCPP_KINDS.sh' + +# CCPP Static API. +STATIC_API_MAKEFILE = '{build_dir}/../../src/CCPP_STATIC_API.mk' +STATIC_API_CMAKEFILE = '{build_dir}/../../src/CCPP_STATIC_API.cmake' +STATIC_API_SOURCEFILE = '{build_dir}/../../src/CCPP_STATIC_API.sh' + +# Directory for writing HTML pages generated from metadata files +METADATA_HTML_OUTPUT_DIR = 'ccpp/physics/physics/docs' + +# HTML document containing the model-defined CCPP variables +HTML_VARTABLE_FILE = 'ccpp/physics/CCPP_VARIABLES_SCM.html' + +# LaTeX document containing the provided vs requested CCPP variables +LATEX_VARTABLE_FILE = 'ccpp/framework/doc/DevelopersGuide/CCPP_VARIABLES_SCM.tex' diff --git a/ccpp/config/host_files.txt b/ccpp/config/host_files.txt new file mode 100755 index 000000000..769c39525 --- /dev/null +++ b/ccpp/config/host_files.txt @@ -0,0 +1,6 @@ +scm/src/ccpp_config.F90 +scm/src/GFS_typedefs.F90 +scm/src/CCPP_typedefs.F90 +scm/src/scm_type_defs.F90 +scm/src/scm_physical_constants.F90 +scm/src/scm_mod.F90 diff --git a/ccpp/config/scheme_files.txt b/ccpp/config/scheme_files.txt new file mode 100755 index 000000000..34fa807de --- /dev/null +++ b/ccpp/config/scheme_files.txt @@ -0,0 +1,137 @@ +ccpp/physics/physics/hooks/physcons.F90 +ccpp/physics/physics/tools/get_prs_fv3.F90 +ccpp/physics/physics/tools/get_phi_fv3.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/module_ccpp_suite_simulator.F90 +ccpp/physics/physics/SFC_Models/Land/Noahmp/lnd_iau_mod.F90 +ccpp/physics/physics/photochem/module_h2ophys.F90 +ccpp/physics/physics/photochem/module_ozphys.F90 +ccpp/physics/physics/MP/TEMPO/TEMPO/module_mp_tempo_params.F90 +ccpp/physics/physics/Radiation/RRTMG/radlw_param.f +ccpp/physics/physics/Radiation/RRTMG/radsw_param.f +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_1.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_reset.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_5.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_inter.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_photochemistry.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.f +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpost.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.F90 +ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.F90 +ccpp/physics/physics/Radiation/RRTMG/radlw_main.F90 +ccpp/physics/physics/Radiation/RRTMG/radsw_main.F90 +ccpp/physics/physics/Radiation/RRTMG/rrtmg_lw_post.F90 +ccpp/physics/physics/Radiation/RRTMG/rrtmg_lw_pre.F90 +ccpp/physics/physics/Radiation/RRTMG/rrtmg_sw_post.F90 +ccpp/physics/physics/Radiation/RRTMG/rad_sw_pre.F90 +ccpp/physics/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.F90 +ccpp/physics/physics/Radiation/RRTMGP/rrtmgp_lw_main.F90 +ccpp/physics/physics/Radiation/RRTMGP/rrtmgp_sw_main.F90 +ccpp/physics/physics/GWD/cires_ugwp.F90 +ccpp/physics/physics/GWD/cires_ugwp_post.F90 +ccpp/physics/physics/GWD/unified_ugwp.F90 +ccpp/physics/physics/GWD/unified_ugwp_post.F90 +ccpp/physics/physics/GWD/ugwpv1_gsldrag.F90 +ccpp/physics/physics/GWD/ugwpv1_gsldrag_post.F90 +ccpp/physics/physics/GWD/drag_suite.F90 +#ccpp/physics/physics/GWD/gwdc_pre.f +#ccpp/physics/physics/GWD/gwdc.f +#ccpp/physics/physics/GWD/gwdc_post.f +ccpp/physics/physics/GWD/gwdps.f +#ccpp/physics/physics/GWD/rayleigh_damp.f +#ccpp/physics/physics/CONV/Chikira_Sugiyama/cs_conv_pre.F90 +#ccpp/physics/physics/CONV/Chikira_Sugiyama/cs_conv.F90 +#ccpp/physics/physics/CONV/Chikira_Sugiyama/cs_conv_post.F90 +#ccpp/physics/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90 +ccpp/physics/physics/CONV/nTiedtke/cu_ntiedtke_pre.F90 +ccpp/physics/physics/CONV/nTiedtke/cu_ntiedtke.F90 +ccpp/physics/physics/CONV/nTiedtke/cu_ntiedtke_post.F90 +ccpp/physics/physics/CONV/SAMF/samfdeepcnv.f +ccpp/physics/physics/CONV/SAMF/samfshalcnv.f +#ccpp/physics/physics/CONV/SAS/sascnvn.F +#ccpp/physics/physics/CONV/SAS/shalcnv.F +ccpp/physics/physics/CONV/Grell_Freitas/cu_gf_driver_pre.F90 +ccpp/physics/physics/CONV/Grell_Freitas/cu_gf_driver.F90 +ccpp/physics/physics/CONV/Grell_Freitas/cu_gf_driver_post.F90 +#ccpp/physics/physics/CONV/C3/cu_c3_driver_pre.F90 +#ccpp/physics/physics/CONV/C3/cu_c3_driver.F90 +#ccpp/physics/physics/CONV/C3/cu_c3_driver_post.F90 +#ccpp/physics/physics/CONV/RAS/rascnv.F90 +#ccpp/physics/physics/PBL/SHOC/shoc.F90 +ccpp/physics/physics/PBL/HEDMF/hedmf.f +#ccpp/physics/physics/PBL/SHOC/moninshoc.f +ccpp/physics/physics/PBL/SATMEDMF/satmedmfvdif.F +ccpp/physics/physics/PBL/SATMEDMF/satmedmfvdifq.F +#ccpp/physics/physics/PBL/saYSU/shinhongvdif.F90 +#ccpp/physics/physics/PBL/YSU/ysuvdif.F90 +ccpp/physics/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 +#ccpp/physics/physics/PBL/MYJ/myjpbl_wrapper.F90 +ccpp/physics/physics/MP/GFDL/v1_2019/gfdl_cloud_microphys.F90 +ccpp/physics/physics/MP/GFDL/v3_2022/gfdl_cloud_microphys_v3.F90 +#ccpp/physics/physics/MP/Zhao_Carr/zhaocarr_gscond.f +#ccpp/physics/physics/MP/Zhao_Carr/zhaocarr_precpd.f +#ccpp/physics/physics/MP/Morrison_Gettelman/m_micro.F90 +#ccpp/physics/physics/MP/Morrison_Gettelman/m_micro_pre.F90 +#ccpp/physics/physics/MP/Morrison_Gettelman/m_micro_post.F90 +ccpp/physics/physics/MP/Thompson/mp_thompson_pre.F90 +ccpp/physics/physics/MP/Thompson/mp_thompson.F90 +ccpp/physics/physics/MP/Thompson/mp_thompson_post.F90 +ccpp/physics/physics/MP/TEMPO/mp_tempo_pre.F90 +ccpp/physics/physics/MP/TEMPO/mp_tempo.F90 +ccpp/physics/physics/MP/TEMPO/mp_tempo_post.F90 +ccpp/physics/physics/MP/NSSL/mp_nssl.F90 +#ccpp/physics/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 +#ccpp/physics/physics/SFC_Layer/GFDL/gfdl_sfc_layer.F90 +ccpp/physics/physics/SFC_Layer/UFS/sfc_diag.f +ccpp/physics/physics/SFC_Layer/UFS/sfc_diag_post.F90 +ccpp/physics/physics/SFC_Layer/MYNN/mynnsfc_wrapper.F90 +#ccpp/physics/physics/SFC_Layer/MYJ/myjsfc_wrapper.F90 +ccpp/physics/physics/SFC_Layer/UFS/sfc_diff.f +ccpp/physics/physics/SFC_Layer/UFS/sfc_nst.f +ccpp/physics/physics/SFC_Layer/UFS/sfc_nst_post.f +ccpp/physics/physics/SFC_Layer/UFS/sfc_nst_pre.f +ccpp/physics/physics/SFC_Models/Land/RUC/lsm_ruc.F90 +ccpp/physics/physics/SFC_Models/Land/Noah/lsm_noah.f +ccpp/physics/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +ccpp/physics/physics/SFC_Models/Ocean/UFS/sfc_ocean.F +ccpp/physics/physics/SFC_Models/SeaIce/CICE/sfc_sice.f +ccpp/physics/physics/SFC_Models/SeaIce/CICE/sfc_cice.f +#ccpp/physics/physics/SFC_Models/Lake/Flake/flake_driver.F90 +ccpp/physics/physics/SFC_Models/Lake/CLM/clm_lake.f90 +ccpp/physics/physics/smoke_dust/rrfs_smoke_wrapper.F90 +ccpp/physics/physics/smoke_dust/rrfs_smoke_postpbl.F90 diff --git a/ccpp/framework b/ccpp/framework index 3256121dc..69bca8d90 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 3256121dc4972d5c78f43f1a16ea1cb118ec6daf +Subproject commit 69bca8d903c97341e359e2ad838451d6e330fdc7 diff --git a/ccpp/physics b/ccpp/physics index 9fe0af3aa..ef00a634a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 9fe0af3aadb3fca26d6bc684dfaa9d13ac8a533c +Subproject commit ef00a634ae1821992df0a59dbd4ef0d20d816197 diff --git a/ccpp/suites/suite_HAFS_v0_hwrf.xml b/ccpp/suites/suite_HAFS_v0_hwrf.xml index 76111175a..e09c3ce60 100644 --- a/ccpp/suites/suite_HAFS_v0_hwrf.xml +++ b/ccpp/suites/suite_HAFS_v0_hwrf.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_HAFS_v0_hwrf_ps.xml b/ccpp/suites/suite_HAFS_v0_hwrf_ps.xml index 602b3aeb6..99e85ad26 100644 --- a/ccpp/suites/suite_HAFS_v0_hwrf_ps.xml +++ b/ccpp/suites/suite_HAFS_v0_hwrf_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml b/ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml index d8bfb8311..86dd39675 100644 --- a/ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml +++ b/ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml b/ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml index 62d188709..c79bdf295 100644 --- a/ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml +++ b/ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v15p2.xml b/ccpp/suites/suite_SCM_GFS_v15p2.xml index 2b881738e..a723286a6 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml index 6e9ec3504..41f7d70ec 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_FA.xml b/ccpp/suites/suite_SCM_GFS_v15p2_FA.xml index 886a8768b..215294c6c 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_FA.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_FA.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml b/ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml index 2632e40f5..b3ce19987 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml b/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml index d198a9737..8e1c15622 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml index e5d22a3d7..3df77dde6 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml index 1febad374..6cd20c40c 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml b/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml index 330f20946..57459c8d5 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml index 5915ecd4f..b431fc41b 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml b/ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml index 87553bd40..0ffbae1bd 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml b/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml index a32a78fb6..282b51c1a 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml index bbe13cdfb..2b47ea2f9 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_ps.xml index 1634d4214..440dde273 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml index 9450b42f3..365377298 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16.xml b/ccpp/suites/suite_SCM_GFS_v16.xml index b98d0f8ce..72d2a952d 100644 --- a/ccpp/suites/suite_SCM_GFS_v16.xml +++ b/ccpp/suites/suite_SCM_GFS_v16.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml b/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml index 3b585c411..af0a1d9da 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml index 1c1e5d437..1368a1a58 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_debug.xml b/ccpp/suites/suite_SCM_GFS_v16_debug.xml index 71d003efe..d4dd7704c 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_debug.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_debug.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml index 2e94e8ca0..828892c73 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml b/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml index e4febfe24..38d7e1d3d 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml index d5fe0bd16..30a3789fa 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml b/ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml index ec15e151f..67f169e6a 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml index b7decd982..0439c0174 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_ps.xml index 90962bb25..8b0c42fed 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml b/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml index 7858601b9..8a2fa1683 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre @@ -78,4 +78,4 @@ maximum_hourly_diagnostics - \ No newline at end of file + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8.xml b/ccpp/suites/suite_SCM_GFS_v17_p8.xml index 4501026c8..aa0f272d3 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml index e700c7e55..019662b8e 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml index 0ca378b15..e58d0dd68 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml index 0f214aff6..7f6821d59 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml index e4e8eb2ba..190b6daba 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml @@ -1,6 +1,6 @@ - + @@ -57,6 +57,12 @@ ugwpv1_gsldrag ugwpv1_gsldrag_post GFS_GWD_generic_post + + + + + + GFS_suite_stateout_update diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml index 75644d368..7bca99001 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml index eaf5d18b7..75a8b935e 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml index 772816157..f2a8826cf 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml @@ -1,6 +1,6 @@ - + @@ -38,6 +38,12 @@ ugwpv1_gsldrag ugwpv1_gsldrag_post GFS_GWD_generic_post + + + + + + GFS_suite_stateout_update diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml index 64b58cfd2..652d6663f 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml index 032cfe411..3816828b5 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GSD_v1.xml b/ccpp/suites/suite_SCM_GSD_v1.xml index 2d2674f57..57053040b 100644 --- a/ccpp/suites/suite_SCM_GSD_v1.xml +++ b/ccpp/suites/suite_SCM_GSD_v1.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GSD_v1_ps.xml b/ccpp/suites/suite_SCM_GSD_v1_ps.xml index b366de869..6222f2963 100644 --- a/ccpp/suites/suite_SCM_GSD_v1_ps.xml +++ b/ccpp/suites/suite_SCM_GSD_v1_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GSD_v1nssl.xml b/ccpp/suites/suite_SCM_GSD_v1nssl.xml index f7e538b30..0f11bb6a1 100644 --- a/ccpp/suites/suite_SCM_GSD_v1nssl.xml +++ b/ccpp/suites/suite_SCM_GSD_v1nssl.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml b/ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml index eca2a4050..981a69a0d 100644 --- a/ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml +++ b/ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_HRRR.xml b/ccpp/suites/suite_SCM_HRRR.xml index ce7aa9a1d..3d892e3e9 100644 --- a/ccpp/suites/suite_SCM_HRRR.xml +++ b/ccpp/suites/suite_SCM_HRRR.xml @@ -1,6 +1,6 @@ - + @@ -56,6 +56,12 @@ GFS_GWD_generic_pre drag_suite GFS_GWD_generic_post + + + + + + GFS_suite_stateout_update diff --git a/ccpp/suites/suite_SCM_HRRR_gf.xml b/ccpp/suites/suite_SCM_HRRR_gf.xml index 36791f235..fcfc85bfc 100644 --- a/ccpp/suites/suite_SCM_HRRR_gf.xml +++ b/ccpp/suites/suite_SCM_HRRR_gf.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre @@ -54,6 +54,12 @@ GFS_GWD_generic_pre drag_suite GFS_GWD_generic_post + + + + + + GFS_suite_stateout_update diff --git a/ccpp/suites/suite_SCM_HRRR_gf_ps.xml b/ccpp/suites/suite_SCM_HRRR_gf_ps.xml index ca05b5a21..2a4216534 100644 --- a/ccpp/suites/suite_SCM_HRRR_gf_ps.xml +++ b/ccpp/suites/suite_SCM_HRRR_gf_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_HRRR_ps.xml b/ccpp/suites/suite_SCM_HRRR_ps.xml index 36fbe6063..b346bb6e3 100644 --- a/ccpp/suites/suite_SCM_HRRR_ps.xml +++ b/ccpp/suites/suite_SCM_HRRR_ps.xml @@ -1,6 +1,6 @@ - + @@ -37,6 +37,12 @@ GFS_GWD_generic_pre drag_suite GFS_GWD_generic_post + + + + + + GFS_suite_stateout_update diff --git a/ccpp/suites/suite_SCM_RAP.xml b/ccpp/suites/suite_SCM_RAP.xml index 61c84460b..2e02f7f9f 100644 --- a/ccpp/suites/suite_SCM_RAP.xml +++ b/ccpp/suites/suite_SCM_RAP.xml @@ -1,6 +1,6 @@ - + @@ -55,6 +55,10 @@ GFS_GWD_generic_pre drag_suite GFS_GWD_generic_post + + + + GFS_suite_stateout_update diff --git a/ccpp/suites/suite_SCM_RAP_ps.xml b/ccpp/suites/suite_SCM_RAP_ps.xml index 94611ee37..bbf27da57 100644 --- a/ccpp/suites/suite_SCM_RAP_ps.xml +++ b/ccpp/suites/suite_SCM_RAP_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1alpha.xml b/ccpp/suites/suite_SCM_RRFS_v1alpha.xml index c66e3f647..ec70bbd84 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1alpha.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1alpha.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml b/ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml index 35525ae70..12fc22ef1 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1beta.xml b/ccpp/suites/suite_SCM_RRFS_v1beta.xml index 4f1ecaff1..39199030c 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1beta.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1beta.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml b/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml index 45f254dc3..dad7a8b08 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst_ps.xml b/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst_ps.xml index 68ef0ccbd..3127c10a3 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst_ps.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml b/ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml index b8f0420b2..2c2405ea7 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1nssl.xml b/ccpp/suites/suite_SCM_RRFS_v1nssl.xml index 74338b179..848a7121d 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1nssl.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1nssl.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_WoFS_v0.xml b/ccpp/suites/suite_SCM_WoFS_v0.xml index b89e047bd..1a9aa52f2 100644 --- a/ccpp/suites/suite_SCM_WoFS_v0.xml +++ b/ccpp/suites/suite_SCM_WoFS_v0.xml @@ -1,6 +1,6 @@ - + @@ -72,4 +72,4 @@ - \ No newline at end of file + diff --git a/ccpp/suites/suite_SCM_WoFS_v0_ps.xml b/ccpp/suites/suite_SCM_WoFS_v0_ps.xml index 943996c7a..e63dd83e1 100644 --- a/ccpp/suites/suite_SCM_WoFS_v0_ps.xml +++ b/ccpp/suites/suite_SCM_WoFS_v0_ps.xml @@ -1,6 +1,6 @@ - + @@ -53,4 +53,4 @@ - \ No newline at end of file + diff --git a/ccpp/suites/suite_SCM_csawmg.xml b/ccpp/suites/suite_SCM_csawmg.xml index 286b03cf2..dc7d18399 100644 --- a/ccpp/suites/suite_SCM_csawmg.xml +++ b/ccpp/suites/suite_SCM_csawmg.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_csawmg_ps.xml b/ccpp/suites/suite_SCM_csawmg_ps.xml index 3884e38fc..cf1cad757 100644 --- a/ccpp/suites/suite_SCM_csawmg_ps.xml +++ b/ccpp/suites/suite_SCM_csawmg_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/scm/etc/scm_slurm_example.py b/scm/etc/scm_slurm_example.py index 5f181cce6..f41fd5671 100755 --- a/scm/etc/scm_slurm_example.py +++ b/scm/etc/scm_slurm_example.py @@ -29,7 +29,7 @@ WALLTIME = "20" PROCESSORS = "1" QUEUE = "batch" -COMMAND = "./run_scm.py -c twpice" +COMMAND = "./run_scm.py --file ../../test/rt_test_cases.v7.py --runtime_mult 0.1" EMAIL_ADDR = MY_EMAIL EMAIL_OCCASION = "BEGIN,END,FAIL" SERIAL_MEM = "512M" diff --git a/scm/src/CCPP_typedefs.F90 b/scm/src/CCPP_typedefs.F90 index 2e4842a46..9c66c6d39 100644 --- a/scm/src/CCPP_typedefs.F90 +++ b/scm/src/CCPP_typedefs.F90 @@ -7,9 +7,6 @@ module CCPP_typedefs ! Physics kind defininitions needed for interstitial DDTs use machine, only: kind_grid, kind_dyn, kind_phys - ! Constants/dimensions needed for interstitial DDTs - use GFS_typedefs, only: clear_val, LTP - ! Physics type defininitions needed for interstitial DDTs use module_radsw_parameters, only: profsw_type, cmpfsw_type use module_radlw_parameters, only: proflw_type @@ -19,14 +16,6 @@ module CCPP_typedefs private - ! To ensure that these values match what's in the physics, array - ! sizes are compared in the auto-generated physics caps in debug mode - ! from module_radiation_clouds - integer, parameter :: NF_CLDS = 9 - ! from module_radiation_gases - integer, parameter :: NF_VGAS = 10 - ! from module_radiation_surface - ! GFS_interstitial_type !< fields required to replace interstitial code in GFS_{physics,radiation}_driver.F90 in CCPP public GFS_interstitial_type @@ -176,7 +165,6 @@ module CCPP_typedefs logical, pointer :: ocean(:) => null() !< integer, pointer :: islmsk(:) => null() !< integer, pointer :: islmsk_cice(:) => null() !< - integer :: itc !< logical, pointer :: wet(:) => null() !< integer :: kb !< integer, pointer :: kbot(:) => null() !< @@ -187,27 +175,14 @@ module CCPP_typedefs integer :: kt !< integer, pointer :: ktop(:) => null() !< integer, pointer :: mbota(:,:) => null() !< - logical :: mg3_as_mg2 !< integer, pointer :: mtopa(:,:) => null() !< real (kind=kind_phys), pointer :: ncgl(:,:) => null() !< real (kind=kind_phys), pointer :: ncpr(:,:) => null() !< real (kind=kind_phys), pointer :: ncps(:,:) => null() !< - integer :: ncstrac !< integer :: nday !< - integer :: nn !< - integer :: nsamftrac !< - integer :: nscav !< - integer :: ntcwx !< - integer :: ntiwx !< - integer :: ntrwx !< - integer :: ntk !< - integer :: ntkev !< - integer :: nvdiff !< real (kind=kind_phys), pointer :: oa4(:,:) => null() !< real (kind=kind_phys), pointer :: oc(:) => null() !< real (kind=kind_phys), pointer :: olyr(:,:) => null() !< - logical , pointer :: otspt(:,:) => null() !< - logical , pointer :: otsptflag(:) => null() !< real (kind=kind_phys), pointer :: plvl(:,:) => null() !< real (kind=kind_phys), pointer :: plyr(:,:) => null() !< real (kind=kind_phys), pointer :: prcpmp(:) => null() !< @@ -266,9 +241,7 @@ module CCPP_typedefs real (kind=kind_phys), pointer :: tprcp_land(:) => null() !< real (kind=kind_phys), pointer :: tprcp_water(:) => null() !< integer :: tracers_start_index !< - integer :: tracers_total !< integer :: tracers_water !< - logical :: trans_aero !< real (kind=kind_phys), pointer :: trans(:) => null() !< real (kind=kind_phys), pointer :: tseal(:) => null() !< real (kind=kind_phys), pointer :: tsfa(:) => null() !< @@ -411,11 +384,6 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) type(GFS_control_type), intent(in) :: Model integer :: iGas ! - allocate (Interstitial%otspt (Model%ntracp1,2)) - allocate (Interstitial%otsptflag (Model%ntrac)) - ! Set up numbers of tracers for PBL, convection, etc: sets - ! Interstitial%{nvdiff,mg3_as_mg2,nn,tracers_total,ntcwx,ntiwx,ntk,ntkev,otspt,nsamftrac,ncstrac,nscav} - call gfs_interstitial_setup_tracers(Interstitial, Model) ! Allocate arrays allocate (Interstitial%adjsfculw_land (ixs:ixe)) allocate (Interstitial%adjsfculw_ice (ixs:ixe)) @@ -432,7 +400,7 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%alb1d (ixs:ixe)) if (.not. Model%do_RRTMGP) then ! RRTMGP uses its own cloud_overlap_param - allocate (Interstitial%alpha (ixs:ixe,Model%levr+LTP)) + allocate (Interstitial%alpha (ixs:ixe,Model%levr+Model%LTP)) end if allocate (Interstitial%bexp1d (ixs:ixe)) allocate (Interstitial%cd (ixs:ixe)) @@ -448,11 +416,11 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%chh_water (ixs:ixe)) allocate (Interstitial%cldf (ixs:ixe)) allocate (Interstitial%cldsa (ixs:ixe,5)) - allocate (Interstitial%cldtaulw (ixs:ixe,Model%levr+LTP)) - allocate (Interstitial%cldtausw (ixs:ixe,Model%levr+LTP)) + allocate (Interstitial%cldtaulw (ixs:ixe,Model%levr+Model%LTP)) + allocate (Interstitial%cldtausw (ixs:ixe,Model%levr+Model%LTP)) allocate (Interstitial%cld1d (ixs:ixe)) - allocate (Interstitial%clouds (ixs:ixe,Model%levr+LTP,NF_CLDS)) - allocate (Interstitial%clw (ixs:ixe,Model%levs,Interstitial%nn)) + allocate (Interstitial%clouds (ixs:ixe,Model%levr+Model%LTP,Model%NF_CLDS)) + allocate (Interstitial%clw (ixs:ixe,Model%levs,Model%nn)) allocate (Interstitial%clx (ixs:ixe,4)) allocate (Interstitial%cmm_ice (ixs:ixe)) allocate (Interstitial%cmm_land (ixs:ixe)) @@ -465,7 +433,7 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%de_lgth (ixs:ixe)) allocate (Interstitial%del (ixs:ixe,Model%levs)) allocate (Interstitial%del_gz (ixs:ixe,Model%levs+1)) - allocate (Interstitial%delr (ixs:ixe,Model%levr+LTP)) + allocate (Interstitial%delr (ixs:ixe,Model%levr+Model%LTP)) allocate (Interstitial%dlength (ixs:ixe)) allocate (Interstitial%dqdt (ixs:ixe,Model%levs,Model%ntrac)) allocate (Interstitial%dqsfc1 (ixs:ixe)) @@ -480,8 +448,8 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%dvdt (ixs:ixe,Model%levs)) allocate (Interstitial%dvsfcg (ixs:ixe)) allocate (Interstitial%dvsfc1 (ixs:ixe)) - allocate (Interstitial%dvdftra (ixs:ixe,Model%levs,Interstitial%nvdiff)) - allocate (Interstitial%dzlyr (ixs:ixe,Model%levr+LTP)) + allocate (Interstitial%dvdftra (ixs:ixe,Model%levs,Model%nvdiff)) + allocate (Interstitial%dzlyr (ixs:ixe,Model%levr+Model%LTP)) allocate (Interstitial%elvmax (ixs:ixe)) allocate (Interstitial%ep1d (ixs:ixe)) allocate (Interstitial%ep1d_ice (ixs:ixe)) @@ -496,8 +464,8 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%ecan (ixs:ixe)) allocate (Interstitial%etran (ixs:ixe)) allocate (Interstitial%edir (ixs:ixe)) - allocate (Interstitial%faerlw (ixs:ixe,Model%levr+LTP,Model%NBDLW,Model%NF_AELW)) - allocate (Interstitial%faersw (ixs:ixe,Model%levr+LTP,Model%NBDSW,Model%NF_AESW)) + allocate (Interstitial%faerlw (ixs:ixe,Model%levr+Model%LTP,Model%NBDLW,Model%NF_AELW)) + allocate (Interstitial%faersw (ixs:ixe,Model%levr+Model%LTP,Model%NBDSW,Model%NF_AESW)) allocate (Interstitial%ffhh_ice (ixs:ixe)) allocate (Interstitial%ffhh_land (ixs:ixe)) allocate (Interstitial%ffhh_water (ixs:ixe)) @@ -517,8 +485,8 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%fm10_land (ixs:ixe)) allocate (Interstitial%fm10_water (ixs:ixe)) allocate (Interstitial%frland (ixs:ixe)) - allocate (Interstitial%fscav (Interstitial%nscav)) - allocate (Interstitial%fswtr (Interstitial%nscav)) + allocate (Interstitial%fscav (Model%nscav)) + allocate (Interstitial%fswtr (Model%nscav)) allocate (Interstitial%gabsbdlw (ixs:ixe)) allocate (Interstitial%gabsbdlw_ice (ixs:ixe)) allocate (Interstitial%gabsbdlw_land (ixs:ixe)) @@ -526,7 +494,7 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%gamma (ixs:ixe)) allocate (Interstitial%gamq (ixs:ixe)) allocate (Interstitial%gamt (ixs:ixe)) - allocate (Interstitial%gasvmr (ixs:ixe,Model%levr+LTP,NF_VGAS)) + allocate (Interstitial%gasvmr (ixs:ixe,Model%levr+Model%LTP,Model%NF_VGAS)) allocate (Interstitial%gflx (ixs:ixe)) allocate (Interstitial%gflx_ice (ixs:ixe)) allocate (Interstitial%gflx_land (ixs:ixe)) @@ -539,10 +507,10 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%hflx_ice (ixs:ixe)) allocate (Interstitial%hflx_land (ixs:ixe)) allocate (Interstitial%hflx_water (ixs:ixe)) - allocate (Interstitial%htlwc (ixs:ixe,Model%levr+LTP)) - allocate (Interstitial%htlw0 (ixs:ixe,Model%levr+LTP)) - allocate (Interstitial%htswc (ixs:ixe,Model%levr+LTP)) - allocate (Interstitial%htsw0 (ixs:ixe,Model%levr+LTP)) + allocate (Interstitial%htlwc (ixs:ixe,Model%levr+Model%LTP)) + allocate (Interstitial%htlw0 (ixs:ixe,Model%levr+Model%LTP)) + allocate (Interstitial%htswc (ixs:ixe,Model%levr+Model%LTP)) + allocate (Interstitial%htsw0 (ixs:ixe,Model%levr+Model%LTP)) allocate (Interstitial%dry (ixs:ixe)) allocate (Interstitial%idxday (ixs:ixe)) allocate (Interstitial%icy (ixs:ixe)) @@ -560,11 +528,11 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%mtopa (ixs:ixe,3)) allocate (Interstitial%oa4 (ixs:ixe,4)) allocate (Interstitial%oc (ixs:ixe)) - allocate (Interstitial%olyr (ixs:ixe,Model%levr+LTP)) - allocate (Interstitial%plvl (ixs:ixe,Model%levr+1+LTP)) - allocate (Interstitial%plyr (ixs:ixe,Model%levr+LTP)) + allocate (Interstitial%olyr (ixs:ixe,Model%levr+Model%LTP)) + allocate (Interstitial%plvl (ixs:ixe,Model%levr+1+Model%LTP)) + allocate (Interstitial%plyr (ixs:ixe,Model%levr+Model%LTP)) allocate (Interstitial%prnum (ixs:ixe,Model%levs)) - allocate (Interstitial%qlyr (ixs:ixe,Model%levr+LTP)) + allocate (Interstitial%qlyr (ixs:ixe,Model%levr+Model%LTP)) allocate (Interstitial%prcpmp (ixs:ixe)) allocate (Interstitial%qss_ice (ixs:ixe)) allocate (Interstitial%qss_land (ixs:ixe)) @@ -600,8 +568,8 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%stress_water (ixs:ixe)) allocate (Interstitial%theta (ixs:ixe)) allocate (Interstitial%tkeh (ixs:ixe,Model%levs+1)) !Vertical turbulent kinetic energy at model layer interfaces - allocate (Interstitial%tlvl (ixs:ixe,Model%levr+1+LTP)) - allocate (Interstitial%tlyr (ixs:ixe,Model%levr+LTP)) + allocate (Interstitial%tlvl (ixs:ixe,Model%levr+1+Model%LTP)) + allocate (Interstitial%tlyr (ixs:ixe,Model%levr+Model%LTP)) allocate (Interstitial%tprcp_ice (ixs:ixe)) allocate (Interstitial%tprcp_land (ixs:ixe)) allocate (Interstitial%tprcp_water (ixs:ixe)) @@ -617,7 +585,7 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%uustar_ice (ixs:ixe)) allocate (Interstitial%uustar_land (ixs:ixe)) allocate (Interstitial%uustar_water (ixs:ixe)) - allocate (Interstitial%vdftra (ixs:ixe,Model%levs,Interstitial%nvdiff)) !GJF first dimension was set as 'IX' in GFS_physics_driver + allocate (Interstitial%vdftra (ixs:ixe,Model%levs,Model%nvdiff)) !GJF first dimension was set as 'IX' in GFS_physics_driver allocate (Interstitial%vegf1d (ixs:ixe)) allocate (Interstitial%wcbmax (ixs:ixe)) allocate (Interstitial%wind (ixs:ixe)) @@ -746,7 +714,7 @@ subroutine gfs_interstitial_create (Interstitial, ixs, ixe, Model) allocate (Interstitial%cnv_ndrop (ixs:ixe,Model%levs)) allocate (Interstitial%cnv_nice (ixs:ixe,Model%levs)) end if - if (Model%lsm == Model%lsm_noahmp) then + if (Model%lsm == Model%ilsm_noahmp) then allocate (Interstitial%t2mmp (ixs:ixe)) allocate (Interstitial%q2mp (ixs:ixe)) end if @@ -768,8 +736,6 @@ subroutine gfs_interstitial_destroy (Interstitial, Model) class(GFS_interstitial_type) :: Interstitial type(GFS_control_type), intent(in) :: Model - deallocate (Interstitial%otspt) - deallocate (Interstitial%otsptflag) ! Allocate arrays deallocate (Interstitial%adjsfculw_land) deallocate (Interstitial%adjsfculw_ice) @@ -1098,216 +1064,13 @@ subroutine gfs_interstitial_destroy (Interstitial, Model) deallocate (Interstitial%cnv_ndrop) deallocate (Interstitial%cnv_nice) end if - if (Model%lsm == Model%lsm_noahmp) then + if (Model%lsm == Model%ilsm_noahmp) then deallocate (Interstitial%t2mmp) deallocate (Interstitial%q2mp) end if end subroutine gfs_interstitial_destroy - subroutine gfs_interstitial_setup_tracers(Interstitial, Model) - ! - implicit none - ! - class(GFS_interstitial_type) :: Interstitial - type(GFS_control_type), intent(in) :: Model - integer :: n, tracers - logical :: ltest - - !first, initialize the values (in case the values don't get initialized within if statements below) - Interstitial%nvdiff = Model%ntrac - Interstitial%mg3_as_mg2 = .false. - Interstitial%nn = Model%ntrac + 1 - Interstitial%itc = 0 - Interstitial%ntk = 0 - Interstitial%ntkev = 0 - Interstitial%tracers_total = 0 - Interstitial%otspt(:,:) = .true. - Interstitial%otsptflag(:) = .true. - Interstitial%nsamftrac = 0 - Interstitial%ncstrac = 0 - Interstitial%ntcwx = 0 - Interstitial%ntiwx = 0 - Interstitial%ntrwx = 0 - - ! perform aerosol convective transport and PBL diffusion - Interstitial%trans_aero = Model%cplchm .and. Model%trans_trac - - if (Model%imp_physics == Model%imp_physics_thompson .or. & - Model%imp_physics == Model%imp_physics_tempo) then - if (Model%ltaerosol) then - Interstitial%nvdiff = 12 - else if (Model%mraerosol) then - Interstitial%nvdiff = 10 - else - Interstitial%nvdiff = 9 - endif - if (Model%satmedmf) Interstitial%nvdiff = Interstitial%nvdiff + 1 - elseif ( Model%imp_physics == Model%imp_physics_nssl ) then - if (Model%me == Model%master) write(0,*) 'nssl_settings1: nvdiff,ntrac = ', Interstitial%nvdiff, Model%ntrac - - IF ( Model%nssl_hail_on ) THEN - Interstitial%nvdiff = 16 ! Model%ntrac ! 17 - ELSE - Interstitial%nvdiff = 13 ! turn off hail q,N, and volume - ENDIF - ! write(*,*) 'NSSL: nvdiff, ntrac = ',Interstitial%nvdiff, Model%ntrac - if (Model%satmedmf) Interstitial%nvdiff = Interstitial%nvdiff + 1 - IF ( Model%nssl_ccn_on ) THEN - Interstitial%nvdiff = Interstitial%nvdiff + 1 - ENDIF - if (Model%me == Model%master) write(0,*) 'nssl_settings2: nvdiff,ntrac = ', Interstitial%nvdiff, Model%ntrac - - elseif (Model%imp_physics == Model%imp_physics_wsm6) then - Interstitial%nvdiff = Model%ntrac -3 - if (Model%satmedmf) Interstitial%nvdiff = Interstitial%nvdiff + 1 - elseif (Model%ntclamt > 0) then ! for GFDL MP don't diffuse cloud amount - Interstitial%nvdiff = Model%ntrac - 1 - endif - - if (Model%imp_physics == Model%imp_physics_mg) then - if (abs(Model%fprcp) == 1) then - Interstitial%mg3_as_mg2 = .false. - elseif (Model%fprcp >= 2) then - if(Model%ntgl > 0 .and. (Model%mg_do_graupel .or. Model%mg_do_hail)) then - Interstitial%mg3_as_mg2 = .false. - else ! MG3 code run without graupel/hail i.e. as MG2 - Interstitial%mg3_as_mg2 = .true. - endif - endif - endif - - Interstitial%nscav = Model%ntrac - Model%ncnd + 2 - - if (Interstitial%nvdiff == Model%ntrac) then - Interstitial%ntcwx = Model%ntcw - Interstitial%ntiwx = Model%ntiw - Interstitial%ntrwx = Model%ntrw - else - if (Model%imp_physics == Model%imp_physics_wsm6) then - Interstitial%ntcwx = 2 - Interstitial%ntiwx = 3 - elseif (Model%imp_physics == Model%imp_physics_thompson .or. & - Model%imp_physics == Model%imp_physics_tempo) then - Interstitial%ntcwx = 2 - Interstitial%ntiwx = 3 - Interstitial%ntrwx = 4 - elseif (Model%imp_physics == Model%imp_physics_nssl) then - Interstitial%ntcwx = 2 - Interstitial%ntiwx = 3 - Interstitial%ntrwx = 4 - elseif (Model%imp_physics == Model%imp_physics_gfdl) then - Interstitial%ntcwx = 2 - Interstitial%ntiwx = 3 - Interstitial%ntrwx = 4 - ! F-A MP scheme - elseif (Model%imp_physics == Model%imp_physics_fer_hires) then - Interstitial%ntcwx = 2 - Interstitial%ntiwx = 3 - Interstitial%ntrwx = 4 - elseif (Model%imp_physics == Model%imp_physics_mg) then - Interstitial%ntcwx = 2 - Interstitial%ntiwx = 3 - Interstitial%ntrwx = 4 - elseif (Model%imp_physics == Model%imp_physics_zhao_carr) then - Interstitial%ntcwx = 2 - endif - endif - - if (Model%cplchm) then - ! Only the following microphysics schemes are supported with coupled chemistry - if (Model%imp_physics == Model%imp_physics_zhao_carr) then - Interstitial%nvdiff = 3 - elseif (Model%imp_physics == Model%imp_physics_mg) then - if (Model%ntgl > 0) then - Interstitial%nvdiff = 12 - else - Interstitial%nvdiff = 10 - endif - elseif (Model%imp_physics == Model%imp_physics_gfdl) then - Interstitial%nvdiff = 7 - elseif (Model%imp_physics == Model%imp_physics_thompson .or. & - Model%imp_physics == Model%imp_physics_tempo) then - if (Model%ltaerosol) then - Interstitial%nvdiff = 12 - else if (Model%mraerosol) then - Interstitial%nvdiff = 10 - else - Interstitial%nvdiff = 9 - endif - else - error stop "Selected microphysics scheme is not supported when coupling with chemistry" - endif - if (Interstitial%trans_aero) Interstitial%nvdiff = Interstitial%nvdiff + Model%ntchm - if (Model%ntke > 0) Interstitial%nvdiff = Interstitial%nvdiff + 1 ! adding tke to the list - endif - - if (Model%ntke > 0) Interstitial%ntkev = Interstitial%nvdiff - - if (Model%ntiw > 0) then - if (Model%ntclamt > 0 .and. Model%ntsigma > 0 .and. Model%ntomega > 0) then - Interstitial%nn = Model%ntrac - 4 - elseif (Model%ntclamt > 0 .and. Model%ntsigma > 0 .and. Model%ntomega <= 0) then - Interstitial%nn = Model%ntrac - 3 - elseif (Model%ntclamt > 0 .and. Model%ntsigma <= 0 .and. Model%ntomega > 0) then - Interstitial%nn = Model%ntrac - 3 - elseif (Model%ntclamt > 0 .and. Model%ntsigma <= 0 .and. Model%ntomega <= 0) then - Interstitial%nn = Model%ntrac - 2 - elseif (Model%ntclamt <= 0 .and. Model%ntsigma > 0 .and. Model%ntomega > 0) then - Interstitial%nn = Model%ntrac - 3 - elseif (Model%ntclamt <= 0 .and. Model%ntsigma > 0 .and. Model%ntomega <= 0) then - Interstitial%nn = Model%ntrac - 2 - elseif (Model%ntclamt <= 0 .and. Model%ntsigma <= 0 .and. Model%ntomega > 0) then - Interstitial%nn = Model%ntrac - 2 - else - Interstitial%nn = Model%ntrac - 1 - endif - elseif (Model%ntcw > 0) then - Interstitial%nn = Model%ntrac - else - Interstitial%nn = Model%ntrac + 1 - endif - - if (Model%cscnv .or. Model%satmedmf .or. Model%trans_trac ) then - Interstitial%otspt(:,:) = .true. ! otspt is used only for cscnv - Interstitial%otspt(1:3,:) = .false. ! this is for sp.hum, ice and liquid water - Interstitial%otsptflag(:) = .true. - tracers = 2 - do n=2,Model%ntrac - ltest = ( n /= Model%ntcw .and. n /= Model%ntiw .and. n /= Model%ntclamt .and. & - n /= Model%ntrw .and. n /= Model%ntsw .and. n /= Model%ntrnc .and. & - n /= Model%ntlnc .and. n /= Model%ntinc .and. & - n /= Model%ntsnc .and. n /= Model%ntgl .and. n /= Model%ntgnc .and. & - n /= Model%nthl .and. n /= Model%nthnc .and. n /= Model%ntgv .and. & - n /= Model%nthv .and. n /= Model%ntccn .and. n /= Model%ntccna .and. & - n /= Model%ntrz .and. n /= Model%ntgz .and. n /= Model%nthz .and. & - n /= Model%ntsigma .and. n /= Model%ntomega) - Interstitial%otsptflag(n) = ltest - if ( ltest ) then - tracers = tracers + 1 - if (Model%ntke == n ) then - Interstitial%otspt(tracers+1,1) = .false. - Interstitial%ntk = tracers - endif - if (Model%ntlnc == n .or. Model%ntinc == n .or. Model%ntrnc == n .or. Model%ntsnc == n .or. Model%ntgnc == n) & -! if (ntlnc == n .or. ntinc == n .or. ntrnc == n .or. ntsnc == n .or.& -! ntrw == n .or. ntsw == n .or. ntgl == n) & - Interstitial%otspt(tracers+1,1) = .false. - if (Interstitial%trans_aero .and. Model%ntchs == n) Interstitial%itc = tracers - endif - enddo - Interstitial%tracers_total = tracers - 2 - endif ! end if_ras or cfscnv or samf - if (.not. Model%satmedmf .and. .not. Model%trans_trac .and. & - .not. Model%ras .and. .not. Model%do_shoc) then - Interstitial%nsamftrac = 0 - else - Interstitial%nsamftrac = Interstitial%tracers_total - endif - Interstitial%ncstrac = Interstitial%tracers_total + 3 - - end subroutine gfs_interstitial_setup_tracers - subroutine gfs_interstitial_reset (Interstitial, Model) ! implicit none @@ -1315,91 +1078,91 @@ subroutine gfs_interstitial_reset (Interstitial, Model) class(GFS_interstitial_type) :: Interstitial type(GFS_control_type), intent(in) :: Model ! - Interstitial%adjsfculw_land = clear_val - Interstitial%adjsfculw_ice = clear_val - Interstitial%adjsfculw_water = clear_val - Interstitial%adjnirbmd = clear_val - Interstitial%adjnirbmu = clear_val - Interstitial%adjnirdfd = clear_val - Interstitial%adjnirdfu = clear_val - Interstitial%adjvisbmd = clear_val - Interstitial%adjvisbmu = clear_val - Interstitial%adjvisdfu = clear_val - Interstitial%adjvisdfd = clear_val - Interstitial%aerodp = clear_val - Interstitial%alb1d = clear_val + Interstitial%adjsfculw_land = Model%clear_val + Interstitial%adjsfculw_ice = Model%clear_val + Interstitial%adjsfculw_water = Model%clear_val + Interstitial%adjnirbmd = Model%clear_val + Interstitial%adjnirbmu = Model%clear_val + Interstitial%adjnirdfd = Model%clear_val + Interstitial%adjnirdfu = Model%clear_val + Interstitial%adjvisbmd = Model%clear_val + Interstitial%adjvisbmu = Model%clear_val + Interstitial%adjvisdfu = Model%clear_val + Interstitial%adjvisdfd = Model%clear_val + Interstitial%aerodp = Model%clear_val + Interstitial%alb1d = Model%clear_val if (.not. Model%do_RRTMGP) then - Interstitial%alpha = clear_val + Interstitial%alpha = Model%clear_val end if - Interstitial%bexp1d = clear_val - Interstitial%cd = clear_val + Interstitial%bexp1d = Model%clear_val + Interstitial%cd = Model%clear_val Interstitial%cd_ice = Model%huge Interstitial%cd_land = Model%huge Interstitial%cd_water = Model%huge - Interstitial%cdq = clear_val + Interstitial%cdq = Model%clear_val Interstitial%cdq_ice = Model%huge Interstitial%cdq_land = Model%huge Interstitial%cdq_water = Model%huge Interstitial%chh_ice = Model%huge Interstitial%chh_land = Model%huge Interstitial%chh_water = Model%huge - Interstitial%cldf = clear_val - Interstitial%cldsa = clear_val - Interstitial%cldtaulw = clear_val - Interstitial%cldtausw = clear_val - Interstitial%cld1d = clear_val - Interstitial%clouds = clear_val - Interstitial%clw = clear_val + Interstitial%cldf = Model%clear_val + Interstitial%cldsa = Model%clear_val + Interstitial%cldtaulw = Model%clear_val + Interstitial%cldtausw = Model%clear_val + Interstitial%cld1d = Model%clear_val + Interstitial%clouds = Model%clear_val + Interstitial%clw = Model%clear_val Interstitial%clw(:,:,2) = -999.9 - Interstitial%clx = clear_val + Interstitial%clx = Model%clear_val Interstitial%cmm_ice = Model%huge Interstitial%cmm_land = Model%huge Interstitial%cmm_water = Model%huge - Interstitial%cnvc = clear_val - Interstitial%ctei_r = clear_val - Interstitial%ctei_rml = clear_val - Interstitial%cumabs = clear_val - Interstitial%dd_mf = clear_val - Interstitial%de_lgth = clear_val - Interstitial%del = clear_val - Interstitial%del_gz = clear_val - Interstitial%delr = clear_val - Interstitial%dlength = clear_val - Interstitial%dqdt = clear_val - Interstitial%dqsfc1 = clear_val - Interstitial%drain = clear_val - Interstitial%dtdt = clear_val - Interstitial%dtsfc1 = clear_val - Interstitial%dt_mf = clear_val - Interstitial%dtzm = clear_val - Interstitial%dudt = clear_val - Interstitial%dusfcg = clear_val - Interstitial%dusfc1 = clear_val - Interstitial%dvdt = clear_val - Interstitial%dvsfcg = clear_val - Interstitial%dvsfc1 = clear_val - Interstitial%dvdftra = clear_val - Interstitial%dzlyr = clear_val - Interstitial%elvmax = clear_val - Interstitial%ep1d = clear_val + Interstitial%cnvc = Model%clear_val + Interstitial%ctei_r = Model%clear_val + Interstitial%ctei_rml = Model%clear_val + Interstitial%cumabs = Model%clear_val + Interstitial%dd_mf = Model%clear_val + Interstitial%de_lgth = Model%clear_val + Interstitial%del = Model%clear_val + Interstitial%del_gz = Model%clear_val + Interstitial%delr = Model%clear_val + Interstitial%dlength = Model%clear_val + Interstitial%dqdt = Model%clear_val + Interstitial%dqsfc1 = Model%clear_val + Interstitial%drain = Model%clear_val + Interstitial%dtdt = Model%clear_val + Interstitial%dtsfc1 = Model%clear_val + Interstitial%dt_mf = Model%clear_val + Interstitial%dtzm = Model%clear_val + Interstitial%dudt = Model%clear_val + Interstitial%dusfcg = Model%clear_val + Interstitial%dusfc1 = Model%clear_val + Interstitial%dvdt = Model%clear_val + Interstitial%dvsfcg = Model%clear_val + Interstitial%dvsfc1 = Model%clear_val + Interstitial%dvdftra = Model%clear_val + Interstitial%dzlyr = Model%clear_val + Interstitial%elvmax = Model%clear_val + Interstitial%ep1d = Model%clear_val Interstitial%ep1d_ice = Model%huge Interstitial%ep1d_land = Model%huge Interstitial%ep1d_water = Model%huge Interstitial%evap_ice = Model%huge Interstitial%evap_land = Model%huge Interstitial%evap_water = Model%huge - Interstitial%evbs = clear_val - Interstitial%evcw = clear_val - Interstitial%pah = clear_val - Interstitial%ecan = clear_val - Interstitial%etran = clear_val - Interstitial%edir = clear_val - Interstitial%faerlw = clear_val - Interstitial%faersw = clear_val + Interstitial%evbs = Model%clear_val + Interstitial%evcw = Model%clear_val + Interstitial%pah = Model%clear_val + Interstitial%ecan = Model%clear_val + Interstitial%etran = Model%clear_val + Interstitial%edir = Model%clear_val + Interstitial%faerlw = Model%clear_val + Interstitial%faersw = Model%clear_val Interstitial%ffhh_ice = Model%huge Interstitial%ffhh_land = Model%huge Interstitial%ffhh_water = Model%huge - Interstitial%fh2 = clear_val + Interstitial%fh2 = Model%clear_val Interstitial%fh2_ice = Model%huge Interstitial%fh2_land = Model%huge Interstitial%fh2_water = Model%huge @@ -1410,42 +1173,42 @@ subroutine gfs_interstitial_reset (Interstitial, Model) Interstitial%ffmm_ice = Model%huge Interstitial%ffmm_land = Model%huge Interstitial%ffmm_water = Model%huge - Interstitial%fm10 = clear_val + Interstitial%fm10 = Model%clear_val Interstitial%fm10_ice = Model%huge Interstitial%fm10_land = Model%huge Interstitial%fm10_water = Model%huge - Interstitial%frland = clear_val - Interstitial%fscav = clear_val - Interstitial%fswtr = clear_val - Interstitial%gabsbdlw = clear_val - Interstitial%gabsbdlw_ice = clear_val - Interstitial%gabsbdlw_land = clear_val - Interstitial%gabsbdlw_water = clear_val - Interstitial%gamma = clear_val - Interstitial%gamq = clear_val - Interstitial%gamt = clear_val - Interstitial%gasvmr = clear_val - Interstitial%gflx = clear_val - Interstitial%gflx_ice = clear_val - Interstitial%gflx_land = clear_val - Interstitial%gflx_water = clear_val - Interstitial%gwdcu = clear_val - Interstitial%gwdcv = clear_val - Interstitial%zvfun = clear_val - Interstitial%hffac = clear_val - Interstitial%hflxq = clear_val + Interstitial%frland = Model%clear_val + Interstitial%fscav = Model%clear_val + Interstitial%fswtr = Model%clear_val + Interstitial%gabsbdlw = Model%clear_val + Interstitial%gabsbdlw_ice = Model%clear_val + Interstitial%gabsbdlw_land = Model%clear_val + Interstitial%gabsbdlw_water = Model%clear_val + Interstitial%gamma = Model%clear_val + Interstitial%gamq = Model%clear_val + Interstitial%gamt = Model%clear_val + Interstitial%gasvmr = Model%clear_val + Interstitial%gflx = Model%clear_val + Interstitial%gflx_ice = Model%clear_val + Interstitial%gflx_land = Model%clear_val + Interstitial%gflx_water = Model%clear_val + Interstitial%gwdcu = Model%clear_val + Interstitial%gwdcv = Model%clear_val + Interstitial%zvfun = Model%clear_val + Interstitial%hffac = Model%clear_val + Interstitial%hflxq = Model%clear_val Interstitial%hflx_ice = Model%huge Interstitial%hflx_land = Model%huge Interstitial%hflx_water = Model%huge - Interstitial%htlwc = clear_val - Interstitial%htlw0 = clear_val - Interstitial%htswc = clear_val - Interstitial%htsw0 = clear_val + Interstitial%htlwc = Model%clear_val + Interstitial%htlw0 = Model%clear_val + Interstitial%htswc = Model%clear_val + Interstitial%htsw0 = Model%clear_val Interstitial%dry = .false. Interstitial%idxday = 0 Interstitial%icy = .false. Interstitial%lake = .false. - Interstitial%lndp_vgf = clear_val + Interstitial%lndp_vgf = Model%clear_val Interstitial%ocean = .false. Interstitial%islmsk = 0 Interstitial%islmsk_cice = 0 @@ -1461,210 +1224,211 @@ subroutine gfs_interstitial_reset (Interstitial, Model) Interstitial%mbota = 0 Interstitial%mtopa = 0 Interstitial%nday = 0 - Interstitial%oa4 = clear_val - Interstitial%oc = clear_val - Interstitial%olyr = clear_val - Interstitial%plvl = clear_val - Interstitial%plyr = clear_val - Interstitial%prnum = clear_val - Interstitial%qlyr = clear_val - Interstitial%prcpmp = clear_val + Interstitial%oa4 = Model%clear_val + Interstitial%oc = Model%clear_val + Interstitial%olyr = Model%clear_val + Interstitial%plvl = Model%clear_val + Interstitial%plyr = Model%clear_val + Interstitial%prnum = Model%clear_val + Interstitial%qlyr = Model%clear_val + Interstitial%prcpmp = Model%clear_val Interstitial%qss_ice = Model%huge Interstitial%qss_land = Model%huge Interstitial%qss_water = Model%huge - Interstitial%raddt = clear_val - Interstitial%raincd = clear_val - Interstitial%raincs = clear_val - Interstitial%rainmcadj = clear_val - Interstitial%rainp = clear_val - Interstitial%rb = clear_val + Interstitial%raddt = Model%clear_val + Interstitial%raincd = Model%clear_val + Interstitial%raincs = Model%clear_val + Interstitial%rainmcadj = Model%clear_val + Interstitial%rainp = Model%clear_val + Interstitial%rb = Model%clear_val Interstitial%rb_ice = Model%huge Interstitial%rb_land = Model%huge Interstitial%rb_water = Model%huge - Interstitial%rhc = clear_val - Interstitial%runoff = clear_val - Interstitial%save_q = clear_val - Interstitial%save_t = clear_val - Interstitial%save_tcp = clear_val - Interstitial%save_u = clear_val - Interstitial%save_v = clear_val - Interstitial%sbsno = clear_val - Interstitial%scmpsw%uvbfc = clear_val - Interstitial%scmpsw%uvbf0 = clear_val - Interstitial%scmpsw%nirbm = clear_val - Interstitial%scmpsw%nirdf = clear_val - Interstitial%scmpsw%visbm = clear_val - Interstitial%scmpsw%visdf = clear_val - Interstitial%sfcalb = clear_val - Interstitial%sigma = clear_val - Interstitial%sigmaf = clear_val - Interstitial%sigmafrac = clear_val - Interstitial%sigmatot = clear_val - Interstitial%snowc = clear_val - Interstitial%snohf = clear_val - Interstitial%snowmt = clear_val - Interstitial%stress = clear_val + Interstitial%rhc = Model%clear_val + Interstitial%runoff = Model%clear_val + Interstitial%save_q = Model%clear_val + Interstitial%save_t = Model%clear_val + Interstitial%save_tcp = Model%clear_val + Interstitial%save_u = Model%clear_val + Interstitial%save_v = Model%clear_val + Interstitial%sbsno = Model%clear_val + Interstitial%scmpsw%uvbfc = Model%clear_val + Interstitial%scmpsw%uvbf0 = Model%clear_val + Interstitial%scmpsw%nirbm = Model%clear_val + Interstitial%scmpsw%nirdf = Model%clear_val + Interstitial%scmpsw%visbm = Model%clear_val + Interstitial%scmpsw%visdf = Model%clear_val + Interstitial%sfcalb = Model%clear_val + Interstitial%sigma = Model%clear_val + Interstitial%sigmaf = Model%clear_val + Interstitial%sigmafrac = Model%clear_val + Interstitial%sigmatot = Model%clear_val + Interstitial%snowc = Model%clear_val + Interstitial%snohf = Model%clear_val + Interstitial%snowmt = Model%clear_val + Interstitial%stress = Model%clear_val Interstitial%stress_ice = Model%huge Interstitial%stress_land = Model%huge Interstitial%stress_water = Model%huge - Interstitial%theta = clear_val + Interstitial%theta = Model%clear_val Interstitial%tkeh = 0 - Interstitial%tlvl = clear_val - Interstitial%tlyr = clear_val + Interstitial%tlvl = Model%clear_val + Interstitial%tlyr = Model%clear_val Interstitial%tprcp_ice = Model%huge Interstitial%tprcp_land = Model%huge Interstitial%tprcp_water = Model%huge - Interstitial%trans = clear_val - Interstitial%tseal = clear_val - Interstitial%tsfa = clear_val + Interstitial%trans = Model%clear_val + Interstitial%tseal = Model%clear_val + Interstitial%tsfa = Model%clear_val Interstitial%tsfc_water = Model%huge - Interstitial%tsfg = clear_val + Interstitial%tsfg = Model%clear_val Interstitial%tsurf_ice = Model%huge Interstitial%tsurf_land = Model%huge Interstitial%tsurf_water = Model%huge - Interstitial%ud_mf = clear_val + Interstitial%ud_mf = Model%clear_val Interstitial%uustar_ice = Model%huge Interstitial%uustar_land = Model%huge Interstitial%uustar_water = Model%huge - Interstitial%vdftra = clear_val - Interstitial%vegf1d = clear_val - Interstitial%wcbmax = clear_val + Interstitial%vdftra = Model%clear_val + Interstitial%vegf1d = Model%clear_val + Interstitial%wcbmax = Model%clear_val Interstitial%wind = Model%huge - Interstitial%work1 = clear_val - Interstitial%work2 = clear_val - Interstitial%work3 = clear_val - Interstitial%xcosz = clear_val - Interstitial%xlai1d = clear_val - Interstitial%xmu = clear_val - Interstitial%z01d = clear_val - Interstitial%zt1d = clear_val - Interstitial%ztmax_ice = clear_val - Interstitial%ztmax_land = clear_val - Interstitial%ztmax_water = clear_val + Interstitial%work1 = Model%clear_val + Interstitial%work2 = Model%clear_val + Interstitial%work3 = Model%clear_val + Interstitial%xcosz = Model%clear_val + Interstitial%xlai1d = Model%clear_val + Interstitial%xmu = Model%clear_val + Interstitial%z01d = Model%clear_val + Interstitial%zt1d = Model%clear_val + Interstitial%ztmax_ice = Model%clear_val + Interstitial%ztmax_land = Model%clear_val + Interstitial%ztmax_water = Model%clear_val ! RRTMGP if (Model%do_RRTMGP) then - Interstitial%tracer = clear_val - Interstitial%tv_lay = clear_val - Interstitial%relhum = clear_val - Interstitial%qs_lay = clear_val - Interstitial%q_lay = clear_val - Interstitial%deltaZ = clear_val - Interstitial%deltaZc = clear_val - Interstitial%deltaP = clear_val - Interstitial%p_lev = clear_val - Interstitial%p_lay = clear_val - Interstitial%t_lev = clear_val - Interstitial%t_lay = clear_val - Interstitial%cloud_overlap_param = clear_val - Interstitial%precip_overlap_param = clear_val - Interstitial%fluxlwUP_allsky = clear_val - Interstitial%fluxlwDOWN_allsky = clear_val - Interstitial%fluxlwUP_clrsky = clear_val - Interstitial%fluxlwDOWN_clrsky = clear_val - Interstitial%fluxswUP_allsky = clear_val - Interstitial%fluxswDOWN_allsky = clear_val - Interstitial%fluxswUP_clrsky = clear_val - Interstitial%fluxswDOWN_clrsky = clear_val - Interstitial%aerosolslw = clear_val - Interstitial%aerosolssw = clear_val - Interstitial%precip_frac = clear_val - Interstitial%cld_cnv_frac = clear_val - Interstitial%cnv_cloud_overlap_param = clear_val - Interstitial%cld_cnv_lwp = clear_val - Interstitial%cld_cnv_reliq = clear_val - Interstitial%cld_cnv_iwp = clear_val - Interstitial%cld_cnv_reice = clear_val - Interstitial%cld_pbl_lwp = clear_val - Interstitial%cld_pbl_reliq = clear_val - Interstitial%cld_pbl_iwp = clear_val - Interstitial%cld_pbl_reice = clear_val - Interstitial%flxprf_lw%upfxc = clear_val - Interstitial%flxprf_lw%dnfxc = clear_val - Interstitial%flxprf_lw%upfx0 = clear_val - Interstitial%flxprf_lw%dnfx0 = clear_val - Interstitial%flxprf_sw%upfxc = clear_val - Interstitial%flxprf_sw%dnfxc = clear_val - Interstitial%flxprf_sw%upfx0 = clear_val - Interstitial%flxprf_sw%dnfx0 = clear_val - Interstitial%sfc_emiss_byband = clear_val - Interstitial%sec_diff_byband = clear_val - Interstitial%sfc_alb_nir_dir = clear_val - Interstitial%sfc_alb_nir_dif = clear_val - Interstitial%sfc_alb_uvvis_dir = clear_val - Interstitial%sfc_alb_uvvis_dif = clear_val - Interstitial%toa_src_sw = clear_val - Interstitial%toa_src_lw = clear_val - Interstitial%vmr_o2 = clear_val - Interstitial%vmr_h2o = clear_val - Interstitial%vmr_o3 = clear_val - Interstitial%vmr_ch4 = clear_val - Interstitial%vmr_n2o = clear_val - Interstitial%vmr_co2 = clear_val + Interstitial%tracer = Model%clear_val + Interstitial%tv_lay = Model%clear_val + Interstitial%relhum = Model%clear_val + Interstitial%qs_lay = Model%clear_val + Interstitial%q_lay = Model%clear_val + Interstitial%deltaZ = Model%clear_val + Interstitial%deltaZc = Model%clear_val + Interstitial%deltaP = Model%clear_val + Interstitial%p_lev = Model%clear_val + Interstitial%p_lay = Model%clear_val + Interstitial%t_lev = Model%clear_val + Interstitial%t_lay = Model%clear_val + Interstitial%cloud_overlap_param = Model%clear_val + Interstitial%precip_overlap_param = Model%clear_val + Interstitial%fluxlwUP_allsky = Model%clear_val + Interstitial%fluxlwDOWN_allsky = Model%clear_val + Interstitial%fluxlwUP_clrsky = Model%clear_val + Interstitial%fluxlwDOWN_clrsky = Model%clear_val + Interstitial%fluxswUP_allsky = Model%clear_val + Interstitial%fluxswDOWN_allsky = Model%clear_val + Interstitial%fluxswUP_clrsky = Model%clear_val + Interstitial%fluxswDOWN_clrsky = Model%clear_val + Interstitial%aerosolslw = Model%clear_val + Interstitial%aerosolssw = Model%clear_val + Interstitial%precip_frac = Model%clear_val + Interstitial%cld_cnv_frac = Model%clear_val + Interstitial%cnv_cloud_overlap_param = Model%clear_val + Interstitial%cld_cnv_lwp = Model%clear_val + Interstitial%cld_cnv_reliq = Model%clear_val + Interstitial%cld_cnv_iwp = Model%clear_val + Interstitial%cld_cnv_reice = Model%clear_val + Interstitial%cld_pbl_lwp = Model%clear_val + Interstitial%cld_pbl_reliq = Model%clear_val + Interstitial%cld_pbl_iwp = Model%clear_val + Interstitial%cld_pbl_reice = Model%clear_val + Interstitial%flxprf_lw%upfxc = Model%clear_val + Interstitial%flxprf_lw%dnfxc = Model%clear_val + Interstitial%flxprf_lw%upfx0 = Model%clear_val + Interstitial%flxprf_lw%dnfx0 = Model%clear_val + Interstitial%flxprf_sw%upfxc = Model%clear_val + Interstitial%flxprf_sw%dnfxc = Model%clear_val + Interstitial%flxprf_sw%upfx0 = Model%clear_val + Interstitial%flxprf_sw%dnfx0 = Model%clear_val + Interstitial%sfc_emiss_byband = Model%clear_val + Interstitial%sec_diff_byband = Model%clear_val + Interstitial%sfc_alb_nir_dir = Model%clear_val + Interstitial%sfc_alb_nir_dif = Model%clear_val + Interstitial%sfc_alb_uvvis_dir = Model%clear_val + Interstitial%sfc_alb_uvvis_dif = Model%clear_val + Interstitial%toa_src_sw = Model%clear_val + Interstitial%toa_src_lw = Model%clear_val + Interstitial%vmr_o2 = Model%clear_val + Interstitial%vmr_h2o = Model%clear_val + Interstitial%vmr_o3 = Model%clear_val + Interstitial%vmr_ch4 = Model%clear_val + Interstitial%vmr_n2o = Model%clear_val + Interstitial%vmr_co2 = Model%clear_val end if ! UGWP common - Interstitial%tau_mtb = clear_val - Interstitial%tau_ogw = clear_val - Interstitial%tau_tofd = clear_val - Interstitial%tau_ngw = clear_val - Interstitial%tau_oss = clear_val - Interstitial%dudt_mtb = clear_val - Interstitial%dudt_tms = clear_val - Interstitial%zmtb = clear_val - Interstitial%zlwb = clear_val - Interstitial%zogw = clear_val - Interstitial%zngw = clear_val + Interstitial%tau_mtb = Model%clear_val + Interstitial%tau_ogw = Model%clear_val + Interstitial%tau_tofd = Model%clear_val + Interstitial%tau_ngw = Model%clear_val + Interstitial%tau_oss = Model%clear_val + Interstitial%dudt_mtb = Model%clear_val + Interstitial%dudt_tms = Model%clear_val + Interstitial%zmtb = Model%clear_val + Interstitial%zlwb = Model%clear_val + Interstitial%zogw = Model%clear_val + Interstitial%zngw = Model%clear_val ! CIRES UGWP v1 if (Model%ldiag_ugwp .or. Model%do_ugwp_v0 .or. Model%do_ugwp_v0_nst_only & .or. Model%do_ugwp_v1) then - Interstitial%dudt_ngw = clear_val - Interstitial%dvdt_ngw = clear_val - Interstitial%dtdt_ngw = clear_val - Interstitial%kdis_ngw = clear_val + Interstitial%dudt_ngw = Model%clear_val + Interstitial%dvdt_ngw = Model%clear_val + Interstitial%dtdt_ngw = Model%clear_val + Interstitial%kdis_ngw = Model%clear_val end if !-- GSL drag suite if (Model%gwd_opt==3 .or. Model%gwd_opt==33 .or. & Model%gwd_opt==2 .or. Model%gwd_opt==22 ) then - Interstitial%varss = clear_val - Interstitial%ocss = clear_val - Interstitial%oa4ss = clear_val - Interstitial%clxss = clear_val + Interstitial%varss = Model%clear_val + Interstitial%ocss = Model%clear_val + Interstitial%oa4ss = Model%clear_val + Interstitial%clxss = Model%clear_val end if ! ! Allocate arrays that are conditional on physics choices if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson & .or. Model%imp_physics == Model%imp_physics_tempo .or. Model%imp_physics == Model%imp_physics_nssl & ) then - Interstitial%graupelmp = clear_val - Interstitial%icemp = clear_val - Interstitial%rainmp = clear_val - Interstitial%snowmp = clear_val + Interstitial%graupelmp = Model%clear_val + Interstitial%icemp = Model%clear_val + Interstitial%rainmp = Model%clear_val + Interstitial%snowmp = Model%clear_val else if (Model%imp_physics == Model%imp_physics_mg) then - Interstitial%ncgl = clear_val - Interstitial%ncpr = clear_val - Interstitial%ncps = clear_val - Interstitial%qgl = clear_val - Interstitial%qrn = clear_val - Interstitial%qsnw = clear_val - Interstitial%qlcn = clear_val - Interstitial%qicn = clear_val - Interstitial%w_upi = clear_val - Interstitial%cf_upi = clear_val - Interstitial%cnv_mfd = clear_val - Interstitial%cnv_dqldt = clear_val - Interstitial%clcn = clear_val - Interstitial%cnv_fice = clear_val - Interstitial%cnv_ndrop = clear_val - Interstitial%cnv_nice = clear_val + Interstitial%ncgl = Model%clear_val + Interstitial%ncpr = Model%clear_val + Interstitial%ncps = Model%clear_val + Interstitial%qgl = Model%clear_val + Interstitial%qrn = Model%clear_val + Interstitial%qsnw = Model%clear_val + Interstitial%qlcn = Model%clear_val + Interstitial%qicn = Model%clear_val + Interstitial%w_upi = Model%clear_val + Interstitial%cf_upi = Model%clear_val + Interstitial%cnv_mfd = Model%clear_val + Interstitial%cnv_dqldt = Model%clear_val + Interstitial%clcn = Model%clear_val + Interstitial%cnv_fice = Model%clear_val + Interstitial%cnv_ndrop = Model%clear_val + Interstitial%cnv_nice = Model%clear_val end if - if (Model%lsm == Model%lsm_noahmp) then - Interstitial%t2mmp = clear_val - Interstitial%q2mp = clear_val + if (Model%lsm == Model%ilsm_noahmp) then + Interstitial%t2mmp = Model%clear_val + Interstitial%q2mp = Model%clear_val end if + ! DJS - Move max_hourly_reset, ext_diag_thompson_reset, and fullradar_diag to GFS_control_type? ! Set flag for resetting maximum hourly output fields Interstitial%max_hourly_reset = mod(Model%kdt-1, nint(Model%avg_max_length/Model%dtp)) == 0 ! Use same logic in UFS to reset Thompson extended diagnostics @@ -1681,7 +1445,7 @@ subroutine gfs_interstitial_reset (Interstitial, Model) ! ! CCPP suite simulator if (Model%do_ccpp_suite_sim) then - Interstitial%active_phys_tend = clear_val + Interstitial%active_phys_tend = Model%clear_val endif end subroutine gfs_interstitial_reset diff --git a/scm/src/CCPP_typedefs.meta b/scm/src/CCPP_typedefs.meta index b266544bc..7a0c32136 100644 --- a/scm/src/CCPP_typedefs.meta +++ b/scm/src/CCPP_typedefs.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = GFS_interstitial_type type = ddt - dependencies = + dependencies_path = ../../ccpp/physics/physics + dependencies = hooks/machine.F,photochem/module_ozphys.F90 + dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f [ccpp-arg-table] name = GFS_interstitial_type @@ -240,63 +242,63 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys -[clouds(:,:,1)] +[clouds(:,:,index_for_cloud_fraction_in_cloud_data_array)] standard_name = total_cloud_fraction long_name = layer total cloud fraction units = frac dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[clouds(:,:,2)] +[clouds(:,:,index_for_cloud_liquid_water_path_in_cloud_data_array)] standard_name = cloud_liquid_water_path long_name = layer cloud liquid water path units = g m-2 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[clouds(:,:,3)] +[clouds(:,:,index_for_cloud_liquid_effective_radius_in_cloud_data_array)] standard_name = mean_effective_radius_for_liquid_cloud long_name = mean effective radius for liquid cloud units = um dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[clouds(:,:,4)] +[clouds(:,:,index_for_cloud_ice_water_path_in_cloud_data_array)] standard_name = cloud_ice_water_path long_name = layer cloud ice water path units = g m-2 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[clouds(:,:,5)] +[clouds(:,:,index_for_cloud_ice_effective_radius_in_cloud_data_array)] standard_name = mean_effective_radius_for_ice_cloud long_name = mean effective radius for ice cloud units = um dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[clouds(:,:,6)] +[clouds(:,:,index_for_cloud_rain_water_path_in_cloud_data_array)] standard_name = cloud_rain_water_path long_name = cloud rain water path units = g m-2 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[clouds(:,:,7)] +[clouds(:,:,index_for_cloud_rain_effective_radius_in_cloud_data_array)] standard_name = mean_effective_radius_for_rain_drop long_name = mean effective radius for rain drop units = um dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[clouds(:,:,8)] +[clouds(:,:,index_for_cloud_snow_water_path_in_cloud_data_array)] standard_name = cloud_snow_water_path long_name = cloud snow water path units = g m-2 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[clouds(:,:,9)] +[clouds(:,:,index_for_cloud_snow_effective_radius_in_cloud_data_array)] standard_name = mean_effective_radius_for_snow_flake long_name = mean effective radius for snow flake units = um @@ -768,21 +770,21 @@ dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation,number_of_aerosol_output_fields_for_longwave_radiation) type = real kind = kind_phys -[faerlw(:,:,:,1)] +[faerlw(:,:,:,index_for_aerosol_optical_depth_in_aer_array)] standard_name = aerosol_optical_depth_for_longwave_bands_01_16 long_name = aerosol optical depth for longwave bands 01-16 units = none dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation) type = real kind = kind_phys -[faerlw(:,:,:,2)] +[faerlw(:,:,:,index_for_aerosol_single_scattering_albedo_in_aer_array)] standard_name = aerosol_single_scattering_albedo_for_longwave_bands_01_16 long_name = aerosol single scattering albedo for longwave bands 01-16 units = frac dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation) type = real kind = kind_phys -[faerlw(:,:,:,3)] +[faerlw(:,:,:,index_for_aerosol_asymmetry_parameter_in_aer_array)] standard_name = aerosol_asymmetry_parameter_for_longwave_bands_01_16 long_name = aerosol asymmetry parameter for longwave bands 01-16 units = none @@ -796,21 +798,21 @@ dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation,number_of_aerosol_output_fields_for_shortwave_radiation) type = real kind = kind_phys -[faersw(:,:,:,1)] +[faersw(:,:,:,index_for_aerosol_optical_depth_in_aer_array)] standard_name = aerosol_optical_depth_for_shortwave_bands_01_16 long_name = aerosol optical depth for shortwave bands 01-16 units = none dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation) type = real kind = kind_phys -[faersw(:,:,:,2)] +[faersw(:,:,:,index_for_aerosol_single_scattering_albedo_in_aer_array)] standard_name = aerosol_single_scattering_albedo_for_shortwave_bands_01_16 long_name = aerosol single scattering albedo for shortwave bands 01-16 units = frac dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation) type = real kind = kind_phys -[faersw(:,:,:,3)] +[faersw(:,:,:,index_for_aerosol_asymmetry_parameter_in_aer_array)] standard_name = aerosol_asymmetry_parameter_for_shortwave_bands_01_16 long_name = aerosol asymmetry parameter for shortwave bands 01-16 units = none @@ -1009,70 +1011,70 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys -[gasvmr(:,:,1)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_co2_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_co2 long_name = volume mixing ratio co2 units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,2)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_n2o_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_n2o long_name = volume mixing ratio no2 units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,3)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_ch4_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_ch4 long_name = volume mixing ratio ch4 units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,4)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_o2_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_o2 long_name = volume mixing ratio o2 units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,5)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_co_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_co long_name = volume mixing ratio co units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,6)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_cfc11_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_cfc11 long_name = volume mixing ratio cfc11 units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,7)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_cfc12_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_cfc12 long_name = volume mixing ratio cfc12 units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,8)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_cfc22_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_cfc22 long_name = volume mixing ratio cfc22 units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,9)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_ccl4_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_ccl4 long_name = volume mixing ratio ccl4 units = m3 m-3 dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[gasvmr(:,:,10)] +[gasvmr(:,:,index_for_volume_mixing_ratio_of_cfc113_in_gasvmr_array)] standard_name = volume_mixing_ratio_of_cfc113 long_name = volume mixing ratio cfc113 units = m3 m-3 @@ -1249,12 +1251,6 @@ units = flag dimensions = (horizontal_dimension) type = integer -[itc] - standard_name = index_of_first_chemical_tracer_for_convection - long_name = index of first chemical tracer transported/scavenged by convection - units = index - dimensions = () - type = integer [wet] standard_name = flag_nonzero_wet_surface_fraction long_name = flag indicating presence of some ocean or lake surface area fraction @@ -1315,12 +1311,6 @@ units = index dimensions = (horizontal_dimension,3) type = integer -[mg3_as_mg2] - standard_name = flag_mg3_as_mg2 - long_name = flag for controlling prep for Morrison-Gettelman microphysics - units = flag - dimensions = () - type = logical [mtopa] standard_name = model_layer_number_at_cloud_top long_name = vertical indices for low, middle and high cloud tops @@ -1351,72 +1341,12 @@ type = real kind = kind_phys active = (control_for_microphysics_scheme == identifier_for_morrison_gettelman_microphysics_scheme) -[ncstrac] - standard_name = number_of_tracers_for_CS - long_name = number of convectively transported tracers in Chikira-Sugiyama deep convection scheme - units = count - dimensions = () - type = integer [nday] standard_name = daytime_points_dimension long_name = daytime points dimension units = count dimensions = () type = integer -[nn] - standard_name = number_of_tracers_for_convective_transport - long_name = number of tracers for convective transport - units = count - dimensions = () - type = integer -[nsamftrac] - standard_name = number_of_tracers_for_samf - long_name = number of tracers for scale-aware mass flux schemes - units = count - dimensions = () - type = integer -[nscav] - standard_name = number_of_tracers_scavenged - long_name = number of tracers scavenged - units = count - dimensions = () - type = integer -[ntcwx] - standard_name = index_for_liquid_cloud_condensate_vertical_diffusion_tracer - long_name = index for liquid cloud condensate in the vertically diffused tracer array - units = index - dimensions = () - type = integer -[ntiwx] - standard_name = index_for_ice_cloud_condensate_vertical_diffusion_tracer - long_name = index for ice cloud condensate in the vertically diffused tracer array - units = index - dimensions = () - type = integer -[ntrwx] - standard_name = index_for_rain_water_vertical_diffusion_tracer - long_name = tracer index for rain water in the vertically diffused tracer array - units = index - dimensions = () - type = integer -[ntk] - standard_name = index_for_turbulent_kinetic_energy_convective_transport_tracer - long_name = index for turbulent kinetic energy in the convectively transported tracer array - units = index - dimensions = () - type = integer -[ntkev] - standard_name = index_for_turbulent_kinetic_energy_vertical_diffusion_tracer - long_name = index for turbulent kinetic energy in the vertically diffused tracer array - units = index - dimensions = () - type = integer -[nvdiff] - standard_name = number_of_vertical_diffusion_tracers - long_name = number of tracers to diffuse vertically - units = count - dimensions = () - type = integer [oa4] standard_name = asymmetry_of_subgrid_orography long_name = asymmetry of subgrid height_above_mean_sea_level @@ -1462,18 +1392,6 @@ dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys -[otspt] - standard_name = flag_convective_tracer_transport - long_name = flag to enable tracer transport by updrafts/downdrafts[(:,1)] or subsidence [(:,2)] - units = flag - dimensions = (number_of_tracers_plus_one,2) - type = logical -[otsptflag] - standard_name = flag_convective_tracer_transport_interstitial - long_name = flag for interstitial tracer transport - units = flag - dimensions = (number_of_tracers) - type = logical [plvl] standard_name = air_pressure_at_interface_for_radiation_in_hPa long_name = air pressure at vertical interface for radiation calculation @@ -1674,13 +1592,6 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[rho1] - standard_name = air_density_at_lowest_model_layer - long_name = air density at lowest model layer - units = kg m-3 - dimensions = (horizontal_dimension) - type = real - kind = kind_phys [runoff] standard_name = surface_runoff_flux long_name = surface runoff flux @@ -1792,28 +1703,28 @@ dimensions = (horizontal_dimension,number_of_components_for_surface_albedo) type = real kind = kind_phys -[sfcalb(:,1)] +[sfcalb(:,index_for_surface_albedo_due_to_near_ir_direct)] standard_name = surface_albedo_due_to_near_IR_direct long_name = surface albedo due to near IR direct beam units = frac dimensions = (horizontal_dimension) type = real kind = kind_phys -[sfcalb(:,2)] +[sfcalb(:,index_for_surface_albedo_due_to_near_ir_diffuse)] standard_name = surface_albedo_due_to_near_IR_diffused long_name = surface albedo due to near IR diffused beam units = frac dimensions = (horizontal_dimension) type = real kind = kind_phys -[sfcalb(:,3)] +[sfcalb(:,index_for_surface_albedo_due_to_uv_and_vis_direct)] standard_name = surface_albedo_due_to_UV_and_VIS_direct long_name = surface albedo due to UV+VIS direct beam units = frac dimensions = (horizontal_dimension) type = real kind = kind_phys -[sfcalb(:,4)] +[sfcalb(:,index_for_surface_albedo_due_to_uv_and_vis_diffuse)] standard_name = surface_albedo_due_to_UV_and_VIS_diffused long_name = surface albedo due to UV+VIS diffused beam units = frac @@ -1961,18 +1872,6 @@ units = index dimensions = () type = integer -[tracers_total] - standard_name = number_of_total_tracers - long_name = total number of tracers - units = count - dimensions = () - type = integer -[trans_aero] - standard_name = flag_for_aerosol_convective_transport_and_PBL_diffusion - long_name = flag for aerosol convective transport and PBL diffusion - units = flag - dimensions = () - type = logical [tseal] standard_name = surface_skin_temperature_for_nsst long_name = ocean surface skin temperature @@ -2413,7 +2312,7 @@ dimensions = (horizontal_dimension,vertical_interface_dimension) type = real kind = kind_phys - active = (flag_for_rrtmgp_radiation_scheme) + active = (flag_for_rrtmgp_radiation_scheme .and. flag_for_output_of_tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep_assuming_clear_sky) [fluxlwDOWN_clrsky] standard_name = RRTMGP_lw_flux_profile_downward_clrsky long_name = RRTMGP downward longwave clr-sky flux profile @@ -2421,7 +2320,7 @@ dimensions = (horizontal_dimension,vertical_interface_dimension) type = real kind = kind_phys - active = (flag_for_rrtmgp_radiation_scheme) + active = (flag_for_rrtmgp_radiation_scheme .and. flag_for_output_of_tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep_assuming_clear_sky) [fluxswUP_allsky] standard_name = RRTMGP_sw_flux_profile_upward_allsky long_name = RRTMGP upward shortwave all-sky flux profile @@ -2445,7 +2344,7 @@ dimensions = (horizontal_dimension,vertical_interface_dimension) type = real kind = kind_phys - active = (flag_for_rrtmgp_radiation_scheme) + active = (flag_for_rrtmgp_radiation_scheme .and. flag_for_output_of_tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep_assuming_clear_sky) [fluxswDOWN_clrsky] standard_name = RRTMGP_sw_flux_profile_downward_clrsky long_name = RRTMGP downward shortwave clr-sky flux profile @@ -2453,7 +2352,7 @@ dimensions = (horizontal_dimension,vertical_interface_dimension) type = real kind = kind_phys - active = (flag_for_rrtmgp_radiation_scheme) + active = (flag_for_rrtmgp_radiation_scheme .and. flag_for_output_of_tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep_assuming_clear_sky) [flxprf_lw] standard_name = RRTMGP_lw_fluxes long_name = lw fluxes total sky / csk and up / down at levels @@ -2753,21 +2652,3 @@ type = real kind = kind_phys active = (flag_for_CCPP_suite_simulator) - -######################################################################## -[ccpp-table-properties] - name = CCPP_typedefs - type = module - relative_path = ../../ccpp/physics/physics - dependencies = hooks/machine.F,photochem/module_ozphys.F90 - dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f - -[ccpp-arg-table] - name = CCPP_typedefs - type = module -[GFS_interstitial_type] - standard_name = GFS_interstitial_type - long_name = definition of type GFS_interstitial_type - units = DDT - dimensions = () - type = GFS_interstitial_type diff --git a/scm/src/CMakeLists.txt b/scm/src/CMakeLists.txt index b0c68574d..1210d9518 100644 --- a/scm/src/CMakeLists.txt +++ b/scm/src/CMakeLists.txt @@ -1,69 +1,202 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.18) project(scm VERSION 5.0.0 LANGUAGES C Fortran) set(PROJECT "CCPP-SCM") -#################################################################### -# Begin CCPP prebuild step # -#################################################################### +#------------------------------------------------------------------------------ +# +# Set where the CCPP Framework lives +# +#------------------------------------------------------------------------------ +get_filename_component(TEST_ROOT "${CMAKE_SOURCE_DIR}" DIRECTORY) +get_filename_component(CCPP_ROOT "${TEST_ROOT}" DIRECTORY) + +#------------------------------------------------------------------------------ +# +# Create list of SCHEME_FILES and HOST_FILES +# Paths should be relative to CMAKE_SOURCE_DIR (this file's directory) +# +#------------------------------------------------------------------------------ +LIST(APPEND SCHEME_FILES "${CCPP_ROOT}/ccpp/config/scheme_files.txt") +LIST(APPEND HOST_FILES "${CCPP_ROOT}/ccpp/config/host_files.txt") + +#------------------------------------------------------------------------------ +# +# Which Suites are we building with? +# +#------------------------------------------------------------------------------ if(DEFINED CCPP_SUITES) - if (${CCPP_SUITES} MATCHES "ALL") - message("Calling CCPP code generator (ccpp_prebuild.py) for all available suites ...") - else() - set(_ccpp_suites_arg "--suites=${CCPP_SUITES}") - message("Calling CCPP code generator (ccpp_prebuild.py) for suites ${_ccpp_suites_arg} ...") - endif() + set(suite_string ${CCPP_SUITES}) + message(STATUS "Calling CCPP code generator (ccpp_capgen.py) for suites ${suite_string} ...") unset(CCPP_SUITES CACHE) else() execute_process( COMMAND scm/src/suite_info.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../.. + WORKING_DIRECTORY ${CCPP_ROOT} OUTPUT_VARIABLE suite_string OUTPUT_STRIP_TRAILING_WHITESPACE - ) + ) set(_ccpp_suites_arg "--suites=${suite_string}") - message("Calling CCPP code generator (ccpp_prebuild.py) for suites listed in scm/src/suite_info.py: ${_ccpp_suites_arg}.") + message(STATUS "Calling CCPP code generator (ccpp_capgen.py) for suites listed in scm/src/suite_info.py: ${_ccpp_suites_arg}.") endif() -# Run CCPP prebuild.py -message (STATUS "Running ccpp_prebuild.py for CCPP") -# Make the directories where the ccpp_prebuild.py script wants to write caps and make snippets -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ccpp/physics/physics) -if (NOT EXISTS "${CMAKE_SOURCE_DIR}/../../ccpp/framework/scripts/ccpp_prebuild.py") - message( FATAL_ERROR "ccpp_prebuild.py script does not exist, did you check out the code recursively?" ) + +#------------------------------------------------------------------------------ +# +# End of project-specific input +# +#------------------------------------------------------------------------------ + +# By default, no verbose output +SET(VERBOSITY 0 CACHE STRING "Verbosity level of output (default: 0)") +# By default, generated caps go in ccpp subdir +SET(CCPP_CAP_FILES "${CMAKE_BINARY_DIR}/ccpp" CACHE + STRING "Location of CCPP-generated cap files") + +SET(CCPP_FRAMEWORK ${CCPP_ROOT}/ccpp/framework/scripts) + +#------------------------------------------------------------------------------ +# CMake Modules +# Set the CMake module path +list(APPEND CMAKE_MODULE_PATH "${CCPP_FRAMEWORK}/cmake") +#------------------------------------------------------------------------------ +# Set OpenMP flags for C/C++/Fortran +if (OPENMP) + include(detect_openmp) + detect_openmp() + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") + message(STATUS "Enable OpenMP support for C/C++/Fortran compiler") +else(OPENMP) + message (STATUS "Disable OpenMP support for C/C++/Fortran compiler") endif() + +#------------------------------------------------------------------------------ +# +# Create metadata and source file lists from ${SCHEME_FILES} +# +#------------------------------------------------------------------------------ +FOREACH(FILE ${SCHEME_FILES}) + FILE(STRINGS ${FILE} FILENAMES) + LIST(APPEND SCHEME_FILENAMES ${FILENAMES}) + FOREACH(FILE ${SCHEME_FILENAMES}) + MATH(EXPR NSCHEME_FILES "${NSCHEME_FILES}+1") + ENDFOREACH(FILE) +ENDFOREACH(FILE) +# +MATH(EXPR FCOUNT 0) +FOREACH(FILE ${SCHEME_FILENAMES}) + # Set character seperator + MATH(EXPR FCOUNT "${FCOUNT}+1") + set(SEPERATOR "") + string(CONCAT SCHEME_FILENAME ${CCPP_ROOT} "/" ${FILE} ${SEPERATOR} ) + string(REGEX REPLACE "\n$" "" SCHEME_FILENAME "${SCHEME_FILENAME}") + list(APPEND SCHEME_SOURCE ${SCHEME_FILENAME}) + # Meta file list + string(REGEX REPLACE "\\.[^.]*$" ".meta" METADATA_FILE ${FILE}) + string(CONCAT METADATA_FILENAME ${CCPP_ROOT} "/" ${METADATA_FILE} ${SEPERATOR} ) + list(APPEND SCHEME_METADATA ${METADATA_FILENAME}) +ENDFOREACH(FILE) +string(REPLACE ";" "," SCHEME_METADATA "${SCHEME_METADATA}") + +#------------------------------------------------------------------------------ +# +# Create metadata and source file lists from ${HOST_FILES} +# +#------------------------------------------------------------------------------ +FOREACH(FILE ${HOST_FILES}) + FILE(STRINGS ${FILE} FILENAMES) + LIST(APPEND HOST_FILENAMES "${FILENAMES}") + FOREACH(FILE ${HOST_FILENAMES}) + MATH(EXPR NHOST_FILES "${NHOST_FILES}+1") + ENDFOREACH(FILE) +ENDFOREACH(FILE) +# +MATH(EXPR FCOUNT 0) +FOREACH(FILE ${HOST_FILENAMES}) + # Set character seperator + MATH(EXPR FCOUNT "${FCOUNT}+1") + set(SEPERATOR "") + string(CONCAT HOST_FILENAME ${CCPP_ROOT} "/" ${FILE} ${SEPERATOR} ) + list(APPEND HOST_SOURCE ${HOST_FILENAME}) + # + string(REGEX REPLACE "\\.[^.]*$" ".meta" METADATA_FILE ${FILE}) + string(CONCAT METADATA_FILENAME ${CCPP_ROOT} "/" ${METADATA_FILE} ${SEPERATOR} ) + list(APPEND HOST_METADATA ${METADATA_FILENAME}) +ENDFOREACH(FILE) +string(REPLACE ";" "," HOST_METADATA "${HOST_METADATA}") + +#------------------------------------------------------------------------------ +# +# Create SDF list from ${suite_string), which is provided via the command line, +# or comes from scm/src/suite_info.py +# +#------------------------------------------------------------------------------ +string(REPLACE "," ";" suite_string "${suite_string}") +set(suite_list ${suite_string}) +FOREACH(suite ${suite_list}) + list(APPEND SUITES "${CCPP_ROOT}/ccpp/suites/suite_${suite}.xml") +ENDFOREACH(suite) +string(REPLACE ";" "," SUITES "${SUITES}") + +#------------------------------------------------------------------------------ +# +# Run ccpp_capgen +# +#------------------------------------------------------------------------------ + +set(CAPGEN_CMD "${CCPP_FRAMEWORK}/ccpp_capgen.py") +list(APPEND CAPGEN_CMD "--host-files") +list(APPEND CAPGEN_CMD ${HOST_METADATA}) +list(APPEND CAPGEN_CMD "--scheme-files") +list(APPEND CAPGEN_CMD ${SCHEME_METADATA}) +list(APPEND CAPGEN_CMD "--suites") +list(APPEND CAPGEN_CMD "${SUITES}") +list(APPEND CAPGEN_CMD "--host-name") +list(APPEND CAPGEN_CMD "SCM") +list(APPEND CAPGEN_CMD "--output-root") +list(APPEND CAPGEN_CMD "${CCPP_CAP_FILES}") +list(APPEND CAPGEN_CMD "--kind-type") +list(APPEND CAPGEN_CMD "kind_phys=REAL64") +list(APPEND CAPGEN_CMD "--kind-type") +list(APPEND CAPGEN_CMD "kind_dyn=REAL64") +list(APPEND CAPGEN_CMD "--kind-type") +list(APPEND CAPGEN_CMD "kind_sngl_prec=REAL32") +list(APPEND CAPGEN_CMD "--kind-type") +list(APPEND CAPGEN_CMD "kind_dbl_prec=REAL64") +list(APPEND CAPGEN_CMD "--ccpp-cfgfile") +list(APPEND CAPGEN_CMD "${CCPP_ROOT}/ccpp/config/ccpp_capgen_config.py") if (${CMAKE_BUILD_TYPE} MATCHES "Debug") - execute_process( - COMMAND ccpp/framework/scripts/ccpp_prebuild.py --config=ccpp/config/ccpp_prebuild_config.py ${_ccpp_suites_arg} --builddir=${CMAKE_CURRENT_BINARY_DIR} --debug --verbose - OUTPUT_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.out - ERROR_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.err - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../.. - RESULT_VARIABLE return_code - ) -else() - execute_process( - COMMAND ccpp/framework/scripts/ccpp_prebuild.py --config=ccpp/config/ccpp_prebuild_config.py ${_ccpp_suites_arg} --builddir=${CMAKE_CURRENT_BINARY_DIR} - OUTPUT_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.out - ERROR_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.err - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../.. - RESULT_VARIABLE return_code - ) + list(APPEND CAPGEN_CMD "--debug") endif() +while (VERBOSITY GREATER 0) + list(APPEND CAPGEN_CMD "--verbose") + MATH(EXPR VERBOSITY "${VERBOSITY} - 1") +endwhile () +string(REPLACE ";" " " CAPGEN_STRING "${CAPGEN_CMD}") + +MESSAGE(STATUS "Running: ${CAPGEN_STRING}") +EXECUTE_PROCESS(COMMAND ${CAPGEN_CMD} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE CAPGEN_OUT ERROR_VARIABLE CAPGEN_OUT RESULT_VARIABLE RES) +MESSAGE(STATUS "${CAPGEN_OUT}") +if (RES EQUAL 0) + MESSAGE(STATUS "CCPP cap generation completed") +else(RES EQUAL 0) + MESSAGE(FATAL_ERROR "CCPP cap generation FAILED: result = ${RES}") +endif(RES EQUAL 0) + +MESSAGE(STATUS "CCPP capgen step complete") -# Check return code from CCPP prebuild.py -if(return_code EQUAL 0) - message (STATUS "CCPP prebuild step completed successfully") -else(return_code EQUAL 0) - message (FATAL_ERROR "CCPP prebuild step failed, check ccpp_prebuild.out/ccpp_prebuild.err") -endif(return_code EQUAL 0) #################################################################### -# End CCPP prebuild step # +# End CCPP capgen step # #################################################################### ENABLE_LANGUAGE(Fortran) include(CMakeForceCompiler) +include(GNUInstallDirs) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/../../CMakeModules/Modules) @@ -71,35 +204,10 @@ find_package(NetCDF REQUIRED COMPONENTS C Fortran) find_package(bacio REQUIRED) find_package(sp REQUIRED) find_package(w3emc REQUIRED) -find_package(MPI REQUIRED) -if(NOT MPI_Fortran_HAVE_F08_MODULE) - message(FATAL_ERROR "MPI_F08 Required") -endif() - -find_package(MPI REQUIRED Fortran) -if(NOT MPI_Fortran_HAVE_F08_MODULE) - message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface") -endif() - -message(STATUS "MPI Include Path: ${MPI_INCLUDE_PATH}") -message(STATUS "MPI Libraries: ${MPI_LIBRARIES}") SET(CCPP_FRAMEWORK_SRC ${CMAKE_SOURCE_DIR}/../../ccpp/framework) SET(CCPP_PHYSICS_SRC ${CMAKE_SOURCE_DIR}/../../ccpp/physics) -# Use rpaths on MacOSX -set(CMAKE_MACOSX_RPATH 1) - -#------------------------------------------------------------------------------ -# Set a default build type if none was specified -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'Release' as none was specified.") - set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) - - # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") -endif() - INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/ccpp/framework/src) INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/ccpp/physics) include_directories(${MPI_Fortran_INCLUDE_PATH}) @@ -145,22 +253,17 @@ set(RRTMGP_32BIT OFF CACHE BOOL "Enable 32BIT (single precision arithmetic in #------------------------------------------------------------------------------ # Set compile options -if (32BIT) - add_definitions(-DSINGLE_PREC) - add_definitions(-DRTE_USE_SP) -endif() - if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ggdb -fbacktrace -cpp -fcray-pointer -ffree-line-length-none -fno-range-check") - + if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz") endif() - + if(NOT 32BIT) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fdefault-double-8") endif() - + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0") @@ -168,7 +271,7 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") endif() - + set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) @@ -176,11 +279,11 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -sox -align array64byte -qno-opt-dynamic-align") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qno-opt-dynamic-align -sox -fp-model source") - + if(NOT 32BIT) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64") endif() - + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -ftrapuv") @@ -203,42 +306,11 @@ elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=core-avx-i") endif() endif() - + set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) - -elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "NVHPC") - if(ENABLE_NVIDIA_OPENACC MATCHES "true") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -acc -Minfo=accel") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -acc -Minfo=accel") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - endif() - - if(NOT 32BIT) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") - endif() - - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") - set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") - endif() - - set(MPI_C_COMPILER mpicc) - set(MPI_CXX_COMPILER mpicxx) - set(MPI_Fortran_COMPILER mpif90) - - set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) - set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) - set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) - set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) - else (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") message (FATAL_ERROR "This program has only been compiled with gfortran and ifort. If another compiler is needed, the appropriate flags must be added in ${CMAKE_SOURCE_DIR}/CMakeLists.txt") endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") @@ -246,17 +318,15 @@ endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") #------------------------------------------------------------------------------ # Set flag for 32bit dynamics build - if(32BIT) message(STATUS "Compile CCPP slow physics with 64-bit precision, fast physics with 32-bit precision") add_definitions(-DOVERLOAD_R4) if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") - # set(CMAKE_Fortran_FLAGS_PHYSICS "-real-size 64 -no-prec-div -no-prec-sqrt") + set(CMAKE_Fortran_FLAGS_PHYSICS "-real-size 64 -no-prec-div -no-prec-sqrt") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") - # set(CMAKE_Fortran_FLAGS_PHYSICS "-fdefault-real-8 -fdefault-double-8") + set(CMAKE_Fortran_FLAGS_PHYSICS "-fdefault-real-8 -fdefault-double-8") endif() set(CMAKE_Fortran_FLAGS_DYNAMICS "") - else() message(STATUS "Compile CCPP physics with 64-bit precision") remove_definitions(-DOVERLOAD_R8) @@ -313,7 +383,9 @@ SET(scm_source_files scm.F90 scm_output.F90 ) -ADD_EXECUTABLE(scm ${scm_source_files} ccpp_static_api.F90) +include(${CCPP_ROOT}/scm/bin/ccpp/physics/CCPP_CAPS.cmake) +include(${CCPP_ROOT}/scm/src/CCPP_STATIC_API.cmake) +ADD_EXECUTABLE(scm ${scm_source_files} ${API}) if(OPENMP) TARGET_LINK_LIBRARIES(scm PUBLIC OpenMP::OpenMP_Fortran) @@ -326,11 +398,12 @@ TARGET_LINK_LIBRARIES(scm ccpp_framework) TARGET_LINK_LIBRARIES(scm ccpp_physics) SET_TARGET_PROPERTIES(scm PROPERTIES - COMPILE_FLAGS "${CMAKE_Fortran_FLAGS}" - LINK_FLAGS "${CMAKE_Fortran_FLAGS}") + COMPILE_FLAGS "${CMAKE_Fortran_FLAGS}" + LINK_FLAGS "${CMAKE_Fortran_FLAGS}") ADD_CUSTOM_COMMAND( TARGET scm POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/run_scm.py ${CMAKE_CURRENT_BINARY_DIR}/run_scm.py) + diff --git a/scm/src/GFS_typedefs.F90 b/scm/src/GFS_typedefs.F90 index 5f8af233d..a6157f19f 100644 --- a/scm/src/GFS_typedefs.F90 +++ b/scm/src/GFS_typedefs.F90 @@ -28,38 +28,15 @@ module GFS_typedefs integer, parameter :: naux3dmax = 20 !< maximum number of auxiliary 3d arrays in output (for debugging) integer, parameter :: dfi_radar_max_intervals = 4 !< Number of radar-derived temperature tendency and/or convection suppression intervals. Do not change. + integer, parameter :: dfi_radar_max_intervals_plus_one = 5 real(kind=kind_phys), parameter :: limit_unspecified = 1e12 !< special constant for "namelist value was not provided" in radar-derived temperature tendency limit range integer, parameter :: no_tracer = -99 -!> \section arg_table_GFS_typedefs -!! \htmlinclude GFS_typedefs.html -!! - - !--- version of physics + !--- version of physics character(len=64) :: phys_version = 'v2021 UFS PHYSICS' - !--- parameter constants used for default initializations - real(kind=kind_phys), parameter :: zero = 0.0_kind_phys - !real(kind=kind_phys), parameter :: huge = 9.9692099683868690E36 ! NetCDF float FillValue - real(kind=kind_phys), parameter :: clear_val = zero - !real(kind=kind_phys), parameter :: clear_val = -9.9999e80 - real(kind=kind_phys), parameter :: rann_init = 0.6_kind_phys - real(kind=kind_phys), parameter :: cn_one = 1._kind_phys - real(kind=kind_phys), parameter :: cn_100 = 100._kind_phys - real(kind=kind_phys), parameter :: cn_th = 1000._kind_phys - real(kind=kind_phys), parameter :: cn_hr = 3600._kind_phys - - ! optional extra top layer on top of low ceiling models - ! this parameter was originally defined in the radiation driver - ! (and is still for standard non-CCPP builds), but is required - ! here for CCPP to allocate arrays used for the interstitial - ! calculations previously in GFS_{physics,radiation}_driver.F90 - ! LTP=0: no extra top layer - integer, parameter :: LTP = 0 ! no extra top layer - !integer, parameter :: LTP = 1 ! add an extra top layer - !---------------- ! Data Containers !---------------- @@ -254,6 +231,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: snodi (:) => null() !< snow depth over ice real (kind=kind_phys), pointer :: weasdi (:) => null() !< weasd over ice real (kind=kind_phys), pointer :: hprime (:,:) => null() !< orographic metrics + integer :: isubgrd_sigma = 1 !< Index into hprime for standard deviation of subgrid orography real (kind=kind_phys), pointer :: dust12m_in (:,:,:) => null() !< fengsha dust input real (kind=kind_phys), pointer :: emi_in (:,:) => null() !< anthropogenic background input real (kind=kind_phys), pointer :: smoke_RRFS(:,:,:) => null() !< RRFS fire input hourly @@ -515,7 +493,7 @@ module GFS_typedefs ! RRTMGP real (kind=kind_phys), pointer :: fluxlwUP_jac(:,:) => null() !< RRTMGP Jacobian of upward longwave all-sky flux - real (kind=kind_phys), pointer :: htrlw(:,:) => null() !< RRTMGP updated LW heating rate + real (kind=kind_phys), pointer :: hrlw(:,:) => null() !< RRTMGP updated LW heating rate real (kind=kind_phys), pointer :: tsfc_radtime(:) => null() !< RRTMGP surface temperature on radiation timestep real (kind=kind_phys), pointer :: fluxlwUP_radtime(:,:) => null() !< RRTMGP upward longwave all-sky flux profile real (kind=kind_phys), pointer :: fluxlwDOWN_radtime(:,:) => null() !< RRTMGP downward longwave all-sky flux profile @@ -686,6 +664,9 @@ module GFS_typedefs ! dtend_var_label ! Information about first dimension of dtidx !---------------------------------------------------------------- +!! \section arg_table_dtend_var_label +!! \htmlinclude dtend_var_label.html +!! type dtend_var_label character(len=20) :: name character(len=44) :: desc @@ -696,6 +677,9 @@ module GFS_typedefs ! dtend_process_label ! Information about second dimension of dtidx !---------------------------------------------------------------- +!! \section arg_table_dtend_process_label +!! \htmlinclude dtend_process_label.html +!! type dtend_process_label character(len=20) :: name character(len=44) :: desc @@ -713,6 +697,43 @@ module GFS_typedefs !! type GFS_control_type + !--- parameter constants used for default initializations + real(kind=kind_phys) :: zero !< default values for "zero" + real(kind=kind_phys) :: clear_val !< value for clear scene + real(kind=kind_phys) :: rann_init !< + integer :: LTP !< Optional extra top layer on top of low ceiling models + integer :: isfc_gfs !< Index for surface layer + + !--- Radiation configuration (see module_radiation_aerosols/clouds/gases/surface) + integer :: iaer_tau !< Index into aerosol optical property array for optical-depth (tau) + integer :: iaer_ssa !< Index into aerosol optical property array for single-scattering albedo (omega) + integer :: iaer_g !< Index into aerosol optical property array for asymmetry-paramter (g) + integer :: NF_CLDS !< Number of radiatively active cloud properties (species*2(double-moment)) + integer :: icld_cfrac !< Index into cloud property array for cloud fraction + integer :: icld_lwp !< Index into cloud property array for liquid water path + integer :: icld_reliq !< Index into cloud property array for liquid effective radii + integer :: icld_iwp !< Index into cloud property array for ice water path + integer :: icld_reice !< Index into cloud property array for ice effective radii + integer :: icld_rwp !< Index into cloud property array for rain water path + integer :: icld_rerain !< Index into cloud property array for rain effective radii + integer :: icld_swp !< Index into cloud property array for snow water path + integer :: icld_resnow !< Index into cloud property array for snow effective radii + integer :: NF_VGAS !< Number of radiatively active gases + integer :: igas_co2 !< Index into active gases array for carbon-dioxide + integer :: igas_n2o !< Index into active gases array for nitrous oxide + integer :: igas_ch4 !< Index into active gases array for methane + integer :: igas_o2 !< Index into active gases array for oxygen + integer :: igas_co !< Index into active gases array for carbon-monoxide + integer :: igas_cfc11 !< Index into active gases array for CFC 11 + integer :: igas_cfc12 !< Index into active gases array for CFC 12 + integer :: igas_cfc22 !< Index into active gases array for CFC 22 + integer :: igas_ccl4 !< Index into active gases array for CCl 4 + integer :: igas_cfc113 !< Index into active gases array for CFC 113 + integer :: ialb_nirdir !< Index into surface albedo/flux array for direct near-IR band + integer :: ialb_nirdif !< Index into surface albedo/flux array for diffuse near-IR band + integer :: ialb_uvvisdir !< Index into surface albedo/flux array for direct uv-visible band + integer :: ialb_uvvisdif !< Index into surface albedo/flux array for diffure uv-visible band + ! integer :: me !< MPI rank designator integer :: master !< MPI rank of master atmosphere processor type(MPI_Comm) :: communicator !< MPI communicator @@ -763,10 +784,8 @@ module GFS_typedefs integer :: lonr !< number of global points in x-dir (i) along the equator integer :: latr !< number of global points in y-dir (j) along any meridian integer :: tile_num - integer :: nblks !< for explicit data blocking: number of blocks - integer, pointer :: blksz(:) !< for explicit data blocking: block sizes of all blocks - integer :: ncols !< total number of columns for all blocks - ! + integer :: ncols !< total number of columns + integer, pointer :: chunks(:) !< chunk extent (horizontal_loop_extent) integer :: nchunks !< number of chunks of an array that are used in the CCPP run phase integer, pointer :: chunk_begin(:) !< first indices of chunks of an array for the CCPP run phase integer, pointer :: chunk_end(:) !< last indices of chunks of an array for the CCPP run phase @@ -812,8 +831,8 @@ module GFS_typedefs real(kind=kind_phys) :: dtf !< dynamics timestep in seconds real(kind=kind_phys) :: frain !< ratio of dynamics timestep to physics timestep integer :: nscyc !< trigger for surface data cycling - integer :: nszero !< trigger for zeroing diagnostic buckets - integer :: idat(1:8) !< initialization date and time + integer :: nszero !< trigger for Model%zeroing diagnostic buckets + integer :: idat(8) !< initialization date and time !< (yr, mon, day, t-zone, hr, min, sec, mil-sec) integer :: idate(4) !< initial date with different size and ordering !< (hr, mon, day, yr) @@ -1005,7 +1024,7 @@ module GFS_typedefs real(kind=kind_phys) :: tcrf ! integer :: num_dfi_radar !< number of timespans with radar-prescribed temperature tendencies - real (kind=kind_phys) :: fh_dfi_radar(1+dfi_radar_max_intervals) !< begin+end of timespans to receive radar-prescribed temperature tendencies + real (kind=kind_phys) :: fh_dfi_radar(dfi_radar_max_intervals_plus_one) !< begin+end of timespans to receive radar-prescribed temperature tendencies logical :: do_cap_suppress !< enable convection suppression in GF scheme if fh_dfi_radar is specified real (kind=kind_phys) :: radar_tten_limits(2) !< radar_tten values outside this range (min,max) are discarded integer :: ix_dfi_radar(dfi_radar_max_intervals) = -1 !< Index within dfi_radar_tten of each timespan (-1 means "none") @@ -1077,9 +1096,9 @@ module GFS_typedefs !--- land/surface model parameters integer :: lsm !< flag for land surface model lsm=1 for noah lsm - integer :: lsm_noah=1 !< flag for NOAH land surface model - integer :: lsm_noahmp=2 !< flag for NOAH land surface model - integer :: lsm_ruc=3 !< flag for RUC land surface model + integer :: ilsm_noah=1 !< flag for NOAH land surface model + integer :: ilsm_noahmp=2 !< flag for NOAH land surface model + integer :: ilsm_ruc=3 !< flag for RUC land surface model integer :: lsoil !< number of soil layers integer :: ivegsrc !< ivegsrc = 0 => USGS, !< ivegsrc = 1 => IGBP (20 category) @@ -1122,7 +1141,7 @@ module GFS_typedefs integer :: iopt_rad !radiation transfer (1->gap=f(3d,cosz); 2->gap=0; 3->gap=1-fveg) integer :: iopt_alb !snow surface albedo (1->bats; 2->class) integer :: iopt_snf !rainfall & snowfall (1-jordan91; 2->bats; 3->noah) - integer :: iopt_tbot !lower boundary of soil temperature (1->zero-flux; 2->noah) + integer :: iopt_tbot !lower boundary of soil temperature (1->Model%zero-flux; 2->noah) integer :: iopt_stc !snow/soil temperature time scheme (only layer 1) integer :: iopt_trs !thermal roughness scheme (1-z0h=z0m; 2-czil; 3-ec;4-kb inversed) integer :: iopt_diag !2m t/q diagnostic approach (1->external GFS sfc_diag 2->original NoahMP 2-title 3->NoahMP @@ -1285,6 +1304,9 @@ module GFS_typedefs !< (used if mstrat=.true.) real(kind=kind_phys) :: crtrh(3) !< critical relative humidity at the surface !< PBL top and at the top of the atmosphere + integer :: crtrh_sfc = 1 !< Index into crtrh for surface + integer :: crtrh_pbl = 2 !< Index into crtrh for PBL top + integer :: crtrh_toa = 3 !< Index into crtrh for TOA real(kind=kind_phys) :: dlqf(2) !< factor for cloud condensate detrainment !< from cloud edges for RAS real(kind=kind_phys) :: psauras(2) !< [in] auto conversion coeff from ice to snow in ras @@ -1369,12 +1391,12 @@ module GFS_typedefs integer :: lsea integer :: nstf_name(5) !< flag 0 for no nst 1 for uncoupled nst and 2 for coupled NST !< nstf_name contains the NSST related parameters - !< nstf_name(1) : 0 = NSSTM off, 1 = NSSTM on but uncoupled - !< 2 = NSSTM on and coupled - !< nstf_name(2) : 1 = NSSTM spin up on, 0 = NSSTM spin up off - !< nstf_name(3) : 1 = NSST analysis on, 0 = NSSTM analysis off - !< nstf_name(4) : zsea1 in mm - !< nstf_name(5) : zsea2 in mm + integer :: instf_opt !< nstf_name(instf_opt) : 0 = NSSTM off, 1 = NSSTM on but uncoupled + !< 2 = NSSTM on and coupled + integer :: instf_spinup !< nstf_name(instf_spinup) : 1 = NSSTM spin up on, 0 = NSSTM spin up off + integer :: instf_anlys !< nstf_name(instf_anlys) : 1 = NSST analysis on, 0 = NSSTM analysis off + integer :: instf_zs1_lb !< nstf_name(instf_zs1_lb) : lower bounds (in mm) + integer :: instf_zs2_ub !< nstf_name(instf_zs2_ub) : upper bounds (in mm) !--- fractional grid logical :: frac_grid !< flag for fractional grid logical :: frac_ice !< flag for fractional ice when fractional grid is not in use @@ -1477,6 +1499,24 @@ module GFS_typedefs real(kind=kind_phys), pointer :: spp_prt_list(:) real(kind=kind_phys), pointer :: spp_stddev_cutoff(:) +!--- physics tracer configuration parameters + integer :: nvdiff + integer :: nn + logical :: mg3_as_mg2 + integer :: itc + integer :: ntk + integer :: ntkev + integer :: tracers_total + logical , pointer :: otspt(:,:) => null() + logical , pointer :: otsptflag(:) => null() + integer :: ncstrac + integer :: nsamftrac + integer :: ntcwx + integer :: ntiwx + integer :: ntrwx + logical :: trans_aero + + !--- tracer handling character(len=32), pointer :: tracer_names(:) !< array of initialized tracers from dynamic core integer :: ntrac !< number of tracers @@ -1575,6 +1615,7 @@ module GFS_typedefs integer :: ndche !< tracer index for last diagnostic chemical tracer logical, pointer :: ntdiag(:) => null() !< array to control diagnostics for chemical tracers real(kind=kind_phys), pointer :: fscav(:) => null() !< array of aerosol scavenging coefficients + integer :: nscav !--- derived totals for phy_f*d integer :: ntot2d !< total number of variables for phyf2d @@ -1662,7 +1703,7 @@ module GFS_typedefs logical :: restart !< flag whether this is a coldstart (.false.) or a warmstart/restart (.true.) logical :: lsm_cold_start logical :: hydrostatic !< flag whether this is a hydrostatic or non-hydrostatic run - integer :: jdat(1:8) !< current forecast date and time + integer :: jdat(8) !< current forecast date and time !< (yr, mon, day, t-zone, hr, min, sec, mil-sec) integer :: imn !< initial forecast month real(kind=kind_phys) :: julian !< julian day using midnight of January 1 of forecast year as initial epoch @@ -1732,7 +1773,7 @@ module GFS_typedefs integer :: iactive_u ! integer :: iactive_v ! integer :: iactive_q ! - + contains procedure :: init => control_initialize procedure :: init_chemistry => control_chemistry_initialize @@ -2316,28 +2357,28 @@ subroutine statein_create (Statein, Model) allocate (Statein%prsi (IM,Model%levs+1)) allocate (Statein%prsik (IM,Model%levs+1)) - Statein%phii = clear_val - Statein%prsi = clear_val - Statein%prsik = clear_val + Statein%phii = Model%clear_val + Statein%prsi = Model%clear_val + Statein%prsik = Model%clear_val !--- layer geopotential and pressures allocate (Statein%phil (IM,Model%levs)) allocate (Statein%prsl (IM,Model%levs)) allocate (Statein%prslk (IM,Model%levs)) - Statein%phil = clear_val - Statein%prsl = clear_val - Statein%prslk = clear_val + Statein%phil = Model%clear_val + Statein%prsl = Model%clear_val + Statein%prslk = Model%clear_val !--- shared radiation and physics variables allocate (Statein%vvl (IM,Model%levs)) allocate (Statein%tgrs (IM,Model%levs)) - Statein%vvl = clear_val - Statein%tgrs = clear_val + Statein%vvl = Model%clear_val + Statein%tgrs = Model%clear_val ! stochastic physics SKEB variable allocate (Statein%diss_est(IM,Model%levs)) - Statein%diss_est= clear_val + Statein%diss_est= Model%clear_val !--- physics only variables allocate (Statein%pgr (IM)) allocate (Statein%ugrs (IM,Model%levs)) @@ -2352,18 +2393,18 @@ subroutine statein_create (Statein, Model) allocate (Statein%def_3 (IM,Model%levs)) !SA-3D-TKE-end - Statein%qgrs = clear_val - Statein%pgr = clear_val - Statein%ugrs = clear_val - Statein%vgrs = clear_val + Statein%qgrs = Model%clear_val + Statein%pgr = Model%clear_val + Statein%ugrs = Model%clear_val + Statein%vgrs = Model%clear_val !SA-3D-TKE - Statein%def_1 = clear_val - Statein%def_2 = clear_val - Statein%def_3 = clear_val + Statein%def_1 = Model%clear_val + Statein%def_2 = Model%clear_val + Statein%def_3 = Model%clear_val !SA-3D-TKE-end if(Model%lightning_threat) then - Statein%wgrs = clear_val + Statein%wgrs = Model%clear_val endif !--- soil state variables - for soil SPPT - sfc-perts, mgehne @@ -2371,9 +2412,9 @@ subroutine statein_create (Statein, Model) allocate (Statein%stc (IM,Model%lsoil)) allocate (Statein%slc (IM,Model%lsoil)) - Statein%smc = clear_val - Statein%stc = clear_val - Statein%slc = clear_val + Statein%smc = Model%clear_val + Statein%stc = Model%clear_val + Statein%slc = Model%clear_val end subroutine statein_create @@ -2396,10 +2437,10 @@ subroutine stateout_create (Stateout, Model) allocate (Stateout%gt0 (IM,Model%levs)) allocate (Stateout%gq0 (IM,Model%levs,Model%ntrac)) - Stateout%gu0 = clear_val - Stateout%gv0 = clear_val - Stateout%gt0 = clear_val - Stateout%gq0 = clear_val + Stateout%gu0 = Model%clear_val + Stateout%gv0 = Model%clear_val + Stateout%gt0 = Model%clear_val + Stateout%gq0 = Model%clear_val end subroutine stateout_create @@ -2479,62 +2520,62 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%emis_ice (IM)) allocate (Sfcprop%emis_wat (IM)) - Sfcprop%slmsk = clear_val - Sfcprop%oceanfrac = clear_val - Sfcprop%landfrac = clear_val - Sfcprop%vegtype_frac = clear_val - Sfcprop%soiltype_frac = clear_val - Sfcprop%lakefrac = clear_val - Sfcprop%lakedepth = clear_val + Sfcprop%slmsk = Model%clear_val + Sfcprop%oceanfrac = Model%clear_val + Sfcprop%landfrac = Model%clear_val + Sfcprop%vegtype_frac = Model%clear_val + Sfcprop%soiltype_frac = Model%clear_val + Sfcprop%lakefrac = Model%clear_val + Sfcprop%lakedepth = Model%clear_val - Sfcprop%use_lake_model = zero + Sfcprop%use_lake_model = Model%zero if(Model%lkm > 0) then if(Model%iopt_lake==Model%iopt_lake_clm) then - Sfcprop%clm_lakedepth = clear_val + Sfcprop%clm_lakedepth = Model%clear_val else if(Model%iopt_lake==Model%iopt_lake_flake) then - Sfcprop%h_ML = clear_val - Sfcprop%t_ML = clear_val - Sfcprop%t_mnw = clear_val - Sfcprop%h_talb = clear_val - Sfcprop%t_talb = clear_val - Sfcprop%t_bot1 = clear_val - Sfcprop%t_bot2 = clear_val - Sfcprop%c_t = clear_val + Sfcprop%h_ML = Model%clear_val + Sfcprop%t_ML = Model%clear_val + Sfcprop%t_mnw = Model%clear_val + Sfcprop%h_talb = Model%clear_val + Sfcprop%t_talb = Model%clear_val + Sfcprop%t_bot1 = Model%clear_val + Sfcprop%t_bot2 = Model%clear_val + Sfcprop%c_t = Model%clear_val endif - Sfcprop%T_snow = clear_val - Sfcprop%T_ice = clear_val + Sfcprop%T_snow = Model%clear_val + Sfcprop%T_ice = Model%clear_val endif - Sfcprop%tsfc = clear_val - Sfcprop%usfco = clear_val - Sfcprop%vsfco = clear_val - Sfcprop%tsfco = clear_val - Sfcprop%tsfcl = clear_val - Sfcprop%tisfc = clear_val - Sfcprop%tiice = clear_val - Sfcprop%snowd = clear_val - Sfcprop%zorl = clear_val - Sfcprop%zorlw = clear_val - Sfcprop%zorll = clear_val - Sfcprop%zorli = clear_val - Sfcprop%zorlwav = clear_val - Sfcprop%fice = clear_val - Sfcprop%snodl = clear_val - Sfcprop%weasdl = clear_val - Sfcprop%snodi = clear_val - Sfcprop%weasdi = clear_val - Sfcprop%hprime = clear_val - Sfcprop%dust12m_in= clear_val - Sfcprop%emi_in = clear_val - Sfcprop%smoke_RRFS= clear_val - Sfcprop%smoke2d_RRFS= clear_val - Sfcprop%albdirvis_lnd = clear_val - Sfcprop%albdirnir_lnd = clear_val - Sfcprop%albdifvis_lnd = clear_val - Sfcprop%albdifnir_lnd = clear_val - Sfcprop%emis_lnd = clear_val - Sfcprop%emis_ice = clear_val - Sfcprop%emis_wat = clear_val + Sfcprop%tsfc = Model%clear_val + Sfcprop%usfco = Model%clear_val + Sfcprop%vsfco = Model%clear_val + Sfcprop%tsfco = Model%clear_val + Sfcprop%tsfcl = Model%clear_val + Sfcprop%tisfc = Model%clear_val + Sfcprop%tiice = Model%clear_val + Sfcprop%snowd = Model%clear_val + Sfcprop%zorl = Model%clear_val + Sfcprop%zorlw = Model%clear_val + Sfcprop%zorll = Model%clear_val + Sfcprop%zorli = Model%clear_val + Sfcprop%zorlwav = Model%clear_val + Sfcprop%fice = Model%clear_val + Sfcprop%snodl = Model%clear_val + Sfcprop%weasdl = Model%clear_val + Sfcprop%snodi = Model%clear_val + Sfcprop%weasdi = Model%clear_val + Sfcprop%hprime = Model%clear_val + Sfcprop%dust12m_in= Model%clear_val + Sfcprop%emi_in = Model%clear_val + Sfcprop%smoke_RRFS= Model%clear_val + Sfcprop%smoke2d_RRFS= Model%clear_val + Sfcprop%albdirvis_lnd = Model%clear_val + Sfcprop%albdirnir_lnd = Model%clear_val + Sfcprop%albdifvis_lnd = Model%clear_val + Sfcprop%albdifnir_lnd = Model%clear_val + Sfcprop%emis_lnd = Model%clear_val + Sfcprop%emis_ice = Model%clear_val + Sfcprop%emis_wat = Model%clear_val !--- In (radiation only) allocate (Sfcprop%snoalb (IM)) @@ -2545,13 +2586,13 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%facsf (IM)) allocate (Sfcprop%facwf (IM)) - Sfcprop%snoalb = clear_val - Sfcprop%alvsf = clear_val - Sfcprop%alnsf = clear_val - Sfcprop%alvwf = clear_val - Sfcprop%alnwf = clear_val - Sfcprop%facsf = clear_val - Sfcprop%facwf = clear_val + Sfcprop%snoalb = Model%clear_val + Sfcprop%alvsf = Model%clear_val + Sfcprop%alnsf = Model%clear_val + Sfcprop%alvwf = Model%clear_val + Sfcprop%alnwf = Model%clear_val + Sfcprop%facsf = Model%clear_val + Sfcprop%facwf = Model%clear_val !--- physics surface props !--- In @@ -2574,37 +2615,37 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%hflx (IM)) allocate (Sfcprop%qss (IM)) - Sfcprop%slope = zero - Sfcprop%slope_save = zero - Sfcprop%shdmin = clear_val - Sfcprop%shdmax = clear_val - Sfcprop%tg3 = clear_val - Sfcprop%vfrac = clear_val - Sfcprop%vtype = zero - Sfcprop%vtype_save = zero - Sfcprop%stype = zero - Sfcprop%stype_save = zero - Sfcprop%scolor = zero - Sfcprop%scolor_save = zero - Sfcprop%uustar = clear_val - Sfcprop%oro = clear_val - Sfcprop%oro_uf = clear_val - Sfcprop%evap = clear_val - Sfcprop%hflx = clear_val - Sfcprop%qss = clear_val + Sfcprop%slope = Model%zero + Sfcprop%slope_save = Model%zero + Sfcprop%shdmin = Model%clear_val + Sfcprop%shdmax = Model%clear_val + Sfcprop%tg3 = Model%clear_val + Sfcprop%vfrac = Model%clear_val + Sfcprop%vtype = Model%zero + Sfcprop%vtype_save = Model%zero + Sfcprop%stype = Model%zero + Sfcprop%stype_save = Model%zero + Sfcprop%scolor = Model%zero + Sfcprop%scolor_save = Model%zero + Sfcprop%uustar = Model%clear_val + Sfcprop%oro = Model%clear_val + Sfcprop%oro_uf = Model%clear_val + Sfcprop%evap = Model%clear_val + Sfcprop%hflx = Model%clear_val + Sfcprop%qss = Model%clear_val !--- In/Out allocate (Sfcprop%hice (IM)) allocate (Sfcprop%weasd (IM)) allocate (Sfcprop%sncovr (IM)) allocate (Sfcprop%sncovr_ice (IM)) - if (Model%use_cice_alb .or. Model%lsm == Model%lsm_ruc) then + if (Model%use_cice_alb .or. Model%lsm == Model%ilsm_ruc) then allocate (Sfcprop%albdirvis_ice (IM)) allocate (Sfcprop%albdifvis_ice (IM)) allocate (Sfcprop%albdirnir_ice (IM)) allocate (Sfcprop%albdifnir_ice (IM)) endif - if (Model%lsm == Model%lsm_ruc) then + if (Model%lsm == Model%ilsm_ruc) then allocate (Sfcprop%sfalb_lnd (IM)) allocate (Sfcprop%sfalb_ice (IM)) allocate (Sfcprop%sfalb_lnd_bck (IM)) @@ -2619,39 +2660,39 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%smc (IM,Model%lsoil)) allocate (Sfcprop%stc (IM,Model%lsoil)) - Sfcprop%hice = clear_val - Sfcprop%weasd = clear_val - Sfcprop%sncovr = clear_val - Sfcprop%sncovr_ice = clear_val - if (Model%use_cice_alb .or. Model%lsm == Model%lsm_ruc) then - Sfcprop%albdirvis_ice = clear_val - Sfcprop%albdifvis_ice = clear_val - Sfcprop%albdirnir_ice = clear_val - Sfcprop%albdifnir_ice = clear_val + Sfcprop%hice = Model%clear_val + Sfcprop%weasd = Model%clear_val + Sfcprop%sncovr = Model%clear_val + Sfcprop%sncovr_ice = Model%clear_val + if (Model%use_cice_alb .or. Model%lsm == Model%ilsm_ruc) then + Sfcprop%albdirvis_ice = Model%clear_val + Sfcprop%albdifvis_ice = Model%clear_val + Sfcprop%albdirnir_ice = Model%clear_val + Sfcprop%albdifnir_ice = Model%clear_val endif - if (Model%lsm == Model%lsm_ruc) then - Sfcprop%sfalb_lnd = clear_val - Sfcprop%sfalb_ice = clear_val - Sfcprop%sfalb_lnd_bck = clear_val + if (Model%lsm == Model%ilsm_ruc) then + Sfcprop%sfalb_lnd = Model%clear_val + Sfcprop%sfalb_ice = Model%clear_val + Sfcprop%sfalb_lnd_bck = Model%clear_val endif - Sfcprop%canopy = clear_val - Sfcprop%ffmm = clear_val - Sfcprop%ffhh = clear_val - Sfcprop%f10m = clear_val - Sfcprop%tprcp = clear_val - Sfcprop%srflag = clear_val - Sfcprop%slc = clear_val - Sfcprop%smc = clear_val - Sfcprop%stc = clear_val + Sfcprop%canopy = Model%clear_val + Sfcprop%ffmm = Model%clear_val + Sfcprop%ffhh = Model%clear_val + Sfcprop%f10m = Model%clear_val + Sfcprop%tprcp = Model%clear_val + Sfcprop%srflag = Model%clear_val + Sfcprop%slc = Model%clear_val + Sfcprop%smc = Model%clear_val + Sfcprop%stc = Model%clear_val !--- Out allocate (Sfcprop%t2m (IM)) allocate (Sfcprop%th2m(IM)) allocate (Sfcprop%q2m (IM)) - Sfcprop%t2m = clear_val - Sfcprop%th2m = clear_val - Sfcprop%q2m = clear_val + Sfcprop%t2m = Model%clear_val + Sfcprop%th2m = Model%clear_val + Sfcprop%q2m = Model%clear_val if (Model%nstf_name(1) > 0) then allocate (Sfcprop%tref (IM)) @@ -2673,55 +2714,55 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%dt_cool(IM)) allocate (Sfcprop%qrain (IM)) - Sfcprop%tref = zero - Sfcprop%z_c = zero - Sfcprop%c_0 = zero - Sfcprop%c_d = zero - Sfcprop%w_0 = zero - Sfcprop%w_d = zero - Sfcprop%xt = zero - Sfcprop%xs = zero - Sfcprop%xu = zero - Sfcprop%xv = zero - Sfcprop%xz = zero - Sfcprop%zm = zero - Sfcprop%xtts = zero - Sfcprop%xzts = zero - Sfcprop%d_conv = zero - Sfcprop%ifd = zero - Sfcprop%dt_cool = zero - Sfcprop%qrain = zero + Sfcprop%tref = Model%zero + Sfcprop%z_c = Model%zero + Sfcprop%c_0 = Model%zero + Sfcprop%c_d = Model%zero + Sfcprop%w_0 = Model%zero + Sfcprop%w_d = Model%zero + Sfcprop%xt = Model%zero + Sfcprop%xs = Model%zero + Sfcprop%xu = Model%zero + Sfcprop%xv = Model%zero + Sfcprop%xz = Model%zero + Sfcprop%zm = Model%zero + Sfcprop%xtts = Model%zero + Sfcprop%xzts = Model%zero + Sfcprop%d_conv = Model%zero + Sfcprop%ifd = Model%zero + Sfcprop%dt_cool = Model%zero + Sfcprop%qrain = Model%zero endif - if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp .or. Model%lsm == Model%lsm_ruc) then + if (Model%lsm == Model%ilsm_noah .or. Model%lsm == Model%ilsm_noahmp .or. Model%lsm == Model%ilsm_ruc) then allocate (Sfcprop%xlaixy (IM)) - Sfcprop%xlaixy = clear_val + Sfcprop%xlaixy = Model%clear_val else allocate (Sfcprop%xlaixy (0)) end if - if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp) then + if (Model%lsm == Model%ilsm_noah .or. Model%lsm == Model%ilsm_noahmp) then allocate (Sfcprop%rca (IM)) - Sfcprop%rca = clear_val + Sfcprop%rca = Model%clear_val else allocate (Sfcprop%rca (0)) end if - if (Model%lsm == Model%lsm_ruc .or. Model%lsm == Model%lsm_noahmp .or. & + if (Model%lsm == Model%ilsm_ruc .or. Model%lsm == Model%ilsm_noahmp .or. & (Model%lkm>0 .and. Model%iopt_lake==Model%iopt_lake_clm)) then allocate (Sfcprop%raincprv (IM)) allocate (Sfcprop%rainncprv (IM)) - Sfcprop%raincprv = clear_val - Sfcprop%rainncprv = clear_val - if (Model%lsm == Model%lsm_ruc .or. Model%lsm == Model%lsm_noahmp) then + Sfcprop%raincprv = Model%clear_val + Sfcprop%rainncprv = Model%clear_val + if (Model%lsm == Model%ilsm_ruc .or. Model%lsm == Model%ilsm_noahmp) then allocate (Sfcprop%iceprv (IM)) allocate (Sfcprop%snowprv (IM)) allocate (Sfcprop%graupelprv(IM)) - Sfcprop%iceprv = clear_val - Sfcprop%snowprv = clear_val - Sfcprop%graupelprv = clear_val + Sfcprop%iceprv = Model%clear_val + Sfcprop%snowprv = Model%clear_val + Sfcprop%graupelprv = Model%clear_val end if end if ! Noah MP allocate and init when used ! - if (Model%lsm == Model%lsm_noahmp ) then + if (Model%lsm == Model%ilsm_noahmp ) then allocate (Sfcprop%snowxy (IM)) allocate (Sfcprop%tvxy (IM)) @@ -2757,40 +2798,40 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%smoiseq (IM, Model%lsoil_lsm)) allocate (Sfcprop%zsnsoxy (IM, Model%lsnow_lsm_lbound:Model%lsoil_lsm)) - Sfcprop%snowxy = clear_val - Sfcprop%tvxy = clear_val - Sfcprop%tgxy = clear_val - Sfcprop%canicexy = clear_val - Sfcprop%canliqxy = clear_val - Sfcprop%eahxy = clear_val - Sfcprop%tahxy = clear_val - Sfcprop%cmxy = clear_val - Sfcprop%chxy = clear_val - Sfcprop%fwetxy = clear_val - Sfcprop%sneqvoxy = clear_val - Sfcprop%alboldxy = clear_val - Sfcprop%qsnowxy = clear_val - Sfcprop%wslakexy = clear_val - Sfcprop%zwtxy = clear_val - Sfcprop%waxy = clear_val - Sfcprop%wtxy = clear_val - Sfcprop%lfmassxy = clear_val - Sfcprop%rtmassxy = clear_val - Sfcprop%stmassxy = clear_val - Sfcprop%woodxy = clear_val - Sfcprop%stblcpxy = clear_val - Sfcprop%fastcpxy = clear_val - Sfcprop%xsaixy = clear_val - Sfcprop%taussxy = clear_val - Sfcprop%smcwtdxy = clear_val - Sfcprop%deeprechxy = clear_val - Sfcprop%rechxy = clear_val - - Sfcprop%snicexy = clear_val - Sfcprop%snliqxy = clear_val - Sfcprop%tsnoxy = clear_val - Sfcprop%smoiseq = clear_val - Sfcprop%zsnsoxy = clear_val + Sfcprop%snowxy = Model%clear_val + Sfcprop%tvxy = Model%clear_val + Sfcprop%tgxy = Model%clear_val + Sfcprop%canicexy = Model%clear_val + Sfcprop%canliqxy = Model%clear_val + Sfcprop%eahxy = Model%clear_val + Sfcprop%tahxy = Model%clear_val + Sfcprop%cmxy = Model%clear_val + Sfcprop%chxy = Model%clear_val + Sfcprop%fwetxy = Model%clear_val + Sfcprop%sneqvoxy = Model%clear_val + Sfcprop%alboldxy = Model%clear_val + Sfcprop%qsnowxy = Model%clear_val + Sfcprop%wslakexy = Model%clear_val + Sfcprop%zwtxy = Model%clear_val + Sfcprop%waxy = Model%clear_val + Sfcprop%wtxy = Model%clear_val + Sfcprop%lfmassxy = Model%clear_val + Sfcprop%rtmassxy = Model%clear_val + Sfcprop%stmassxy = Model%clear_val + Sfcprop%woodxy = Model%clear_val + Sfcprop%stblcpxy = Model%clear_val + Sfcprop%fastcpxy = Model%clear_val + Sfcprop%xsaixy = Model%clear_val + Sfcprop%taussxy = Model%clear_val + Sfcprop%smcwtdxy = Model%clear_val + Sfcprop%deeprechxy = Model%clear_val + Sfcprop%rechxy = Model%clear_val + + Sfcprop%snicexy = Model%clear_val + Sfcprop%snliqxy = Model%clear_val + Sfcprop%tsnoxy = Model%clear_val + Sfcprop%smoiseq = Model%clear_val + Sfcprop%zsnsoxy = Model%clear_val allocate (Sfcprop%draincprv (IM)) allocate (Sfcprop%drainncprv (IM)) @@ -2798,23 +2839,23 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%dsnowprv (IM)) allocate (Sfcprop%dgraupelprv(IM)) - Sfcprop%draincprv = clear_val - Sfcprop%drainncprv = clear_val - Sfcprop%diceprv = clear_val - Sfcprop%dsnowprv = clear_val - Sfcprop%dgraupelprv = clear_val + Sfcprop%draincprv = Model%clear_val + Sfcprop%drainncprv = Model%clear_val + Sfcprop%diceprv = Model%clear_val + Sfcprop%dsnowprv = Model%clear_val + Sfcprop%dgraupelprv = Model%clear_val endif if (Model%do_myjsfc .or. Model%do_myjpbl) then allocate (Sfcprop%z0base(IM)) - Sfcprop%z0base = clear_val + Sfcprop%z0base = Model%clear_val end if allocate (Sfcprop%semisbase(IM)) - Sfcprop%semisbase = clear_val + Sfcprop%semisbase = Model%clear_val - if (Model%lsm == Model%lsm_ruc) then + if (Model%lsm == Model%ilsm_ruc) then ! For land surface models with different numbers of levels than the four NOAH levels allocate (Sfcprop%wetness (IM)) allocate (Sfcprop%sh2o (IM,Model%lsoil_lsm)) @@ -2837,34 +2878,34 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%frac_grid_burned(IM)) ! - Sfcprop%wetness = clear_val - Sfcprop%sh2o = clear_val - Sfcprop%keepsmfr = clear_val - Sfcprop%smois = clear_val - Sfcprop%tslb = clear_val - Sfcprop%clw_surf_land = clear_val - Sfcprop%clw_surf_ice = clear_val - Sfcprop%qwv_surf_land = clear_val - Sfcprop%qwv_surf_ice = clear_val - Sfcprop%flag_frsoil = clear_val + Sfcprop%wetness = Model%clear_val + Sfcprop%sh2o = Model%clear_val + Sfcprop%keepsmfr = Model%clear_val + Sfcprop%smois = Model%clear_val + Sfcprop%tslb = Model%clear_val + Sfcprop%clw_surf_land = Model%clear_val + Sfcprop%clw_surf_ice = Model%clear_val + Sfcprop%qwv_surf_land = Model%clear_val + Sfcprop%qwv_surf_ice = Model%clear_val + Sfcprop%flag_frsoil = Model%clear_val Sfcprop%rhofr = -1.e3 - Sfcprop%tsnow_land = clear_val - Sfcprop%tsnow_ice = clear_val - Sfcprop%snowfallac_land = clear_val - Sfcprop%snowfallac_ice = clear_val - Sfcprop%acsnow_land = clear_val - Sfcprop%acsnow_ice = clear_val - Sfcprop%fire_heat_flux = clear_val - Sfcprop%frac_grid_burned= clear_val + Sfcprop%tsnow_land = Model%clear_val + Sfcprop%tsnow_ice = Model%clear_val + Sfcprop%snowfallac_land = Model%clear_val + Sfcprop%snowfallac_ice = Model%clear_val + Sfcprop%acsnow_land = Model%clear_val + Sfcprop%acsnow_ice = Model%clear_val + Sfcprop%fire_heat_flux = Model%clear_val + Sfcprop%frac_grid_burned= Model%clear_val ! end if allocate (Sfcprop%rmol (IM )) allocate (Sfcprop%flhc (IM )) allocate (Sfcprop%flqc (IM )) - Sfcprop%rmol = clear_val - Sfcprop%flhc = clear_val - Sfcprop%flqc = clear_val + Sfcprop%rmol = Model%clear_val + Sfcprop%flhc = Model%clear_val + Sfcprop%flqc = Model%clear_val if (Model%do_mynnsfclay) then ! For MYNN surface layer scheme @@ -2876,21 +2917,21 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%cqs2 (IM )) allocate (Sfcprop%lh (IM )) ! - !print*,"Initializing all MYNN-SfcLay variables with ",clear_val - Sfcprop%ustm = clear_val - Sfcprop%zol = clear_val - Sfcprop%mol = clear_val - Sfcprop%chs2 = clear_val - Sfcprop%cqs2 = clear_val - Sfcprop%lh = clear_val + !print*,"Initializing all MYNN-SfcLay variables with ",Model%clear_val + Sfcprop%ustm = Model%clear_val + Sfcprop%zol = Model%clear_val + Sfcprop%mol = Model%clear_val + Sfcprop%chs2 = Model%clear_val + Sfcprop%cqs2 = Model%clear_val + Sfcprop%lh = Model%clear_val end if if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_c3) then allocate (Sfcprop%maxupmf(IM)) allocate (Sfcprop%conv_act(IM)) allocate (Sfcprop%conv_act_m(IM)) - Sfcprop%maxupmf = zero - Sfcprop%conv_act = zero - Sfcprop%conv_act_m = zero + Sfcprop%maxupmf = Model%zero + Sfcprop%conv_act = Model%zero + Sfcprop%conv_act_m = Model%zero end if ! CLM Lake Model variables @@ -2919,29 +2960,29 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%lake_cannot_freeze(IM)) allocate (Sfcprop%clm_lake_initialized(IM)) - Sfcprop%lake_t2m = clear_val - Sfcprop%lake_q2m = clear_val - Sfcprop%lake_albedo = clear_val - Sfcprop%input_lakedepth = clear_val - Sfcprop%lake_h2osno2d = clear_val - Sfcprop%lake_sndpth2d = clear_val - Sfcprop%lake_snl2d = clear_val - Sfcprop%lake_snow_z3d = clear_val - Sfcprop%lake_snow_dz3d = clear_val - Sfcprop%lake_snow_zi3d = clear_val - Sfcprop%lake_h2osoi_vol3d = clear_val - Sfcprop%lake_h2osoi_liq3d = clear_val - Sfcprop%lake_h2osoi_ice3d = clear_val - Sfcprop%lake_tsfc = clear_val - Sfcprop%lake_t_soisno3d = clear_val - Sfcprop%lake_t_lake3d = clear_val - Sfcprop%lake_savedtke12d = clear_val - Sfcprop%lake_icefrac3d = clear_val + Sfcprop%lake_t2m = Model%clear_val + Sfcprop%lake_q2m = Model%clear_val + Sfcprop%lake_albedo = Model%clear_val + Sfcprop%input_lakedepth = Model%clear_val + Sfcprop%lake_h2osno2d = Model%clear_val + Sfcprop%lake_sndpth2d = Model%clear_val + Sfcprop%lake_snl2d = Model%clear_val + Sfcprop%lake_snow_z3d = Model%clear_val + Sfcprop%lake_snow_dz3d = Model%clear_val + Sfcprop%lake_snow_zi3d = Model%clear_val + Sfcprop%lake_h2osoi_vol3d = Model%clear_val + Sfcprop%lake_h2osoi_liq3d = Model%clear_val + Sfcprop%lake_h2osoi_ice3d = Model%clear_val + Sfcprop%lake_tsfc = Model%clear_val + Sfcprop%lake_t_soisno3d = Model%clear_val + Sfcprop%lake_t_lake3d = Model%clear_val + Sfcprop%lake_savedtke12d = Model%clear_val + Sfcprop%lake_icefrac3d = Model%clear_val Sfcprop%lake_rho0 = -111 Sfcprop%lake_ht = -111 - Sfcprop%lake_is_salty = zero - Sfcprop%lake_cannot_freeze = zero - Sfcprop%clm_lake_initialized = zero + Sfcprop%lake_is_salty = Model%zero + Sfcprop%lake_cannot_freeze = Model%zero + Sfcprop%clm_lake_initialized = Model%zero endif if(Model%rrfs_sd) then @@ -2960,18 +3001,18 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%fire_in (IM,Model%fire_aux_data_levels)) ! IMPORTANT: This initialization must match rrfs_sd_fill_data - Sfcprop%emdust = clear_val - Sfcprop%emseas = clear_val - Sfcprop%emanoc = clear_val - Sfcprop%ebb_smoke_in = clear_val - Sfcprop%frp_output = clear_val + Sfcprop%emdust = Model%clear_val + Sfcprop%emseas = Model%clear_val + Sfcprop%emanoc = Model%clear_val + Sfcprop%ebb_smoke_in = Model%clear_val + Sfcprop%frp_output = Model%clear_val Sfcprop%fhist = 1. - Sfcprop%coef_bb_dc = clear_val + Sfcprop%coef_bb_dc = Model%clear_val Sfcprop%fire_type = 0 - Sfcprop%fire_in = clear_val - Sfcprop%peak_hr = clear_val - Sfcprop%lu_nofire = clear_val - Sfcprop%lu_qfire = clear_val + Sfcprop%fire_in = Model%clear_val + Sfcprop%peak_hr = Model%clear_val + Sfcprop%lu_nofire = Model%clear_val + Sfcprop%lu_qfire = Model%clear_val endif !--- if fire_behavior is on @@ -2979,15 +3020,15 @@ subroutine sfcprop_create (Sfcprop, Model) allocate (Sfcprop%hflx_fire (IM)) allocate (Sfcprop%evap_fire (IM)) allocate (Sfcprop%smoke_fire (IM)) - Sfcprop%hflx_fire = zero - Sfcprop%evap_fire = zero - Sfcprop%smoke_fire = zero + Sfcprop%hflx_fire = Model%zero + Sfcprop%evap_fire = Model%zero + Sfcprop%smoke_fire = Model%zero endif ! land iau control setting call land_iau_mod_set_control(Sfcprop%land_iau_control, & Model%fn_nml, Model%input_nml_file, Model%me, Model%master, & - Model%isc, Model%jsc, Model%nx, Model%ny, Model%tile_num, Model%nblks, Model%blksz, & + Model%isc, Model%jsc, Model%nx, Model%ny, Model%tile_num, Model%nchunks, Model%chunks, & Model%lsoil, Model%lsnow_lsm, Model%dtp, Model%fhour, errmsg, errflg) if (errflg/=0) then @@ -3025,14 +3066,14 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%visbmui (IM)) allocate (Coupling%visdfui (IM)) - Coupling%nirbmdi = clear_val - Coupling%nirdfdi = clear_val - Coupling%visbmdi = clear_val - Coupling%visdfdi = clear_val - Coupling%nirbmui = clear_val - Coupling%nirdfui = clear_val - Coupling%visbmui = clear_val - Coupling%visdfui = clear_val + Coupling%nirbmdi = Model%clear_val + Coupling%nirdfdi = Model%clear_val + Coupling%visbmdi = Model%clear_val + Coupling%visdfdi = Model%clear_val + Coupling%nirbmui = Model%clear_val + Coupling%nirdfui = Model%clear_val + Coupling%visbmui = Model%clear_val + Coupling%visdfui = Model%clear_val allocate (Coupling%sfcdswc (IM)) allocate (Coupling%sfcdsw (IM)) @@ -3040,32 +3081,32 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%sfcdlw (IM)) allocate (Coupling%sfculw (IM)) - Coupling%sfcdswc = clear_val - Coupling%sfcdsw = clear_val - Coupling%sfcnsw = clear_val - Coupling%sfcdlw = clear_val - Coupling%sfculw = clear_val + Coupling%sfcdswc = Model%clear_val + Coupling%sfcdsw = Model%clear_val + Coupling%sfcnsw = Model%clear_val + Coupling%sfcdlw = Model%clear_val + Coupling%sfculw = Model%clear_val if (Model%do_RRTMGP) then allocate (Coupling%fluxlwUP_radtime (IM, Model%levs+1)) allocate (Coupling%fluxlwDOWN_radtime (IM, Model%levs+1)) - allocate (Coupling%htrlw (IM, Model%levs)) + allocate (Coupling%hrlw (IM, Model%levs)) allocate (Coupling%tsfc_radtime (IM)) - Coupling%fluxlwUP_radtime = clear_val - Coupling%fluxlwDOWN_radtime = clear_val - Coupling%htrlw = clear_val - Coupling%tsfc_radtime = clear_val + Coupling%fluxlwUP_radtime = Model%clear_val + Coupling%fluxlwDOWN_radtime = Model%clear_val + Coupling%hrlw = Model%clear_val + Coupling%tsfc_radtime = Model%clear_val if (Model%use_LW_jacobian) then allocate (Coupling%fluxlwUP_jac (IM, Model%levs+1)) - Coupling%fluxlwUP_jac = clear_val + Coupling%fluxlwUP_jac = Model%clear_val endif endif if (Model%cplflx .or. Model%do_sppt .or. Model%cplchm .or. Model%ca_global .or. Model%cpllnd .or. Model%cpl_fire) then allocate (Coupling%rain_cpl (IM)) allocate (Coupling%snow_cpl (IM)) - Coupling%rain_cpl = clear_val - Coupling%snow_cpl = clear_val + Coupling%rain_cpl = Model%clear_val + Coupling%snow_cpl = Model%clear_val endif if (Model%cplflx .or. Model%cplchm .or. Model%cplwav) then @@ -3073,29 +3114,29 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%u10mi_cpl (IM)) allocate (Coupling%v10mi_cpl (IM)) - Coupling%u10mi_cpl = clear_val - Coupling%v10mi_cpl = clear_val + Coupling%u10mi_cpl = Model%clear_val + Coupling%v10mi_cpl = Model%clear_val endif if (Model%cplflx .or. Model%cplchm .or. Model%cpllnd) then !--- instantaneous quantities allocate (Coupling%tsfci_cpl (IM)) - Coupling%tsfci_cpl = clear_val + Coupling%tsfci_cpl = Model%clear_val endif ! if (Model%cplwav2atm) then !--- incoming quantities ! allocate (Coupling%zorlwav_cpl (IM)) -! Coupling%zorlwav_cpl = clear_val +! Coupling%zorlwav_cpl = Model%clear_val ! endif ! -- additional coupling options for air quality if (Model%cplflx .or. Model%cpllnd .or. Model%cpl_fire .or. (Model%cplaqm .and. .not.Model%cplflx)) then allocate (Coupling%psurfi_cpl (IM)) allocate (Coupling%nswsfci_cpl (IM)) - Coupling%psurfi_cpl = clear_val - Coupling%nswsfci_cpl = clear_val + Coupling%psurfi_cpl = Model%clear_val + Coupling%nswsfci_cpl = Model%clear_val endif if (Model%cplflx .or. Model%cpl_fire .or. (Model%cplaqm .and. .not.Model%cplflx)) then @@ -3103,10 +3144,10 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%dqsfci_cpl (IM)) allocate (Coupling%t2mi_cpl (IM)) allocate (Coupling%q2mi_cpl (IM)) - Coupling%dtsfci_cpl = clear_val - Coupling%dqsfci_cpl = clear_val - Coupling%t2mi_cpl = clear_val - Coupling%q2mi_cpl = clear_val + Coupling%dtsfci_cpl = Model%clear_val + Coupling%dqsfci_cpl = Model%clear_val + Coupling%t2mi_cpl = Model%clear_val + Coupling%q2mi_cpl = Model%clear_val endif if (Model%cplflx .or. Model%cpllnd) then @@ -3124,19 +3165,19 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%nvisbm_cpl (IM)) allocate (Coupling%nvisdf_cpl (IM)) - Coupling%dlwsfci_cpl = clear_val - Coupling%dswsfci_cpl = clear_val - Coupling%dlwsfc_cpl = clear_val - Coupling%dswsfc_cpl = clear_val - Coupling%nswsfc_cpl = clear_val - Coupling%nnirbmi_cpl = clear_val - Coupling%nnirdfi_cpl = clear_val - Coupling%nvisbmi_cpl = clear_val - Coupling%nvisdfi_cpl = clear_val - Coupling%nnirbm_cpl = clear_val - Coupling%nnirdf_cpl = clear_val - Coupling%nvisbm_cpl = clear_val - Coupling%nvisdf_cpl = clear_val + Coupling%dlwsfci_cpl = Model%clear_val + Coupling%dswsfci_cpl = Model%clear_val + Coupling%dlwsfc_cpl = Model%clear_val + Coupling%dswsfc_cpl = Model%clear_val + Coupling%nswsfc_cpl = Model%clear_val + Coupling%nnirbmi_cpl = Model%clear_val + Coupling%nnirdfi_cpl = Model%clear_val + Coupling%nvisbmi_cpl = Model%clear_val + Coupling%nvisdfi_cpl = Model%clear_val + Coupling%nnirbm_cpl = Model%clear_val + Coupling%nnirdf_cpl = Model%clear_val + Coupling%nvisbm_cpl = Model%clear_val + Coupling%nvisdf_cpl = Model%clear_val end if if (Model%cplflx .or. Model%cpl_fire) then @@ -3157,21 +3198,21 @@ subroutine coupling_create (Coupling, Model) ! allocate (Coupling%sfc_alb_vis_dir_cpl (IM)) ! allocate (Coupling%sfc_alb_vis_dif_cpl (IM)) - Coupling%slimskin_cpl = clear_val - Coupling%dusfcin_cpl = clear_val - Coupling%dvsfcin_cpl = clear_val - Coupling%dtsfcin_cpl = clear_val - Coupling%dqsfcin_cpl = clear_val - Coupling%ulwsfcin_cpl = clear_val -! Coupling%tseain_cpl = clear_val -! Coupling%tisfcin_cpl = clear_val -! Coupling%ficein_cpl = clear_val -! Coupling%hicein_cpl = clear_val - Coupling%hsnoin_cpl = clear_val -! Coupling%sfc_alb_nir_dir_cpl = clear_val -! Coupling%sfc_alb_nir_dif_cpl = clear_val -! Coupling%sfc_alb_vis_dir_cpl = clear_val -! Coupling%sfc_alb_vis_dif_cpl = clear_val + Coupling%slimskin_cpl = Model%clear_val + Coupling%dusfcin_cpl = Model%clear_val + Coupling%dvsfcin_cpl = Model%clear_val + Coupling%dtsfcin_cpl = Model%clear_val + Coupling%dqsfcin_cpl = Model%clear_val + Coupling%ulwsfcin_cpl = Model%clear_val +! Coupling%tseain_cpl = Model%clear_val +! Coupling%tisfcin_cpl = Model%clear_val +! Coupling%ficein_cpl = Model%clear_val +! Coupling%hicein_cpl = Model%clear_val + Coupling%hsnoin_cpl = Model%clear_val +! Coupling%sfc_alb_nir_dir_cpl = Model%clear_val +! Coupling%sfc_alb_nir_dif_cpl = Model%clear_val +! Coupling%sfc_alb_vis_dir_cpl = Model%clear_val +! Coupling%sfc_alb_vis_dif_cpl = Model%clear_val ! -- Coupling options to retrive atmosphere-ocean fluxes from mediator if (Model%use_med_flux) then @@ -3181,11 +3222,11 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%dqsfcin_med (IM)) allocate (Coupling%ulwsfcin_med(IM)) - Coupling%dusfcin_med = clear_val - Coupling%dvsfcin_med = clear_val - Coupling%dtsfcin_med = clear_val - Coupling%dqsfcin_med = clear_val - Coupling%ulwsfcin_med = clear_val + Coupling%dusfcin_med = Model%clear_val + Coupling%dvsfcin_med = Model%clear_val + Coupling%dtsfcin_med = Model%clear_val + Coupling%dqsfcin_med = Model%clear_val + Coupling%ulwsfcin_med = Model%clear_val end if !--- accumulated quantities @@ -3199,15 +3240,15 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%dvisdf_cpl (IM)) allocate (Coupling%nlwsfc_cpl (IM)) - Coupling%dusfc_cpl = clear_val - Coupling%dvsfc_cpl = clear_val - Coupling%dtsfc_cpl = clear_val - Coupling%dqsfc_cpl = clear_val - Coupling%dnirbm_cpl = clear_val - Coupling%dnirdf_cpl = clear_val - Coupling%dvisbm_cpl = clear_val - Coupling%dvisdf_cpl = clear_val - Coupling%nlwsfc_cpl = clear_val + Coupling%dusfc_cpl = Model%clear_val + Coupling%dvsfc_cpl = Model%clear_val + Coupling%dtsfc_cpl = Model%clear_val + Coupling%dqsfc_cpl = Model%clear_val + Coupling%dnirbm_cpl = Model%clear_val + Coupling%dnirdf_cpl = Model%clear_val + Coupling%dvisbm_cpl = Model%clear_val + Coupling%dvisdf_cpl = Model%clear_val + Coupling%nlwsfc_cpl = Model%clear_val !--- instantaneous quantities allocate (Coupling%dusfci_cpl (IM)) @@ -3220,15 +3261,15 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%oro_cpl (IM)) allocate (Coupling%slmsk_cpl (IM)) - Coupling%dusfci_cpl = clear_val - Coupling%dvsfci_cpl = clear_val - Coupling%dnirbmi_cpl = clear_val - Coupling%dnirdfi_cpl = clear_val - Coupling%dvisbmi_cpl = clear_val - Coupling%dvisdfi_cpl = clear_val - Coupling%nlwsfci_cpl = clear_val - Coupling%oro_cpl = clear_val !< pointer to sfcprop%oro - Coupling%slmsk_cpl = clear_val !< pointer to sfcprop%slmsk + Coupling%dusfci_cpl = Model%clear_val + Coupling%dvsfci_cpl = Model%clear_val + Coupling%dnirbmi_cpl = Model%clear_val + Coupling%dnirdfi_cpl = Model%clear_val + Coupling%dvisbmi_cpl = Model%clear_val + Coupling%dvisdfi_cpl = Model%clear_val + Coupling%nlwsfci_cpl = Model%clear_val + Coupling%oro_cpl = Model%clear_val !< pointer to sfcprop%oro + Coupling%slmsk_cpl = Model%clear_val !< pointer to sfcprop%slmsk endif ! -- Coupling options to retrive land fluxes from external land component @@ -3247,24 +3288,24 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%chh_lnd (IM)) allocate (Coupling%zvfun_lnd (IM)) - Coupling%sncovr1_lnd = clear_val - Coupling%qsurf_lnd = clear_val - Coupling%evap_lnd = clear_val - Coupling%hflx_lnd = clear_val - Coupling%ep_lnd = clear_val - Coupling%t2mmp_lnd = clear_val - Coupling%q2mp_lnd = clear_val - Coupling%gflux_lnd = clear_val - Coupling%runoff_lnd = clear_val - Coupling%drain_lnd = clear_val - Coupling%cmm_lnd = clear_val - Coupling%chh_lnd = clear_val - Coupling%zvfun_lnd = clear_val + Coupling%sncovr1_lnd = Model%clear_val + Coupling%qsurf_lnd = Model%clear_val + Coupling%evap_lnd = Model%clear_val + Coupling%hflx_lnd = Model%clear_val + Coupling%ep_lnd = Model%clear_val + Coupling%t2mmp_lnd = Model%clear_val + Coupling%q2mp_lnd = Model%clear_val + Coupling%gflux_lnd = Model%clear_val + Coupling%runoff_lnd = Model%clear_val + Coupling%drain_lnd = Model%clear_val + Coupling%cmm_lnd = Model%clear_val + Coupling%chh_lnd = Model%clear_val + Coupling%zvfun_lnd = Model%clear_val end if !-- cellular automata allocate (Coupling%condition(IM)) - Coupling%condition = clear_val + Coupling%condition = Model%clear_val if (Model%do_ca) then allocate (Coupling%ca1 (IM)) allocate (Coupling%ca2 (IM)) @@ -3274,14 +3315,14 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%ca_shal (IM)) allocate (Coupling%ca_rad (IM)) allocate (Coupling%ca_micro (IM)) - Coupling%ca1 = clear_val - Coupling%ca2 = clear_val - Coupling%ca3 = clear_val - Coupling%ca_deep = clear_val - Coupling%ca_turb = clear_val - Coupling%ca_shal = clear_val - Coupling%ca_rad = clear_val - Coupling%ca_micro = clear_val + Coupling%ca1 = Model%clear_val + Coupling%ca2 = Model%clear_val + Coupling%ca3 = Model%clear_val + Coupling%ca_deep = Model%clear_val + Coupling%ca_turb = Model%clear_val + Coupling%ca_shal = Model%clear_val + Coupling%ca_rad = Model%clear_val + Coupling%ca_micro = Model%clear_val endif ! -- Aerosols coupling options @@ -3291,32 +3332,32 @@ subroutine coupling_create (Coupling, Model) ! -- instantaneous 3d fluxes of nonconvective ice and liquid precipitations allocate (Coupling%pfi_lsan (IM,Model%levs)) allocate (Coupling%pfl_lsan (IM,Model%levs)) - Coupling%ushfsfci = clear_val - Coupling%pfi_lsan = clear_val - Coupling%pfl_lsan = clear_val + Coupling%ushfsfci = Model%clear_val + Coupling%pfi_lsan = Model%clear_val + Coupling%pfl_lsan = Model%clear_val endif if (Model%cplchm .or. Model%cplflx .or. Model%cpllnd .or. Model%cpl_fire) then !--- accumulated convective rainfall allocate (Coupling%rainc_cpl (IM)) - Coupling%rainc_cpl = clear_val + Coupling%rainc_cpl = Model%clear_val end if if(Model%progsigma)then allocate (Coupling%dqdt_qmicro (IM,Model%levs)) - Coupling%dqdt_qmicro = clear_val + Coupling%dqdt_qmicro = Model%clear_val endif !--- stochastic physics option if (Model%do_sppt .or. Model%ca_global) then allocate (Coupling%sppt_wts (IM,Model%levs)) - Coupling%sppt_wts = clear_val + Coupling%sppt_wts = Model%clear_val endif !--- stochastic shum option if (Model%do_shum) then allocate (Coupling%shum_wts (IM,Model%levs)) - Coupling%shum_wts = clear_val + Coupling%shum_wts = Model%clear_val endif !--- stochastic skeb option @@ -3324,30 +3365,30 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%skebu_wts (IM,Model%levs)) allocate (Coupling%skebv_wts (IM,Model%levs)) - Coupling%skebu_wts = clear_val - Coupling%skebv_wts = clear_val + Coupling%skebu_wts = Model%clear_val + Coupling%skebv_wts = Model%clear_val endif !--- stochastic land perturbation option if (Model%lndp_type /= 0) then allocate (Coupling%sfc_wts (IM,Model%n_var_lndp)) - Coupling%sfc_wts = clear_val + Coupling%sfc_wts = Model%clear_val endif !--- stochastic spp perturbation option if (Model%do_spp) then allocate (Coupling%spp_wts_pbl (IM,Model%levs)) - Coupling%spp_wts_pbl = clear_val + Coupling%spp_wts_pbl = Model%clear_val allocate (Coupling%spp_wts_sfc (IM,Model%levs)) - Coupling%spp_wts_sfc = clear_val + Coupling%spp_wts_sfc = Model%clear_val allocate (Coupling%spp_wts_mp (IM,Model%levs)) - Coupling%spp_wts_mp = clear_val + Coupling%spp_wts_mp = Model%clear_val allocate (Coupling%spp_wts_gwd (IM,Model%levs)) - Coupling%spp_wts_gwd = clear_val + Coupling%spp_wts_gwd = Model%clear_val allocate (Coupling%spp_wts_rad (IM,Model%levs)) - Coupling%spp_wts_rad = clear_val + Coupling%spp_wts_rad = Model%clear_val allocate (Coupling%spp_wts_cu_deep (IM,Model%levs)) - Coupling%spp_wts_cu_deep = clear_val + Coupling%spp_wts_cu_deep = Model%clear_val endif !--- needed for Thompson's aerosol option @@ -3356,8 +3397,8 @@ subroutine coupling_create (Coupling, Model) (Model%ltaerosol .or. Model%mraerosol)) then allocate (Coupling%nwfa2d (IM)) allocate (Coupling%nifa2d (IM)) - Coupling%nwfa2d = clear_val - Coupling%nifa2d = clear_val + Coupling%nwfa2d = Model%clear_val + Coupling%nifa2d = Model%clear_val endif if(Model%rrfs_sd) then @@ -3375,24 +3416,24 @@ subroutine coupling_create (Coupling, Model) allocate (Coupling%hpbl_thetav(IM)) allocate (Coupling%rrfs_hwp (IM)) allocate (Coupling%rrfs_hwp_ave (IM)) - Coupling%ebu_smoke = clear_val - Coupling%chem3d = clear_val - Coupling%ddvel = clear_val - Coupling%wetdpc_flux = clear_val - Coupling%wetdpr_flux = clear_val - Coupling%drydep_flux = clear_val - Coupling%min_fplume = clear_val - Coupling%max_fplume = clear_val - Coupling%uspdavg = clear_val - Coupling%rho_dry = clear_val - Coupling%hpbl_thetav = clear_val - Coupling%rrfs_hwp = clear_val - Coupling%rrfs_hwp_ave = clear_val + Coupling%ebu_smoke = Model%clear_val + Coupling%chem3d = Model%clear_val + Coupling%ddvel = Model%clear_val + Coupling%wetdpc_flux = Model%clear_val + Coupling%wetdpr_flux = Model%clear_val + Coupling%drydep_flux = Model%clear_val + Coupling%min_fplume = Model%clear_val + Coupling%max_fplume = Model%clear_val + Coupling%uspdavg = Model%clear_val + Coupling%rho_dry = Model%clear_val + Coupling%hpbl_thetav = Model%clear_val + Coupling%rrfs_hwp = Model%clear_val + Coupling%rrfs_hwp_ave = Model%clear_val endif if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_c3) then allocate (Coupling%qci_conv (IM,Model%levs)) - Coupling%qci_conv = clear_val + Coupling%qci_conv = Model%clear_val endif end subroutine coupling_create @@ -3405,11 +3446,11 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & master, logunit, levs, dt_dycore, & dt_phys, iau_offset, idat, jdat, & nwat, tracer_names, tracer_types, & - input_nml_file, blksz, restart, & + input_nml_file, chunks, restart, & communicator, ntasks, nthreads, & tile_num, isc, jsc, nx, ny, cnx, & cny, gnx, gny, ak, bk, hydrostatic) - + !--- modules use physcons, only: con_rerth, con_pi, con_p0, rhowater use mersenne_twister, only: random_setseed, random_number @@ -3434,7 +3475,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & character(len=32), intent(in) :: tracer_names(:) integer, intent(in) :: tracer_types(:) character(len=:), intent(in), dimension(:), pointer :: input_nml_file - integer, intent(in) :: blksz(:) + integer, intent(in) :: chunks(:) logical, intent(in) :: restart type(MPI_Comm), intent(in) :: communicator integer, intent(in) :: ntasks @@ -3752,7 +3793,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & integer :: iopt_rad = 3 !radiation transfer (1->gap=f(3d,cosz); 2->gap=0; 3->gap=1-fveg) integer :: iopt_alb = 2 !snow surface albedo (1->bats; 2->class) integer :: iopt_snf = 1 !rainfall & snowfall (1-jordan91; 2->bats; 3->noah) - integer :: iopt_tbot = 2 !lower boundary of soil temperature (1->zero-flux; 2->noah) + integer :: iopt_tbot = 2 !lower boundary of soil temperature (1->Model%zero-flux; 2->noah) integer :: iopt_stc = 1 !snow/soil temperature time scheme (only layer 1) integer :: iopt_trs = 2 !thermal roughness scheme (1-z0h=z0m; 2-czil; 3-ec;4-kb reversed) integer :: iopt_diag = 2 !2m t/q diagnostic approach (1->external GFS sfc_diag 2->original NoahMP 2-title @@ -3969,12 +4010,17 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & logical :: nst_anl = .false. !< flag for NSSTM analysis in gcycle/sfcsub integer :: lsea = 0 integer :: nstf_name(5) = (/0,0,1,0,5/) !< flag 0 for no nst 1 for uncoupled nst and 2 for coupled NST - !< nstf_name(1) : 0 = NSSTM off, 1 = NSSTM on but uncoupled - !< 2 = NSSTM on and coupled - !< nstf_name(2) : 1 = NSSTM spin up on, 0 = NSSTM spin up off - !< nstf_name(3) : 1 = NSSTM analysis on, 0 = NSSTM analysis off - !< nstf_name(4) : zsea1 in mm - !< nstf_name(5) : zsea2 in mm + !< nstf_name(instf_opt) : 0 = NSSTM off, 1 = NSSTM on but uncoupled + !< 2 = NSSTM on and coupled + !< nstf_name(instf_spinup) : 1 = NSSTM spin up on, 0 = NSSTM spin up off + !< nstf_name(instf_anlys) : 1 = NSSTM analysis on, 0 = NSSTM analysis off + !< nstf_name(instf_zs1_lb) : lower bounds (in mm) + !< nstf_name(instf_zs2_ub) : upper bounds (in mm) + integer :: instf_opt = 1 + integer :: instf_spinup = 2 + integer :: instf_anlys = 3 + integer :: instf_zs1_lb = 4 + integer :: instf_zs2_ub = 5 !--- fractional grid logical :: frac_grid = .false. !< flag for fractional grid logical :: frac_ice = .true. !< flag for lake fractional ice when fractional grid is not in use @@ -4093,6 +4139,21 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & integer :: spp_cu_deep = 0 logical :: do_spp = .false. +!--- physics tracer configuration parameters + integer :: nvdiff = 0 + integer :: nn = 0 + logical :: mg3_as_mg2 = .false. + integer :: itc = 0 + integer :: ntk = 0 + integer :: ntkev = 0 + integer :: tracers_total = 0 + integer :: ncstrac = 0 + integer :: nsamftrac = 0 + integer :: ntcwx = 0 + integer :: ntiwx = 0 + integer :: ntrwx = 0 + logical :: trans_aero = .false. + integer :: ichoice = 0 !< flag for closure of C3/GF deep convection integer :: ichoicem = 13!< flag for closure of C3/GF mid convection integer :: ichoice_s = 3 !< flag for closure of C3/GF shallow convection @@ -4158,6 +4219,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & !--- aerosol scavenging factors integer, parameter :: max_scav_factors = 183 character(len=40) :: fscav_aero(max_scav_factors) = '' + integer :: nscav = 0 real(kind=kind_phys) :: radar_tten_limits(2) = (/ limit_unspecified, limit_unspecified /) integer :: itime @@ -4372,6 +4434,40 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & integer :: ncid, dimID, varID, status, ntime_sim_data, nlev_sim_data, errflg character(len=256) :: errmsg + !--- Interstitial configurations (static) + Model%zero = 0.0_kind_phys + Model%clear_val = 0.0_kind_phys + Model%rann_init = 0.6_kind_phys + Model%isfc_gfs = 1 + Model%iaer_tau = 1 + Model%iaer_ssa = 2 + Model%iaer_g = 3 + Model%NF_CLDS = 9 + Model%icld_cfrac = 1 + Model%icld_lwp = 2 + Model%icld_reliq = 3 + Model%icld_iwp = 4 + Model%icld_reice = 5 + Model%icld_rwp = 6 + Model%icld_rerain = 7 + Model%icld_swp = 8 + Model%icld_resnow = 9 + Model%NF_VGAS = 10 + Model%igas_co2 = 1 + Model%igas_n2o = 2 + Model%igas_ch4 = 3 + Model%igas_o2 = 4 + Model%igas_co = 5 + Model%igas_cfc11 = 6 + Model%igas_cfc12 = 7 + Model%igas_cfc22 = 8 + Model%igas_ccl4 = 9 + Model%igas_cfc113 = 10 + Model%ialb_nirdir = 1 + Model%ialb_nirdif = 2 + Model%ialb_uvvisdir = 3 + Model%ialb_uvvisdif = 4 + !--- If initializing model with FV3 dynamical core. if (Model%dycore_active == Model%dycore_fv3) then if (.not. present(tile_num)) then @@ -4639,22 +4735,25 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%levs = levs Model%levsp1 = Model%levs + 1 Model%levsm1 = Model%levs - 1 - - Model%nblks = size(blksz) - allocate (Model%blksz(1:Model%nblks)) - Model%blksz = blksz - Model%ncols = sum(Model%blksz) + Model%cnx = cnx + Model%cny = cny + Model%lonr = gnx ! number longitudinal points + Model%latr = gny ! number of latitudinal points from pole to pole ! DH* - Model%nchunks = size(blksz) + Model%nchunks = size(chunks) + allocate (Model%chunks(1:Model%nchunks)) + Model%chunks = chunks + Model%ncols = sum(Model%chunks) allocate (Model%chunk_begin(Model%nchunks)) allocate (Model%chunk_end(Model%nchunks)) Model%chunk_begin(1) = 1 - Model%chunk_end(1) = Model%chunk_begin(1) + blksz(1) - 1 + Model%chunk_end(1) = Model%chunk_begin(1) + chunks(1) - 1 do i=2,Model%nchunks Model%chunk_begin(i) = Model%chunk_end(i-1) + 1 - Model%chunk_end(i) = Model%chunk_begin(i) + blksz(i) - 1 - end do - Model%ipr = min(minval(Model%blksz), 10) + Model%chunk_end(i) = Model%chunk_begin(i) + chunks(i) - 1 + end do + Model%chunks(Model%nchunks) = Model%chunk_end(Model%nchunks) - Model%chunk_begin(Model%nchunks) + 1 + Model%ipr = min(minval(Model%chunks), 10) !--- coupling parameters Model%cplflx = cplflx @@ -4769,8 +4868,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%levr = levr endif Model%levrp1 = Model%levr + 1 - Model%lmk = Model%levr + LTP - Model%lmp = Model%levr + 1 + LTP + Model%lmk = Model%levr + Model%LTP + Model%lmp = Model%levr + 1 + Model%LTP Model%nbdlw = NBDLW Model%nbdsw = NBDSW Model%NF_AESW = 3 @@ -4856,7 +4955,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%ipsdlim = ipsdlim Model%lrseeds = lrseeds Model%nrstreams = nrstreams - Model%lextop = (ltp > 0) + Model%lextop = (Model%ltp > 0) ! RRTMGP Model%do_RRTMGP = do_RRTMGP Model%rrtmgp_nrghice = rrtmgp_nrghice @@ -5042,7 +5141,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & ! Flag to read leaf area index from input files (initial conditions) Model%rdlai = rdlai - if (Model%rdlai .and. .not. Model%lsm == Model%lsm_ruc) then + if (Model%rdlai .and. .not. Model%lsm == Model%ilsm_ruc) then write(0,*) 'Logic error: rdlai = .true. only works with RUC LSM' error stop end if @@ -5059,20 +5158,20 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & ! Allocate variables to store depth/thickness of soil layers allocate (Model%zs (Model%lsoil_lsm)) allocate (Model%dzs(Model%lsoil_lsm)) - if (Model%lsm==Model%lsm_noah .or. Model%lsm==Model%lsm_noahmp) then + if (Model%lsm==Model%ilsm_noah .or. Model%lsm==Model%ilsm_noahmp) then if (Model%lsoil_lsm/=4) then write(0,*) 'Error in GFS_typedefs.F90, number of soil layers must be 4 for Noah/NoahMP' error stop end if Model%zs = (/-0.1_kind_phys, -0.4_kind_phys, -1.0_kind_phys, -2.0_kind_phys/) Model%dzs = (/ 0.1_kind_phys, 0.3_kind_phys, 0.6_kind_phys, 1.0_kind_phys/) - elseif (Model%lsm==Model%lsm_ruc) then - Model%zs = clear_val - Model%dzs = clear_val + elseif (Model%lsm==Model%ilsm_ruc) then + Model%zs = Model%clear_val + Model%dzs = Model%clear_val end if ! *DH - if (Model%lsm==Model%lsm_ruc) then + if (Model%lsm==Model%ilsm_ruc) then if (Model%lsoil_lsm/=9) then write(0,*) 'Error in GFS_typedefs.F90, number of soil layers must be 9 for RUC' error stop @@ -5082,12 +5181,12 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & ! Set number of ice model layers Model%kice = kice - if (Model%lsm==Model%lsm_noah .or. Model%lsm==Model%lsm_noahmp) then + if (Model%lsm==Model%ilsm_noah .or. Model%lsm==Model%ilsm_noahmp) then if (kice/=2) then write(0,*) 'Error in GFS_typedefs.F90, number of ice model layers must be 2 for Noah/NoahMP/Noah_WRFv4' error stop end if - elseif (Model%lsm==Model%lsm_ruc) then + elseif (Model%lsm==Model%ilsm_ruc) then if (kice/=9) then write(0,*) 'Error in GFS_typedefs.F90, number of ice model layers must be 9 for RUC' error stop @@ -5097,16 +5196,16 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & ! Allocate variable for min/max soil moisture for a given soil type allocate (Model%pores(30)) allocate (Model%resid(30)) - Model%pores = clear_val - Model%resid = clear_val + Model%pores = Model%clear_val + Model%resid = Model%clear_val ! - if (Model%lsm==Model%lsm_noahmp) then + if (Model%lsm==Model%ilsm_noahmp) then if (lsnow_lsm/=3) then write(0,*) 'Logic error: NoahMP expects the maximum number of snow layers to be exactly 3 (see sfc_noahmp_drv.f)' error stop else Model%lsnow_lsm = lsnow_lsm - ! Set lower bound for LSM model, runs from negative (above surface) to surface (zero) + ! Set lower bound for LSM model, runs from negative (above surface) to surface (Model%zero) Model%lsnow_lsm_lbound = -Model%lsnow_lsm+1 Model%lsnow_lsm_ubound = 0 end if @@ -5152,8 +5251,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%nlevlake_clm_lake = nlevlake_clm_lake Model%nlevsoil_clm_lake = nlevsoil_clm_lake Model%nlevsnow_clm_lake = nlevsnow_clm_lake - Model%nlevsnowsoil_clm_lake = nlevsnowsoil_clm_lake - Model%nlevsnowsoil1_clm_lake = nlevsnowsoil1_clm_lake + Model%nlevsnowsoil_clm_lake = -1*nlevsnow_clm_lake + Model%nlevsnowsoil1_clm_lake = -1*(nlevsnow_clm_lake + 1) Model%clm_lake_depth_default = clm_lake_depth_default Model%clm_lake_use_lakedepth = clm_lake_use_lakedepth Model%clm_lake_debug = clm_lake_debug @@ -5170,7 +5269,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%iopt_inf = iopt_inf Model%iopt_rad = iopt_rad Model%iopt_alb = iopt_alb - if (Model%lsm==Model%lsm_noahmp .and. Model%exticeden .and. iopt_snf == 4) then + if (Model%lsm==Model%ilsm_noahmp .and. Model%exticeden .and. iopt_snf == 4) then Model%iopt_snf = 5 else Model%iopt_snf = iopt_snf @@ -5438,7 +5537,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & allocate (Model%lndp_var_list(Model%n_var_lndp)) allocate (Model%lndp_prt_list(Model%n_var_lndp)) Model%lndp_var_list(:) = '' - Model%lndp_prt_list(:) = clear_val + Model%lndp_prt_list(:) = Model%clear_val end if if (Model%do_spp) then @@ -5446,8 +5545,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & allocate (Model%spp_prt_list(Model%n_var_spp)) allocate (Model%spp_stddev_cutoff(Model%n_var_spp)) Model%spp_var_list(:) = '' - Model%spp_prt_list(:) = clear_val - Model%spp_stddev_cutoff(:) = clear_val + Model%spp_prt_list(:) = Model%clear_val + Model%spp_stddev_cutoff(:) = Model%clear_val end if !--- cellular automata options @@ -5543,6 +5642,12 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%ntdust = get_tracer_index(Model%tracer_names, 'dust') Model%ntcoarsepm = get_tracer_index(Model%tracer_names, 'coarsepm') endif + +!--- Call gfs_setup_tracers() + allocate (Model%otspt (Model%ntracp1,2)) + allocate (Model%otsptflag (Model%ntrac)) + call gfs_setup_tracers(Model) + !--- initialize parameters for atmospheric chemistry tracers call Model%init_chemistry(tracer_types) !--- setup aerosol scavenging factors @@ -6152,7 +6257,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & elseif (Model%lsm == 0) then print *,' OSU no longer supported - job aborted' error stop - elseif (Model%lsm == Model%lsm_noahmp) then + elseif (Model%lsm == Model%ilsm_noahmp) then if (Model%ivegsrc /= 1) then print *,'Vegetation type must be IGBP if Noah MP is used' error stop @@ -6177,7 +6282,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & print *,'iopt_stc = ', Model%iopt_stc print *,'iopt_trs = ', Model%iopt_trs print *,'iopt_diag = ', Model%iopt_diag - elseif (Model%lsm == Model%lsm_ruc) then + elseif (Model%lsm == Model%ilsm_ruc) then print *,' RUC Land Surface Model used' print *, 'The Physics options are' print *,' mosaic_lu = ',mosaic_lu @@ -6190,7 +6295,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & error stop endif -! if (Model%lsm == Model%lsm_noahmp .and. Model%iopt_snf == 4) then +! if (Model%lsm == Model%ilsm_noahmp .and. Model%iopt_snf == 4) then ! if (Model%imp_physics /= Model%imp_physics_gfdl) stop 'iopt_snf == 4 must use GFDL MP' ! endif @@ -6218,13 +6323,18 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & endif endif + Model%instf_opt = instf_opt + Model%instf_spinup = instf_spinup + Model%instf_anlys = instf_anlys + Model%instf_zs1_lb = instf_zs1_lb + Model%instf_zs2_ub = instf_zs2_ub if (Model%nstf_name(1) > 0 ) then print *,' NSSTM is active ' - print *,' nstf_name(1)=',Model%nstf_name(1) - print *,' nstf_name(2)=',Model%nstf_name(2) - print *,' nstf_name(3)=',Model%nstf_name(3) - print *,' nstf_name(4)=',Model%nstf_name(4) - print *,' nstf_name(5)=',Model%nstf_name(5) + print *,' nstf_name(1)=',Model%nstf_name(Model%instf_opt) + print *,' nstf_name(2)=',Model%nstf_name(Model%instf_spinup) + print *,' nstf_name(3)=',Model%nstf_name(Model%instf_anlys) + print *,' nstf_name(4)=',Model%nstf_name(Model%instf_zs1_lb) + print *,' nstf_name(5)=',Model%nstf_name(Model%instf_zs2_ub) endif if (Model%do_deep) then ! Consistency check for NTDK convection: deep and shallow convection are bundled @@ -6359,6 +6469,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%nps2delt = -999 Model%npsdelt = -999 Model%ncnd = nwat - 1 ! ncnd is the number of cloud condensate types + Model%nscav = Model%ntrac - Model%ncnd + 2 if (Model%imp_physics == Model%imp_physics_zhao_carr) then Model%npdf3d = 0 Model%num_p3d = 4 @@ -6811,7 +6922,7 @@ subroutine control_scavenging_initialize(Model, fscav) if (Model%ntchm > 0) then !--- set default as no scavenging - Model%fscav = zero + Model%fscav = Model%zero ! -- read factors from namelist ! -- set default first, if available do i = 1, size(fscav) @@ -6896,9 +7007,8 @@ subroutine control_print(Model) print *, ' lonr : ', Model%lonr print *, ' latr : ', Model%latr end if - print *, ' nblks : ', Model%nblks - print *, ' blksz(1) : ', Model%blksz(1) - print *, ' blksz(nblks) : ', Model%blksz(Model%nblks) + print *, ' chunks(1) : ', Model%chunks(1) + print *, ' chunks(nchunks) : ', Model%chunks(Model%nchunks) print *, ' Model%ncols : ', Model%ncols print *, ' ' print *, 'coupling parameters' @@ -7133,7 +7243,7 @@ subroutine control_print(Model) print *, ' lsoil : ', Model%lsoil print *, ' rdlai : ', Model%rdlai print *, ' lsoil_lsm : ', Model%lsoil_lsm - if (Model%lsm==Model%lsm_noahmp) then + if (Model%lsm==Model%ilsm_noahmp) then print *, ' lsnow_lsm : ', Model%lsnow_lsm print *, ' lsnow_lsm_lbound : ', Model%lsnow_lsm_lbound print *, ' lsnow_lsm_ubound : ', Model%lsnow_lsm_ubound @@ -7154,7 +7264,7 @@ subroutine control_print(Model) print *, ' isot : ', Model%isot print *, ' nsoilcat : ', Model%nsoilcat - if (Model%lsm == Model%lsm_noahmp) then + if (Model%lsm == Model%ilsm_noahmp) then print *, ' Noah MP LSM is used, the options are' print *, ' iopt_dveg : ', Model%iopt_dveg print *, ' iopt_crs : ', Model%iopt_crs @@ -7170,7 +7280,7 @@ subroutine control_print(Model) print *, ' iopt_stc : ', Model%iopt_stc print *, ' iopt_trs : ', Model%iopt_trs print *, ' iopt_diag : ', Model%iopt_diag - elseif (Model%lsm == Model%lsm_ruc) then + elseif (Model%lsm == Model%ilsm_ruc) then print *,' RUC Land Surface Model used' print *, 'The Physics options are' print *,' mosaic_lu = ',Model%mosaic_lu @@ -7489,14 +7599,14 @@ subroutine grid_create (Grid, Model) allocate (Grid%area (IM)) allocate (Grid%dx (IM)) - Grid%xlon = clear_val - Grid%xlat = clear_val - Grid%xlat_d = clear_val - Grid%xlon_d = clear_val - Grid%sinlat = clear_val - Grid%coslat = clear_val - Grid%area = clear_val - Grid%dx = clear_val + Grid%xlon = Model%clear_val + Grid%xlat = Model%clear_val + Grid%xlat_d = Model%clear_val + Grid%xlon_d = Model%clear_val + Grid%sinlat = Model%clear_val + Grid%coslat = Model%clear_val + Grid%area = Model%clear_val + Grid%dx = Model%clear_val !--- ozone active if ( Model%ntoz > 0 ) then @@ -7504,9 +7614,9 @@ subroutine grid_create (Grid, Model) allocate (Grid%jindx1_o3 (IM)) allocate (Grid%jindx2_o3 (IM)) - Grid%ddy_o3 = clear_val - Grid%jindx1_o3 = clear_val - Grid%jindx2_o3 = clear_val + Grid%ddy_o3 = Model%clear_val + Grid%jindx1_o3 = Model%clear_val + Grid%jindx2_o3 = Model%clear_val endif !--- stratosphere h2o active @@ -7515,9 +7625,9 @@ subroutine grid_create (Grid, Model) allocate (Grid%jindx1_h (IM)) allocate (Grid%jindx2_h (IM)) - Grid%ddy_h = clear_val - Grid%jindx1_h = clear_val - Grid%jindx2_h = clear_val + Grid%ddy_h = Model%clear_val + Grid%jindx1_h = Model%clear_val + Grid%jindx2_h = Model%clear_val endif !--- iccn active @@ -7529,12 +7639,12 @@ subroutine grid_create (Grid, Model) allocate (Grid%iindx1_ci (IM)) allocate (Grid%iindx2_ci (IM)) - Grid%ddy_ci = clear_val - Grid%jindx1_ci = clear_val - Grid%jindx2_ci = clear_val - Grid%ddx_ci = clear_val - Grid%iindx1_ci = clear_val - Grid%iindx2_ci = clear_val + Grid%ddy_ci = Model%clear_val + Grid%jindx1_ci = Model%clear_val + Grid%jindx2_ci = Model%clear_val + Grid%ddx_ci = Model%clear_val + Grid%iindx1_ci = Model%clear_val + Grid%iindx2_ci = Model%clear_val endif !--- iaerclm active @@ -7546,12 +7656,12 @@ subroutine grid_create (Grid, Model) allocate (Grid%iindx1_aer(IM)) allocate (Grid%iindx2_aer(IM)) - Grid%ddy_aer = clear_val - Grid%jindx1_aer = clear_val - Grid%jindx2_aer = clear_val - Grid%ddx_aer = clear_val - Grid%iindx1_aer = clear_val - Grid%iindx2_aer = clear_val + Grid%ddy_aer = Model%clear_val + Grid%jindx1_aer = Model%clear_val + Grid%jindx2_aer = Model%clear_val + Grid%ddx_aer = Model%clear_val + Grid%iindx1_aer = Model%clear_val + Grid%iindx2_aer = Model%clear_val endif !--- Model%do_ugwpv1 @@ -7561,10 +7671,10 @@ subroutine grid_create (Grid, Model) allocate (Grid%jindx1_tau (IM)) allocate (Grid%jindx2_tau (IM)) - Grid%ddy_j1tau = clear_val - Grid%ddy_j2tau = clear_val - Grid%jindx1_tau = clear_val - Grid%jindx2_tau = clear_val + Grid%ddy_j1tau = Model%clear_val + Grid%ddy_j2tau = Model%clear_val + Grid%jindx1_tau = Model%clear_val + Grid%jindx2_tau = Model%clear_val endif end subroutine grid_create @@ -7587,11 +7697,11 @@ subroutine tbd_create (Tbd, Model) if ( Model%isubc_lw == 2 .or. Model%isubc_sw == 2 ) then allocate (Tbd%icsdsw (IM)) allocate (Tbd%icsdlw (IM)) - Tbd%icsdsw = zero - Tbd%icsdlw = zero + Tbd%icsdsw = Model%zero + Tbd%icsdlw = Model%zero if (Model%lrseeds) then allocate (Tbd%rseeds(IM,Model%nrstreams)) - Tbd%rseeds = zero + Tbd%rseeds = Model%zero endif endif @@ -7601,32 +7711,35 @@ subroutine tbd_create (Tbd, Model) if(Model%num_dfi_radar>0) then allocate (Tbd%dfi_radar_tten(IM,Model%levs,Model%num_dfi_radar)) Tbd%dfi_radar_tten = -20.0 - Tbd%dfi_radar_tten(:,1,:) = zero + Tbd%dfi_radar_tten(:,1,:) = Model%zero if(Model%do_cap_suppress) then allocate (Tbd%cap_suppress(IM,Model%num_dfi_radar)) - Tbd%cap_suppress(:,:) = zero + Tbd%cap_suppress(:,:) = Model%zero endif endif !--- ozone and stratosphere h2o needs allocate (Tbd%ozpl (IM,Model%levozp,Model%oz_coeff)) allocate (Tbd%h2opl (IM,Model%levh2o,Model%h2o_coeff)) - Tbd%h2opl = clear_val - Tbd%ozpl = clear_val + Tbd%h2opl = Model%clear_val + Tbd%ozpl = Model%clear_val !--- ccn and in needs allocate (Tbd%in_nm (IM,Model%levs)) allocate (Tbd%ccn_nm (IM,Model%levs)) - Tbd%in_nm = clear_val - Tbd%ccn_nm = clear_val + Tbd%in_nm = Model%clear_val + Tbd%ccn_nm = Model%clear_val !--- aerosol fields - allocate (Tbd%aer_nm (IM,Model%levs,ntrcaer)) - Tbd%aer_nm = clear_val + ! DH* allocate only for MG? *DH + if (Model%iaerclm) then + allocate (Tbd%aer_nm (IM,Model%levs,Model%ntrcaer)) + Tbd%aer_nm = Model%clear_val + endif !--- tau_amf for NGWs allocate (Tbd%tau_amf(im) ) - Tbd%tau_amf = clear_val + Tbd%tau_amf = Model%clear_val !--- maps of local index ix to global indices i and j for this block allocate (Tbd%imap (IM)) @@ -7635,81 +7748,81 @@ subroutine tbd_create (Tbd, Model) Tbd%jmap = 0 allocate (Tbd%rann (IM,Model%nrcm)) - Tbd%rann = rann_init + Tbd%rann = Model%rann_init !--- In/Out allocate (Tbd%acv (IM)) allocate (Tbd%acvb (IM)) allocate (Tbd%acvt (IM)) - Tbd%acv = clear_val - Tbd%acvb = clear_val - Tbd%acvt = clear_val + Tbd%acv = Model%clear_val + Tbd%acvb = Model%clear_val + Tbd%acvt = Model%clear_val if (Model%cplflx .or. Model%cplchm .or. Model%cpllnd) then allocate (Tbd%drain_cpl (IM)) allocate (Tbd%dsnow_cpl (IM)) - Tbd%drain_cpl = clear_val - Tbd%dsnow_cpl = clear_val + Tbd%drain_cpl = Model%clear_val + Tbd%dsnow_cpl = Model%clear_val endif if (Model%do_sppt .or. Model%ca_global) then allocate (Tbd%dtdtnp (IM,Model%levs)) allocate (Tbd%dtotprcp (IM)) allocate (Tbd%dcnvprcp (IM)) - Tbd%dtdtnp = clear_val - Tbd%dtotprcp = clear_val - Tbd%dcnvprcp = clear_val + Tbd%dtdtnp = Model%clear_val + Tbd%dtotprcp = Model%clear_val + Tbd%dcnvprcp = Model%clear_val endif allocate (Tbd%phy_f2d (IM,Model%ntot2d)) allocate (Tbd%phy_f3d (IM,Model%levs,Model%ntot3d)) - Tbd%phy_f2d = clear_val - Tbd%phy_f3d = clear_val + Tbd%phy_f2d = Model%clear_val + Tbd%phy_f3d = Model%clear_val if (Model%nctp > 0 .and. Model%cscnv) then allocate (Tbd%phy_fctd (IM,Model%nctp)) - Tbd%phy_fctd = clear_val + Tbd%phy_fctd = Model%clear_val endif ! if (Model%do_shoc) Tbd%phy_f3d(:,1,Model%ntot3d-1) = 3.0 ! if (Model%do_shoc) Tbd%phy_f3d(:,:,Model%ntot3d-1) = 1.0 allocate (Tbd%hpbl (IM)) - Tbd%hpbl = clear_val + Tbd%hpbl = Model%clear_val ! Allocate horizontal component of dku for dyn_core (SA-3D-TKE) allocate (Tbd%dku3d_h (IM,Model%levs)) - Tbd%dku3d_h = clear_val + Tbd%dku3d_h = Model%clear_val allocate (Tbd%dku3d_e (IM,Model%levs)) - Tbd%dku3d_e = clear_val + Tbd%dku3d_e = Model%clear_val if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke .or. Model%imfdeepcnv == Model%imfdeepcnv_samf .or. Model%imfshalcnv == Model%imfshalcnv_samf .or. Model%imfdeepcnv == Model%imfdeepcnv_c3 .or. Model%imfshalcnv == Model%imfshalcnv_c3) then allocate (Tbd%prevsq(IM, Model%levs)) - Tbd%prevsq = clear_val + Tbd%prevsq = Model%clear_val endif if (Model%imfdeepcnv .ge. 0 .or. Model%imfshalcnv .ge. 0) then allocate (Tbd%ud_mf(IM, Model%levs)) - Tbd%ud_mf = zero + Tbd%ud_mf = Model%zero endif if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke .or. Model%imfdeepcnv == Model%imfdeepcnv_c3) then allocate (Tbd%forcet(IM, Model%levs)) allocate (Tbd%forceq(IM, Model%levs)) allocate (Tbd%prevst(IM, Model%levs)) - Tbd%forcet = clear_val - Tbd%forceq = clear_val - Tbd%prevst = clear_val + Tbd%forcet = Model%clear_val + Tbd%forceq = Model%clear_val + Tbd%prevst = Model%clear_val end if if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_c3) then allocate (Tbd%cactiv(IM)) allocate (Tbd%cactiv_m(IM)) allocate (Tbd%aod_gf(IM)) - Tbd%cactiv = zero - Tbd%cactiv_m = zero - Tbd%aod_gf = zero + Tbd%cactiv = Model%zero + Tbd%cactiv_m = Model%zero + Tbd%aod_gf = Model%zero end if !--- MYNN variables: @@ -7726,16 +7839,16 @@ subroutine tbd_create (Tbd, Model) allocate (Tbd%qsq (IM,Model%levs)) allocate (Tbd%cov (IM,Model%levs)) !print*,"Allocating all MYNN-EDMF variables:" - Tbd%cldfra_bl = clear_val - Tbd%qc_bl = clear_val - Tbd%qi_bl = clear_val - Tbd%el_pbl = clear_val - Tbd%sh3d = clear_val - Tbd%sm3d = clear_val - Tbd%qke = zero - Tbd%tsq = clear_val - Tbd%qsq = clear_val - Tbd%cov = clear_val + Tbd%cldfra_bl = Model%clear_val + Tbd%qc_bl = Model%clear_val + Tbd%qi_bl = Model%clear_val + Tbd%el_pbl = Model%clear_val + Tbd%sh3d = Model%clear_val + Tbd%sm3d = Model%clear_val + Tbd%qke = Model%zero + Tbd%tsq = Model%clear_val + Tbd%qsq = Model%clear_val + Tbd%cov = Model%clear_val end if ! MYJ variables @@ -7754,18 +7867,18 @@ subroutine tbd_create (Tbd, Model) allocate (Tbd%phy_myj_a1t (IM)) allocate (Tbd%phy_myj_a1q (IM)) !print*,"Allocating all MYJ schemes variables:" - Tbd%phy_myj_qsfc = clear_val - Tbd%phy_myj_thz0 = clear_val - Tbd%phy_myj_qz0 = clear_val - Tbd%phy_myj_uz0 = clear_val - Tbd%phy_myj_vz0 = clear_val - Tbd%phy_myj_akhs = clear_val - Tbd%phy_myj_akms = clear_val - Tbd%phy_myj_chkqlm = clear_val - Tbd%phy_myj_elflx = clear_val - Tbd%phy_myj_a1u = clear_val - Tbd%phy_myj_a1t = clear_val - Tbd%phy_myj_a1q = clear_val + Tbd%phy_myj_qsfc = Model%clear_val + Tbd%phy_myj_thz0 = Model%clear_val + Tbd%phy_myj_qz0 = Model%clear_val + Tbd%phy_myj_uz0 = Model%clear_val + Tbd%phy_myj_vz0 = Model%clear_val + Tbd%phy_myj_akhs = Model%clear_val + Tbd%phy_myj_akms = Model%clear_val + Tbd%phy_myj_chkqlm = Model%clear_val + Tbd%phy_myj_elflx = Model%clear_val + Tbd%phy_myj_a1u = Model%clear_val + Tbd%phy_myj_a1t = Model%clear_val + Tbd%phy_myj_a1q = Model%clear_val end if end subroutine tbd_create @@ -7789,11 +7902,10 @@ subroutine cldprop_create (Cldprop, Model) allocate (Cldprop%cvb (IM)) allocate (Cldprop%cnvw(IM, Model%levs)) - Cldprop%cv = clear_val - Cldprop%cvt = clear_val - Cldprop%cvb = clear_val - Cldprop%cnvw = clear_val - + Cldprop%cv = Model%clear_val + Cldprop%cvt = Model%clear_val + Cldprop%cvb = Model%clear_val + Cldprop%cnvw = Model%clear_val end subroutine cldprop_create @@ -7814,14 +7926,14 @@ subroutine radtend_create (Radtend, Model) allocate (Radtend%sfcfsw (IM)) allocate (Radtend%sfcflw (IM)) - Radtend%sfcfsw%upfxc = clear_val - Radtend%sfcfsw%upfx0 = clear_val - Radtend%sfcfsw%dnfxc = clear_val - Radtend%sfcfsw%dnfx0 = clear_val - Radtend%sfcflw%upfxc = clear_val - Radtend%sfcflw%upfx0 = clear_val - Radtend%sfcflw%dnfxc = clear_val - Radtend%sfcflw%dnfx0 = clear_val + Radtend%sfcfsw%upfxc = Model%clear_val + Radtend%sfcfsw%upfx0 = Model%clear_val + Radtend%sfcfsw%dnfxc = Model%clear_val + Radtend%sfcfsw%dnfx0 = Model%clear_val + Radtend%sfcflw%upfxc = Model%clear_val + Radtend%sfcflw%upfx0 = Model%clear_val + Radtend%sfcflw%dnfxc = Model%clear_val + Radtend%sfcflw%dnfx0 = Model%clear_val allocate (Radtend%htrsw (IM,Model%levs)) allocate (Radtend%htrlw (IM,Model%levs)) @@ -7831,27 +7943,27 @@ subroutine radtend_create (Radtend, Model) allocate (Radtend%semis (IM)) allocate (Radtend%ext550 (IM,Model%levs)) - Radtend%htrsw = clear_val - Radtend%htrlw = clear_val - Radtend%sfalb = clear_val - Radtend%coszen = clear_val - Radtend%tsflw = clear_val - Radtend%semis = clear_val - Radtend%ext550 = clear_val + Radtend%htrsw = Model%clear_val + Radtend%htrlw = Model%clear_val + Radtend%sfalb = Model%clear_val + Radtend%coszen = Model%clear_val + Radtend%tsflw = Model%clear_val + Radtend%semis = Model%clear_val + Radtend%ext550 = Model%clear_val !--- In/Out (???) (radiation only) allocate (Radtend%coszdg (IM)) - Radtend%coszdg = clear_val + Radtend%coszdg = Model%clear_val !--- In/Out (???) (physics only) allocate (Radtend%swhc (IM,Model%levs)) allocate (Radtend%lwhc (IM,Model%levs)) allocate (Radtend%lwhd (IM,Model%levs,6)) - Radtend%lwhd = clear_val - Radtend%lwhc = clear_val - Radtend%swhc = clear_val + Radtend%lwhd = Model%clear_val + Radtend%lwhc = Model%clear_val + Radtend%swhc = Model%clear_val end subroutine radtend_create @@ -8092,16 +8204,16 @@ subroutine diag_create (Diag, Model) if(Model%print_diff_pgr) then allocate (Diag%old_pgr(IM)) - Diag%old_pgr = clear_val + Diag%old_pgr = Model%clear_val endif if(Model%lightning_threat) then allocate (Diag%ltg1_max(IM)) allocate (Diag%ltg2_max(IM)) allocate (Diag%ltg3_max(IM)) - Diag%ltg1_max = zero - Diag%ltg2_max = zero - Diag%ltg3_max = zero + Diag%ltg1_max = Model%zero + Diag%ltg2_max = Model%zero + Diag%ltg3_max = Model%zero endif !--- Radiation @@ -8199,7 +8311,7 @@ subroutine diag_create (Diag, Model) allocate (Diag%frozrb (IM)) allocate (Diag%tsnowp (IM)) allocate (Diag%tsnowpb (IM)) - if (.not. Model%lsm == Model%lsm_ruc) then + if (.not. Model%lsm == Model%ilsm_ruc) then allocate (Diag%wet1 (IM)) end if allocate (Diag%sr (IM)) @@ -8209,7 +8321,7 @@ subroutine diag_create (Diag, Model) allocate (Diag%tdoms (IM)) allocate (Diag%zmtnblck (IM)) - if(Model%lsm == Model%lsm_noahmp) then + if(Model%lsm == Model%ilsm_noahmp) then allocate (Diag%paha (IM)) allocate (Diag%twa (IM)) allocate (Diag%pahi (IM)) @@ -8219,7 +8331,7 @@ subroutine diag_create (Diag, Model) if (Model%imp_physics == Model%imp_physics_fer_hires) then allocate (Diag%train (IM,Model%levs)) end if - allocate (Diag%cldfra (IM,Model%levr+LTP)) + allocate (Diag%cldfra (IM,Model%levr+Model%LTP)) allocate (Diag%cldfra2d (IM)) allocate (Diag%total_albedo (IM)) allocate (Diag%lwp_ex (IM)) @@ -8230,7 +8342,7 @@ subroutine diag_create (Diag, Model) !--- 3D diagnostics if (Model%ldiag3d) then allocate (Diag%dtend(IM,Model%levs,Model%ndtend)) - Diag%dtend = clear_val + Diag%dtend = Model%clear_val if (Model%qdiag3d) then allocate (Diag%upd_mf (IM,Model%levs)) allocate (Diag%dwn_mf (IM,Model%levs)) @@ -8352,43 +8464,43 @@ subroutine diag_create (Diag, Model) allocate (Diag%exch_h (IM,Model%levs)) allocate (Diag%exch_m (IM,Model%levs)) if (Model%bl_mynn_output .ne. 0) then - Diag%edmf_a = clear_val - Diag%edmf_w = clear_val - Diag%edmf_qt = clear_val - Diag%edmf_thl = clear_val - Diag%edmf_ent = clear_val - Diag%edmf_qc = clear_val - Diag%sub_thl = clear_val - Diag%sub_sqv = clear_val - Diag%det_thl = clear_val - Diag%det_sqv = clear_val + Diag%edmf_a = Model%clear_val + Diag%edmf_w = Model%clear_val + Diag%edmf_qt = Model%clear_val + Diag%edmf_thl = Model%clear_val + Diag%edmf_ent = Model%clear_val + Diag%edmf_qc = Model%clear_val + Diag%sub_thl = Model%clear_val + Diag%sub_sqv = Model%clear_val + Diag%det_thl = Model%clear_val + Diag%det_sqv = Model%clear_val endif if (Model%tke_budget .gt. 0) then - Diag%dqke = clear_val - Diag%qwt = clear_val - Diag%qshear = clear_val - Diag%qbuoy = clear_val - Diag%qdiss = clear_val + Diag%dqke = Model%clear_val + Diag%qwt = Model%clear_val + Diag%qshear = Model%clear_val + Diag%qbuoy = Model%clear_val + Diag%qdiss = Model%clear_val endif - Diag%maxwidth = clear_val - Diag%maxmf = clear_val - Diag%ztop_plume = clear_val + Diag%maxwidth = Model%clear_val + Diag%maxmf = Model%clear_val + Diag%ztop_plume = Model%clear_val Diag%ktop_plume = 0 - Diag%exch_h = clear_val - Diag%exch_m = clear_val + Diag%exch_h = Model%clear_val + Diag%exch_m = Model%clear_val endif ! Extended diagnostics for Thompson MP if (Model%ext_diag_thompson) then allocate (Diag%thompson_ext_diag3d(IM,Model%levs,Model%thompson_ext_ndiag3d)) - Diag%thompson_ext_diag3d = clear_val + Diag%thompson_ext_diag3d = Model%clear_val endif ! Air quality diagnostics ! -- initialize diagnostic variables if (Model%cplaqm) then allocate (Diag%aod(IM)) - Diag%aod = zero + Diag%aod = Model%zero end if !IVAI: @@ -8398,30 +8510,30 @@ subroutine diag_create (Diag, Model) !IVAI: photdiag arrays allocate (Diag%coszens(IM)) - Diag%coszens= zero + Diag%coszens= Model%zero allocate (Diag%jo3o1d(IM)) - Diag%jo3o1d = zero + Diag%jo3o1d = Model%zero allocate (Diag%jno2(IM)) - Diag%jno2 = zero + Diag%jno2 = Model%zero !IVAI: canopy arrays read via aqm_emis_read if (Model%do_canopy) then allocate (Diag%claie(IM)) - Diag%claie = zero + Diag%claie = Model%zero allocate (Diag%cfch (IM)) - Diag%cfch = zero + Diag%cfch = Model%zero allocate (Diag%cfrt (IM)) - Diag%cfrt = zero + Diag%cfrt = Model%zero allocate (Diag%cclu (IM)) - Diag%cclu = zero + Diag%cclu = Model%zero allocate (Diag%cpopu (IM)) - Diag%cpopu = zero + Diag%cpopu = Model%zero end if! (Model%do_canopy) end if ! (Model%cplaqm) @@ -8430,11 +8542,11 @@ subroutine diag_create (Diag, Model) ! Auxiliary arrays in output for debugging if (Model%naux2d>0) then allocate (Diag%aux2d(IM,Model%naux2d)) - Diag%aux2d = clear_val + Diag%aux2d = Model%clear_val endif if (Model%naux3d>0) then allocate (Diag%aux3d(IM,Model%levs,Model%naux3d)) - Diag%aux3d = clear_val + Diag%aux3d = Model%clear_val endif call Diag%rad_zero (Model) @@ -8453,12 +8565,12 @@ subroutine diag_rad_zero(Diag, Model) class(GFS_diag_type) :: Diag type(GFS_control_type), intent(in) :: Model - Diag%fluxr = zero - Diag%topfsw%upfxc = zero - Diag%topfsw%dnfxc = zero - Diag%topfsw%upfx0 = zero - Diag%topflw%upfxc = zero - Diag%topflw%upfx0 = zero + Diag%fluxr = Model%zero + Diag%topfsw%upfxc = Model%zero + Diag%topfsw%dnfxc = Model%zero + Diag%topfsw%upfx0 = Model%zero + Diag%topflw%upfxc = Model%zero + Diag%topflw%upfx0 = Model%zero end subroutine diag_rad_zero @@ -8473,225 +8585,225 @@ subroutine diag_phys_zero (Diag, Model, linit, iauwindow_center) logical set_totprcp !--- In/Out - Diag%srunoff = zero - Diag%evbsa = zero - Diag%evcwa = zero - Diag%snohfa = zero - Diag%transa = zero - Diag%snowca = zero - Diag%sbsnoa = zero - Diag%sbsno = zero - Diag%evbs = zero - Diag%evcw = zero - Diag%trans = zero - Diag%snowmt_land= zero - Diag%snowmt_ice = zero - Diag%soilm = zero + Diag%srunoff = Model%zero + Diag%evbsa = Model%zero + Diag%evcwa = Model%zero + Diag%snohfa = Model%zero + Diag%transa = Model%zero + Diag%snowca = Model%zero + Diag%sbsnoa = Model%zero + Diag%sbsno = Model%zero + Diag%evbs = Model%zero + Diag%evcw = Model%zero + Diag%trans = Model%zero + Diag%snowmt_land= Model%zero + Diag%snowmt_ice = Model%zero + Diag%soilm = Model%zero Diag%tmpmin = Model%huge - Diag%tmpmax = zero - Diag%dusfc = zero - Diag%dvsfc = zero - Diag%dtsfc = zero - Diag%dqsfc = zero - Diag%gflux = zero - Diag%dlwsfc = zero - Diag%ulwsfc = zero - Diag%suntim = zero - Diag%runoff = zero - Diag%tecan = zero - Diag%tetran = zero - Diag%tedir = zero - Diag%ep = zero - Diag%cldwrk = zero - Diag%dugwd = zero - Diag%dvgwd = zero - Diag%psmean = zero + Diag%tmpmax = Model%zero + Diag%dusfc = Model%zero + Diag%dvsfc = Model%zero + Diag%dtsfc = Model%zero + Diag%dqsfc = Model%zero + Diag%gflux = Model%zero + Diag%dlwsfc = Model%zero + Diag%ulwsfc = Model%zero + Diag%suntim = Model%zero + Diag%runoff = Model%zero + Diag%tecan = Model%zero + Diag%tetran = Model%zero + Diag%tedir = Model%zero + Diag%ep = Model%zero + Diag%cldwrk = Model%zero + Diag%dugwd = Model%zero + Diag%dvgwd = Model%zero + Diag%psmean = Model%zero Diag%spfhmin = Model%huge - Diag%spfhmax = zero - Diag%u10mmax = zero - Diag%v10mmax = zero - Diag%wind10mmax = zero - Diag%u10max = zero - Diag%v10max = zero - Diag%spd10max = zero - Diag%rain = zero - Diag%rainc = zero - Diag%ice = zero - Diag%snow = zero - Diag%graupel = zero + Diag%spfhmax = Model%zero + Diag%u10mmax = Model%zero + Diag%v10mmax = Model%zero + Diag%wind10mmax = Model%zero + Diag%u10max = Model%zero + Diag%v10max = Model%zero + Diag%spd10max = Model%zero + Diag%rain = Model%zero + Diag%rainc = Model%zero + Diag%ice = Model%zero + Diag%snow = Model%zero + Diag%graupel = Model%zero !--- Out - Diag%u10m = zero - Diag%v10m = zero - Diag%dpt2m = zero - Diag%zlvl = zero - Diag%psurf = zero - Diag%pwat = zero - Diag%t1 = zero - Diag%q1 = zero - Diag%u1 = zero - Diag%v1 = zero - Diag%chh = zero - Diag%cmm = zero - Diag%dlwsfci = zero - Diag%ulwsfci = zero - Diag%dswsfci = zero - Diag%dswsfcci = zero - Diag%nswsfci = zero - Diag%uswsfci = zero - Diag%dusfci = zero - Diag%dvsfci = zero - Diag%dtsfci = zero - Diag%dqsfci = zero - Diag%gfluxi = zero - Diag%epi = zero - Diag%smcwlt2 = zero - Diag%smcref2 = zero - if (.not. Model%lsm == Model%lsm_ruc) then - Diag%wet1 = zero + Diag%u10m = Model%zero + Diag%v10m = Model%zero + Diag%dpt2m = Model%zero + Diag%zlvl = Model%zero + Diag%psurf = Model%zero + Diag%pwat = Model%zero + Diag%t1 = Model%zero + Diag%q1 = Model%zero + Diag%u1 = Model%zero + Diag%v1 = Model%zero + Diag%chh = Model%zero + Diag%cmm = Model%zero + Diag%dlwsfci = Model%zero + Diag%ulwsfci = Model%zero + Diag%dswsfci = Model%zero + Diag%dswsfcci = Model%zero + Diag%nswsfci = Model%zero + Diag%uswsfci = Model%zero + Diag%dusfci = Model%zero + Diag%dvsfci = Model%zero + Diag%dtsfci = Model%zero + Diag%dqsfci = Model%zero + Diag%gfluxi = Model%zero + Diag%epi = Model%zero + Diag%smcwlt2 = Model%zero + Diag%smcref2 = Model%zero + if (.not. Model%lsm == Model%ilsm_ruc) then + Diag%wet1 = Model%zero end if - Diag%sr = zero - Diag%tdomr = zero - Diag%tdomzr = zero - Diag%tdomip = zero - Diag%tdoms = zero - Diag%zmtnblck = zero - - if(Model%lsm == Model%lsm_noahmp)then - Diag%paha = zero - Diag%twa = zero - Diag%pahi = zero + Diag%sr = Model%zero + Diag%tdomr = Model%zero + Diag%tdomzr = Model%zero + Diag%tdomip = Model%zero + Diag%tdoms = Model%zero + Diag%zmtnblck = Model%zero + + if(Model%lsm == Model%ilsm_noahmp)then + Diag%paha = Model%zero + Diag%twa = Model%zero + Diag%pahi = Model%zero endif if (Model%imp_physics == Model%imp_physics_fer_hires) then - Diag%train = zero + Diag%train = Model%zero end if - Diag%cldfra = zero - Diag%cldfra2d = zero - Diag%total_albedo = zero - Diag%lwp_ex = zero - Diag%iwp_ex = zero - Diag%lwp_fc = zero - Diag%iwp_fc = zero - - Diag%totprcpb = zero - Diag%cnvprcpb = zero - Diag%toticeb = zero - Diag%totsnwb = zero - Diag%totgrpb = zero - Diag%frzrb = zero - Diag%frozrb = zero - Diag%tsnowpb = zero + Diag%cldfra = Model%zero + Diag%cldfra2d = Model%zero + Diag%total_albedo = Model%zero + Diag%lwp_ex = Model%zero + Diag%iwp_ex = Model%zero + Diag%lwp_fc = Model%zero + Diag%iwp_fc = Model%zero + + Diag%totprcpb = Model%zero + Diag%cnvprcpb = Model%zero + Diag%toticeb = Model%zero + Diag%totsnwb = Model%zero + Diag%totgrpb = Model%zero + Diag%frzrb = Model%zero + Diag%frozrb = Model%zero + Diag%tsnowpb = Model%zero !--- MYNN variables: if (Model%do_mynnedmf) then if (Model%bl_mynn_output .ne. 0) then - Diag%edmf_a = clear_val - Diag%edmf_w = clear_val - Diag%edmf_qt = clear_val - Diag%edmf_thl = clear_val - Diag%edmf_ent = clear_val - Diag%edmf_qc = clear_val - Diag%sub_thl = clear_val - Diag%sub_sqv = clear_val - Diag%det_thl = clear_val - Diag%det_sqv = clear_val + Diag%edmf_a = Model%clear_val + Diag%edmf_w = Model%clear_val + Diag%edmf_qt = Model%clear_val + Diag%edmf_thl = Model%clear_val + Diag%edmf_ent = Model%clear_val + Diag%edmf_qc = Model%clear_val + Diag%sub_thl = Model%clear_val + Diag%sub_sqv = Model%clear_val + Diag%det_thl = Model%clear_val + Diag%det_sqv = Model%clear_val endif - Diag%maxwidth = clear_val - Diag%maxmf = clear_val - Diag%ztop_plume = clear_val + Diag%maxwidth = Model%clear_val + Diag%maxmf = Model%clear_val + Diag%ztop_plume = Model%clear_val Diag%ktop_plume = 0 - Diag%exch_h = clear_val - Diag%exch_m = clear_val + Diag%exch_h = Model%clear_val + Diag%exch_m = Model%clear_val endif ! if(Model%me == Model%master) print *,'in diag_phys_zero, totprcpb set to 0,kdt=',Model%kdt if (Model%ldiag3d) then - Diag%dtend = zero + Diag%dtend = Model%zero if (Model%qdiag3d) then - Diag%upd_mf = zero - Diag%dwn_mf = zero - Diag%det_mf = zero + Diag%upd_mf = Model%zero + Diag%dwn_mf = Model%zero + Diag%det_mf = Model%zero endif if (Model%oz_phys_2015) then - Diag%do3_dt_prd = zero - Diag%do3_dt_ozmx = zero - Diag%do3_dt_temp = zero - Diag%do3_dt_ohoz = zero + Diag%do3_dt_prd = Model%zero + Diag%do3_dt_ozmx = Model%zero + Diag%do3_dt_temp = Model%zero + Diag%do3_dt_ohoz = Model%zero endif if (Model%h2o_phys) then - Diag%dqv_dt_prd = zero - Diag%dqv_dt_qvmx = zero + Diag%dqv_dt_prd = Model%zero + Diag%dqv_dt_qvmx = Model%zero end if endif ! ! UGWP - Diag%zmtb = zero - Diag%zogw = zero - Diag%zlwb = zero - Diag%tau_mtb = zero - Diag%tau_ogw = zero - Diag%tau_ngw = zero - Diag%tau_tofd = zero - Diag%dudt_gw = zero - Diag%dvdt_gw = zero - Diag%dtdt_gw = zero - Diag%kdis_gw = zero - - Diag%dudt_ogw = zero + Diag%zmtb = Model%zero + Diag%zogw = Model%zero + Diag%zlwb = Model%zero + Diag%tau_mtb = Model%zero + Diag%tau_ogw = Model%zero + Diag%tau_ngw = Model%zero + Diag%tau_tofd = Model%zero + Diag%dudt_gw = Model%zero + Diag%dvdt_gw = Model%zero + Diag%dtdt_gw = Model%zero + Diag%kdis_gw = Model%zero + + Diag%dudt_ogw = Model%zero if (Model%do_ugwp_v1 .or. Model%ldiag_ugwp) then - Diag%dvdt_ogw = zero - Diag%dudt_obl = zero - Diag%dvdt_obl = zero - Diag%dudt_oss = zero - Diag%dvdt_oss = zero - Diag%dudt_ofd = zero - Diag%dvdt_ofd = zero - Diag%du_ogwcol = zero - Diag%dv_ogwcol = zero - Diag%du_oblcol = zero - Diag%dv_oblcol = zero - Diag%du_osscol = zero - Diag%dv_osscol = zero - Diag%du_ofdcol = zero - Diag%dv_ofdcol = zero - Diag%du3_ogwcol = zero - Diag%dv3_ogwcol = zero - Diag%du3_oblcol = zero - Diag%dv3_oblcol = zero - Diag%du3_osscol = zero - Diag%dv3_osscol = zero - Diag%du3_ofdcol = zero - Diag%dv3_ofdcol = zero + Diag%dvdt_ogw = Model%zero + Diag%dudt_obl = Model%zero + Diag%dvdt_obl = Model%zero + Diag%dudt_oss = Model%zero + Diag%dvdt_oss = Model%zero + Diag%dudt_ofd = Model%zero + Diag%dvdt_ofd = Model%zero + Diag%du_ogwcol = Model%zero + Diag%dv_ogwcol = Model%zero + Diag%du_oblcol = Model%zero + Diag%dv_oblcol = Model%zero + Diag%du_osscol = Model%zero + Diag%dv_osscol = Model%zero + Diag%du_ofdcol = Model%zero + Diag%dv_ofdcol = Model%zero + Diag%du3_ogwcol = Model%zero + Diag%dv3_ogwcol = Model%zero + Diag%du3_oblcol = Model%zero + Diag%dv3_oblcol = Model%zero + Diag%du3_osscol = Model%zero + Diag%dv3_osscol = Model%zero + Diag%du3_ofdcol = Model%zero + Diag%dv3_ofdcol = Model%zero end if if (Model%ldiag_ugwp) then - Diag%du3dt_ogw = zero - Diag%du3dt_mtb = zero - Diag%du3dt_tms = zero - Diag%du3dt_ngw = zero - Diag%dv3dt_ngw = zero - Diag%dws3dt_ogw = zero - Diag%dws3dt_obl = zero - Diag%dws3dt_oss = zero - Diag%dws3dt_ofd = zero - Diag%ldu3dt_ogw = zero - Diag%ldu3dt_obl = zero - Diag%ldu3dt_oss = zero - Diag%ldu3dt_ofd = zero - Diag%ldu3dt_ngw = zero - Diag%ldv3dt_ngw = zero - Diag%ldt3dt_ngw = zero + Diag%du3dt_ogw = Model%zero + Diag%du3dt_mtb = Model%zero + Diag%du3dt_tms = Model%zero + Diag%du3dt_ngw = Model%zero + Diag%dv3dt_ngw = Model%zero + Diag%dws3dt_ogw = Model%zero + Diag%dws3dt_obl = Model%zero + Diag%dws3dt_oss = Model%zero + Diag%dws3dt_ofd = Model%zero + Diag%ldu3dt_ogw = Model%zero + Diag%ldu3dt_obl = Model%zero + Diag%ldu3dt_oss = Model%zero + Diag%ldu3dt_ofd = Model%zero + Diag%ldu3dt_ngw = Model%zero + Diag%ldv3dt_ngw = Model%zero + Diag%ldt3dt_ngw = Model%zero endif ! !----------------------------- ! Extra PBL diagnostics - Diag%dkt = zero - Diag%dku = zero + Diag%dkt = Model%zero + Diag%dku = Model%zero ! max hourly diagnostics Diag%refl_10cm = -35. @@ -8708,25 +8820,200 @@ subroutine diag_phys_zero (Diag, Model, linit, iauwindow_center) if (present(linit) ) set_totprcp = linit if (present(iauwindow_center) ) set_totprcp = iauwindow_center if (set_totprcp) then - Diag%totprcp = zero - Diag%cnvprcp = zero - Diag%totice = zero - Diag%totsnw = zero - Diag%totgrp = zero - Diag%frzr = zero - Diag%frozr = zero - Diag%tsnowp = zero + Diag%totprcp = Model%zero + Diag%cnvprcp = Model%zero + Diag%totice = Model%zero + Diag%totsnw = Model%zero + Diag%totgrp = Model%zero + Diag%frzr = Model%zero + Diag%frozr = Model%zero + Diag%tsnowp = Model%zero endif ! GSL lightning threat indexes if(Model%lightning_threat) then - Diag%ltg1_max = zero - Diag%ltg2_max = zero - Diag%ltg3_max = zero + Diag%ltg1_max = Model%zero + Diag%ltg2_max = Model%zero + Diag%ltg3_max = Model%zero endif end subroutine diag_phys_zero + subroutine gfs_setup_tracers(Model) + implicit none + + type(GFS_control_type), intent(inout) :: Model + integer :: n, tracers + logical :: ltest + + ! Initialize + Model%nvdiff = Model%ntrac + Model%mg3_as_mg2 = .false. + Model%nn = Model%ntrac + 1 + Model%otspt(:,:) = .true. + Model%otsptflag(:) = .true. + + ! Perform aerosol convective transport and PBL diffusion? + Model%trans_aero = Model%cplchm .and. Model%trans_trac + + if (Model%imp_physics == Model%imp_physics_thompson) then + if (Model%ltaerosol) then + Model%nvdiff = 12 + else if (Model%mraerosol) then + Model%nvdiff = 10 + else + Model%nvdiff = 9 + endif + if (Model%satmedmf) Model%nvdiff = Model%nvdiff + 1 + elseif ( Model%imp_physics == Model%imp_physics_nssl ) then + if (Model%me == Model%master) write(0,*) 'nssl_settings1: nvdiff,ntrac = ', Model%nvdiff, Model%ntrac + IF ( Model%nssl_hail_on ) THEN + Model%nvdiff = 16 ! Model%ntrac ! 17 + ELSE + Model%nvdiff = 13 ! turn off hail q,N, and volume + ENDIF + if (Model%satmedmf) Model%nvdiff = Model%nvdiff + 1 + IF ( Model%nssl_ccn_on ) THEN + Model%nvdiff = Model%nvdiff + 1 + ENDIF + if (Model%me == Model%master) write(0,*) 'nssl_settings2: nvdiff,ntrac = ', Model%nvdiff, Model%ntrac + elseif (Model%imp_physics == Model%imp_physics_wsm6) then + Model%nvdiff = Model%ntrac -3 + if (Model%satmedmf) Model%nvdiff = Model%nvdiff + 1 + elseif (Model%ntclamt > 0) then ! for GFDL MP don't diffuse cloud amount + Model%nvdiff = Model%ntrac - 1 + endif + + if (Model%imp_physics == Model%imp_physics_mg) then + if (abs(Model%fprcp) == 1) then + Model%mg3_as_mg2 = .false. + elseif (Model%fprcp >= 2) then + if(Model%ntgl > 0 .and. (Model%mg_do_graupel .or. Model%mg_do_hail)) then + Model%mg3_as_mg2 = .false. + else ! MG3 code run without graupel/hail i.e. as MG2 + Model%mg3_as_mg2 = .true. + endif + endif + endif + + Model%nscav = Model%ntrac - Model%ncnd + 2 + + if (Model%nvdiff == Model%ntrac) then + Model%ntcwx = Model%ntcw + Model%ntiwx = Model%ntiw + Model%ntrwx = Model%ntrw + else + if (Model%imp_physics == Model%imp_physics_wsm6) then + Model%ntcwx = 2 + Model%ntiwx = 3 + elseif (Model%imp_physics == Model%imp_physics_thompson) then + Model%ntcwx = 2 + Model%ntiwx = 3 + Model%ntrwx = 4 + elseif (Model%imp_physics == Model%imp_physics_nssl) then + Model%ntcwx = 2 + Model%ntiwx = 3 + Model%ntrwx = 4 + elseif (Model%imp_physics == Model%imp_physics_gfdl) then + Model%ntcwx = 2 + Model%ntiwx = 3 + Model%ntrwx = 4 + elseif (Model%imp_physics == Model%imp_physics_fer_hires) then + Model%ntcwx = 2 + Model%ntiwx = 3 + Model%ntrwx = 4 + elseif (Model%imp_physics == Model%imp_physics_mg) then + Model%ntcwx = 2 + Model%ntiwx = 3 + Model%ntrwx = 4 + elseif (Model%imp_physics == Model%imp_physics_zhao_carr) then + Model%ntcwx = 2 + endif + endif + + if (Model%cplchm) then + ! Only the following microphysics schemes are supported with coupled chemistry + if (Model%imp_physics == Model%imp_physics_zhao_carr) then + Model%nvdiff = 3 + elseif (Model%imp_physics == Model%imp_physics_mg) then + if (Model%ntgl > 0) then + Model%nvdiff = 12 + else + Model%nvdiff = 10 + endif + elseif (Model%imp_physics == Model%imp_physics_gfdl) then + Model%nvdiff = 7 + elseif (Model%imp_physics == Model%imp_physics_thompson) then + if (Model%ltaerosol) then + Model%nvdiff = 12 + else if (Model%mraerosol) then + Model%nvdiff = 10 + else + Model%nvdiff = 9 + endif + else + error stop "Selected microphysics scheme is not supported when coupling with chemistry" + endif + if (Model%trans_aero) Model%nvdiff = Model%nvdiff + Model%ntchm + if (Model%ntke > 0) Model%nvdiff = Model%nvdiff + 1 ! adding tke to the list + endif + + if (Model%ntke > 0) Model%ntkev = Model%nvdiff + + if (Model%ntiw > 0) then + if (Model%ntclamt > 0 .and. Model%ntsigma <= 0) then + Model%nn = Model%ntrac - 2 + elseif (Model%ntclamt <= 0 .and. Model%ntsigma > 0) then + Model%nn = Model%ntrac - 2 + elseif (Model%ntclamt > 0 .and. Model%ntsigma > 0) then + Model%nn = Model%ntrac - 3 + else + Model%nn = Model%ntrac - 1 + endif + elseif (Model%ntcw > 0) then + Model%nn = Model%ntrac + else + Model%nn = Model%ntrac + 1 + endif + + if (Model%cscnv .or. Model%satmedmf .or. Model%trans_trac ) then + Model%otspt(:,:) = .true. ! otspt is used only for cscnv + Model%otspt(1:3,:) = .false. ! this is for sp.hum, ice and liquid water + Model%otsptflag(:) = .true. + tracers = 2 + do n=2,Model%ntrac + ltest = ( n /= Model%ntcw .and. n /= Model%ntiw .and. n /= Model%ntclamt .and. & + n /= Model%ntrw .and. n /= Model%ntsw .and. n /= Model%ntrnc .and. & + n /= Model%ntsnc .and. n /= Model%ntgl .and. n /= Model%ntgnc .and. & + n /= Model%nthl .and. n /= Model%nthnc .and. n /= Model%ntgv .and. & + n /= Model%nthv .and. n /= Model%ntccn .and. n /= Model%ntccna .and. & + n /= Model%ntrz .and. n /= Model%ntgz .and. n /= Model%nthz .and. & + n /= Model%ntsigma) + Model%otsptflag(n) = ltest + if ( ltest ) then + tracers = tracers + 1 + if (Model%ntke == n ) then + Model%otspt(tracers+1,1) = .false. + Model%ntk = tracers + endif + if (Model%ntlnc == n .or. Model%ntinc == n .or. Model%ntrnc == n .or. Model%ntsnc == n .or. Model%ntgnc == n) & + Model%otspt(tracers+1,1) = .false. + if (Model%trans_aero .and. Model%ntchs == n) Model%itc = tracers + endif + enddo + Model%tracers_total = tracers - 2 + endif ! end if_ras or cfscnv or samf + + if (.not. Model%satmedmf .and. .not. Model%trans_trac .and. & + .not. Model%ras .and. .not. Model%do_shoc) then + Model%nsamftrac = 0 + else + Model%nsamftrac = Model%tracers_total + endif + Model%ncstrac = Model%tracers_total + 3 + + end subroutine gfs_setup_tracers + function get_tracer_index (tracer_names, name) character(len=32), intent(in) :: tracer_names(:) diff --git a/scm/src/GFS_typedefs.meta b/scm/src/GFS_typedefs.meta index bb171ab93..bb4d5d561 100644 --- a/scm/src/GFS_typedefs.meta +++ b/scm/src/GFS_typedefs.meta @@ -1,3 +1,13 @@ +[ccpp-table-properties] + name = GFS_init_type + type = ddt + dependencies = + +[ccpp-arg-table] + name = GFS_init_type + type = ddt + +######################################################################## [ccpp-table-properties] name = GFS_statein_type type = ddt @@ -20,7 +30,7 @@ dimensions = (horizontal_dimension,vertical_interface_dimension) type = real kind = kind_phys -[prsi(:,1)] +[prsi(:,ccpp_constant_one)] standard_name = air_pressure_at_lowest_model_interface long_name = air pressure at lowest model interface units = Pa @@ -34,7 +44,7 @@ dimensions = (horizontal_dimension,vertical_interface_dimension) type = real kind = kind_phys -[prsik(:,1)] +[prsik(:,surface_index_used_in_gfs)] standard_name = surface_dimensionless_exner_function long_name = dimensionless Exner function at lowest model interface units = none @@ -55,7 +65,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[prsl(:,1)] +[prsl(:,surface_index_used_in_gfs)] standard_name = air_pressure_at_surface_adjacent_layer long_name = mean pressure at lowest model layer units = Pa @@ -69,7 +79,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[prslk(:,1)] +[prslk(:,surface_index_used_in_gfs)] standard_name = dimensionless_exner_function_at_surface_adjacent_layer long_name = dimensionless Exner function at lowest model layer units = none @@ -90,7 +100,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[ugrs(:,1)] +[ugrs(:,surface_index_used_in_gfs)] standard_name = x_wind_at_surface_adjacent_layer long_name = zonal wind at lowest model layer units = m s-1 @@ -104,7 +114,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[vgrs(:,1)] +[vgrs(:,surface_index_used_in_gfs)] standard_name = y_wind_at_surface_adjacent_layer long_name = meridional wind at lowest model layer units = m s-1 @@ -175,7 +185,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[tgrs(:,1)] +[tgrs(:,surface_index_used_in_gfs)] standard_name = air_temperature_at_surface_adjacent_layer long_name = mean temperature at lowest model layer units = K @@ -196,7 +206,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[qgrs(:,1,index_of_specific_humidity_in_tracer_concentration_array)] +[qgrs(:,surface_index_used_in_gfs,index_of_specific_humidity_in_tracer_concentration_array)] standard_name = specific_humidity_at_surface_adjacent_layer long_name = water vapor specific humidity at lowest model layer units = kg kg-1 @@ -210,7 +220,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[qgrs(:,1,index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array)] +[qgrs(:,surface_index_used_in_gfs,index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array)] standard_name = cloud_liquid_water_mixing_ratio_at_surface_adjacent_layer long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) at lowest model layer units = kg kg-1 @@ -437,7 +447,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[gu0(:,1)] +[gu0(:,surface_index_used_in_gfs)] standard_name = x_wind_of_new_state_at_surface_adjacent_layer long_name = zonal wind at lowest model layer updated by physics units = m s-1 @@ -451,7 +461,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[gv0(:,1)] +[gv0(:,surface_index_used_in_gfs)] standard_name = y_wind_of_new_state_at_surface_adjacent_layer long_name = meridional wind at lowest model layer updated by physics units = m s-1 @@ -465,7 +475,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[gt0(:,1)] +[gt0(:,surface_index_used_in_gfs)] standard_name = air_temperature_of_new_state_at_surface_adjacent_layer long_name = temperature at lowest model layer updated by physics units = K @@ -486,7 +496,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[gq0(:,1,index_of_specific_humidity_in_tracer_concentration_array)] +[gq0(:,surface_index_used_in_gfs,index_of_specific_humidity_in_tracer_concentration_array)] standard_name = specific_humidity_of_new_state_at_surface_adjacent_layer long_name = water vapor specific humidity at lowest model layer updated by physics units = kg kg-1 @@ -975,6 +985,12 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys +[isubgrd_sigma] + standard_name = index_for_the_standard_deviation_of_subgrid_orography_in_hprime_array + long_name = index for the standard deviation of subgrid height_above_mean_sea_level in the hprime array + units = count + dimensions = () + type = integer [hprime] standard_name = statistical_measures_of_subgrid_orography_collection_array long_name = orographic metrics @@ -982,7 +998,7 @@ dimensions = (horizontal_dimension,number_of_statistical_measures_of_subgrid_orography) type = real kind = kind_phys -[hprime(:,1)] +[hprime(:,index_for_the_standard_deviation_of_subgrid_orography_in_hprime_array)] standard_name = standard_deviation_of_subgrid_orography long_name = standard deviation of subgrid height_above_mean_sea_level units = m @@ -1380,7 +1396,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [z_c] standard_name = molecular_sublayer_thickness_in_sea_water long_name = sub-layer cooling thickness @@ -1388,7 +1404,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [c_0] standard_name = coefficient_c_0 long_name = coefficient 1 to calculate d(Tz)/d(Ts) @@ -1396,7 +1412,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [c_d] standard_name = coefficient_c_d long_name = coefficient 2 to calculate d(Tz)/d(Ts) @@ -1404,7 +1420,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [w_0] standard_name = coefficient_w_0 long_name = coefficient 3 to calculate d(Tz)/d(Ts) @@ -1412,7 +1428,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [w_d] standard_name = coefficient_w_d long_name = coefficient 4 to calculate d(Tz)/d(Ts) @@ -1420,7 +1436,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [xt] standard_name = heat_content_in_diurnal_thermocline long_name = heat content in diurnal thermocline layer @@ -1428,7 +1444,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [xs] standard_name = sea_water_salinity_in_diurnal_thermocline long_name = salinity content in diurnal thermocline layer @@ -1436,7 +1452,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [xu] standard_name = x_current_in_diurnal_thermocline long_name = u-current content in diurnal thermocline layer @@ -1444,7 +1460,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [xv] standard_name = y_current_in_diurnal_thermocline long_name = v-current content in diurnal thermocline layer @@ -1452,7 +1468,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [xz] standard_name = diurnal_thermocline_layer_thickness long_name = diurnal thermocline layer thickness @@ -1460,7 +1476,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [zm] standard_name = ocean_mixed_layer_thickness long_name = mixed layer thickness @@ -1468,7 +1484,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [xtts] standard_name = derivative_of_heat_content_in_diurnal_thermocline_wrt_surface_skin_temperature long_name = d(xt)/d(ts) @@ -1476,7 +1492,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [xzts] standard_name = derivative_of_diurnal_thermocline_layer_thickness_wrt_surface_skin_temperature long_name = d(xz)/d(ts) @@ -1484,7 +1500,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [d_conv] standard_name = free_convection_layer_thickness_in_sea_water long_name = thickness of free convection layer (FCL) @@ -1492,7 +1508,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [ifd] standard_name = control_for_diurnal_thermocline_calculation long_name = index to start dtlm run or not @@ -1500,7 +1516,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [dt_cool] standard_name = molecular_sublayer_temperature_correction_in_sea_water long_name = sub-layer cooling amount @@ -1508,7 +1524,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [qrain] standard_name = surface_sensible_heat_due_to_rainfall long_name = sensible heat flux due to rainfall @@ -1516,7 +1532,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_nsstm > 0) + active = (index_to_control_for_nsstm > 0) [snowxy] standard_name = number_of_snow_layers long_name = number of snow layers @@ -1657,7 +1673,7 @@ standard_name = temperature_in_surface_snow long_name = temperature_in_surface_snow units = K - dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:constant_zero) + dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:upper_bound_of_vertical_dimension_of_surface_snow) type = real kind = kind_phys active = (control_for_land_surface_scheme == identifier_for_noahmp_land_surface_scheme) @@ -1673,7 +1689,7 @@ standard_name = lwe_thickness_of_ice_in_surface_snow long_name = snow layer ice units = mm - dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:constant_zero) + dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:upper_bound_of_vertical_dimension_of_surface_snow) type = real kind = kind_phys active = (control_for_land_surface_scheme == identifier_for_noahmp_land_surface_scheme) @@ -1681,7 +1697,7 @@ standard_name = lwe_thickness_of_liquid_water_in_surface_snow long_name = snow layer liquid water units = mm - dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:constant_zero) + dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:upper_bound_of_vertical_dimension_of_surface_snow) type = real kind = kind_phys active = (control_for_land_surface_scheme == identifier_for_noahmp_land_surface_scheme) @@ -2479,6 +2495,26 @@ dimensions = () type = land_iau_state_type +######################################################################## +[ccpp-table-properties] + name = dtend_var_label + type = ddt + dependencies = + +[ccpp-arg-table] + name = dtend_var_label + type = ddt + +######################################################################## +[ccpp-table-properties] + name = dtend_process_label + type = ddt + dependencies = + +[ccpp-arg-table] + name = dtend_process_label + type = ddt + ######################################################################## [ccpp-table-properties] name = GFS_coupling_type @@ -3250,22 +3286,6 @@ type = real kind = kind_phys active = (do_smoke_coupling) -[smoke_ext] - standard_name = extinction_coefficient_in_air_due_to_smoke - long_name = extinction coefficient in air due to smoke - units = various - dimensions = (horizontal_dimension,vertical_layer_dimension) - type = real - kind = kind_phys - active = (do_smoke_coupling) -[dust_ext] - standard_name = extinction_coefficient_in_air_due_to_dust - long_name = extinction coefficient in air due to dust - units = various - dimensions = (horizontal_dimension,vertical_layer_dimension) - type = real - kind = kind_phys - active = (do_smoke_coupling) [chem3d] standard_name = chem3d_mynn_pbl_transport long_name = mynn pbl transport of smoke and dust @@ -3394,7 +3414,7 @@ type = real kind = kind_phys active = (flag_for_chemistry_coupling) -[htrlw] +[hrlw] standard_name = updated_tendency_of_air_temperature_due_to_longwave_heating_on_physics_timestep long_name = total sky longwave heating rate on physics time step units = K s-1 @@ -3506,7 +3526,7 @@ units = none dimensions = (number_of_lines_in_internal_namelist) type = character - kind = len=256 + kind = len=: [logunit] standard_name = iounit_of_log long_name = fortran unit number for logfile @@ -3663,41 +3683,29 @@ units = count dimensions = () type = integer -[nblks] - standard_name = ccpp_block_count - long_name = for explicit data blocking: number of blocks +[ncols] + standard_name = horizontal_dimension + long_name = horizontal dimension units = count dimensions = () type = integer -[blksz] - standard_name = ccpp_block_sizes +[chunks] + standard_name = ccpp_chunk_sizes long_name = for explicit data blocking: block sizes of all blocks units = count - dimensions = (ccpp_block_count) + dimensions = (ccpp_chunk_count) type = integer -[blksz(ccpp_block_number)] +[chunks(ccpp_chunk_number)] standard_name = horizontal_loop_extent long_name = horizontal loop extent units = count dimensions = () type = integer -[ncols] - standard_name = horizontal_dimension - long_name = horizontal dimension - units = count - dimensions = () - type = integer -[nchunks] - standard_name = ccpp_chunk_extent - long_name = number of chunks of array data used in run phase - units = count - dimensions = () - type = integer [chunk_begin] standard_name = horizontal_loop_begin_all_chunks long_name = first index for horizontal loop extent in run phase units = index - dimensions = (ccpp_chunk_extent) + dimensions = (ccpp_chunk_count) type = integer [chunk_begin(ccpp_chunk_number)] standard_name = horizontal_loop_begin @@ -3709,7 +3717,7 @@ standard_name = horizontal_loop_end_all_chunks long_name = last index for horizontal loop extent in run phase units = index - dimensions = (ccpp_chunk_extent) + dimensions = (ccpp_chunk_count) type = integer [chunk_end(ccpp_chunk_number)] standard_name = horizontal_loop_end @@ -4234,6 +4242,12 @@ units = count dimensions = () type = integer +[nscav] + standard_name = number_of_tracers_scavenged + long_name = number of tracers scavenged + units = count + dimensions = () + type = integer [lextop] standard_name = do_extra_top_layer_for_radiation long_name = use an extra top layer for radiation @@ -5056,6 +5070,13 @@ units = flag dimensions = () type = logical +[nsfullradar_diag] + standard_name = interval_for_resetting_thompson_radar_diagnostics + long_name = seconds between resetting radar reflectivity calculation + units = s + dimensions = () + type = real + kind = kind_phys [ttendlim] standard_name = max_tendency_of_air_potential_temperature_due_to_large_scale_precipitation long_name = temperature tendency limiter per physics time step @@ -5185,19 +5206,19 @@ units = flag dimensions = () type = integer -[lsm_noah] +[ilsm_noah] standard_name = identifier_for_noah_land_surface_scheme long_name = flag for NOAH land surface model units = flag dimensions = () type = integer -[lsm_noahmp] +[ilsm_noahmp] standard_name = identifier_for_noahmp_land_surface_scheme long_name = flag for NOAH MP land surface model units = flag dimensions = () type = integer -[lsm_ruc] +[ilsm_ruc] standard_name = identifier_for_ruc_land_surface_scheme long_name = flag for RUC land surface model units = flag @@ -5258,35 +5279,30 @@ units = count dimensions = () type = integer - active = (control_for_lake_surface_scheme == 2) [nlevsoil_clm_lake] standard_name = soil_vertical_dimension_for_clm_lake_model long_name = soil vertical dimension for clm lake model units = count dimensions = () type = integer - active = (control_for_lake_surface_scheme == 2) [nlevsnow_clm_lake] standard_name = snow_vertical_dimension_for_clm_lake_model long_name = snow vertical dimension for clm lake model units = count dimensions = () type = integer - active = (control_for_lake_surface_scheme == 2) [nlevsnowsoil_clm_lake] standard_name = snow_plus_soil_vertical_dimension_for_clm_lake_model long_name = snow plus soil vertical dimension for clm lake model units = count dimensions = () type = integer - active = (control_for_lake_surface_scheme == 2) [nlevsnowsoil1_clm_lake] standard_name = snow_plus_soil_minus_one_vertical_dimension_for_clm_lake_model long_name = snow plus soil minus one vertical dimension for clm lake model units = count dimensions = () type = integer - active = (control_for_lake_surface_scheme == 2) [lsoil] standard_name = vertical_dimension_of_soil long_name = number of soil layers @@ -6068,21 +6084,39 @@ dimensions = (2) type = real kind = kind_phys -[crtrh(1)] +[crtrh_sfc] + standard_name = index_for_critical_relative_humidity_at_surface + long_name = index for critical relative humidity at the surface + units = count + dimensions = () + type = integer +[crtrh_pbl] + standard_name = index_for_critical_relative_humidity_at_pbl_top + long_name = index for critical relative humidity at the PBL top + units = count + dimensions = () + type = integer +[crtrh_toa] + standard_name = index_for_critical_relative_humidity_at_toa + long_name = index for critical relative humidity at the top of atmosphere + units = count + dimensions = () + type = integer +[crtrh(index_for_critical_relative_humidity_at_surface)] standard_name = critical_relative_humidity_at_surface long_name = critical relative humidity at the surface units = frac dimensions = () type = real kind = kind_phys -[crtrh(2)] +[crtrh(index_for_critical_relative_humidity_at_pbl_top)] standard_name = critical_relative_humidity_at_PBL_top long_name = critical relative humidity at the PBL top units = frac dimensions = () type = real kind = kind_phys -[crtrh(3)] +[crtrh(index_for_critical_relative_humidity_at_toa)] standard_name = critical_relative_humidity_at_toa long_name = critical relative humidity at the top of atmosphere units = frac @@ -6235,19 +6269,67 @@ units = flag dimensions = () type = logical -[nstf_name(1)] +[instf_opt] + standard_name = index_to_control_for_nsstm + long_name = index ofr NSSTM flag: off/uncoupled/coupled=0/1/2 + units = count + dimensions = () + type = integer +[instf_spinup] + standard_name = index_for_nsstm_spinup + long_name = index for nsstm spinup + units = count + dimensions = () + type = integer +[instf_anlys] + standard_name = index_for_nsstm_analysis + long_name = index for nsstm analysis + units = count + dimensions = () + type = integer +[instf_zs1_lb] + standard_name = index_for_lower_bound_for_depth_of_sea_temperature_for_nsstm + long_name = index for lower bound for depth of sea temperature for nsstm + units = count + dimensions = () + type = integer +[instf_zs2_ub] + standard_name = index_for_upper_bound_for_depth_of_sea_temperature_for_nsstm + long_name = index for upper bound for depth of sea temperature for nsstm + units = count + dimensions = () + type = integer +[nstf_name] + standard_name = configurations_for_nsstm + long_name = NSSTM configuration + units = flag + dimensions = (5) + type = integer +[nstf_name(index_to_control_for_nsstm)] standard_name = control_for_nsstm long_name = NSSTM flag: off/uncoupled/coupled=0/1/2 units = flag dimensions = () type = integer -[nstf_name(4)] +[nstf_name(index_for_nsstm_spinup)] + standard_name = control_for_nsstm_spinup + long_name = NSSTM control for spinup + units = flag + dimensions = () + type = integer +[nstf_name(index_for_nsstm_analysis)] + standard_name = control_for_nsstm_analysis + long_name = NSSTM control for analysis + units = flag + dimensions = () + type = integer +[nstf_name(index_for_lower_bound_for_depth_of_sea_temperature_for_nsstm)] standard_name = lower_bound_for_depth_of_sea_temperature_for_nsstm long_name = zsea1 in mm units = mm dimensions = () type = integer -[nstf_name(5)] +[nstf_name(index_for_upper_bound_for_depth_of_sea_temperature_for_nsstm)] standard_name = upper_bound_for_depth_of_sea_temperature_for_nsstm long_name = zsea2 in mm units = mm @@ -6584,6 +6666,96 @@ units = count dimensions = () type = integer +[nn] + standard_name = number_of_tracers_for_convective_transport + long_name = number of tracers for convective transport + units = count + dimensions = () + type = integer +[nvdiff] + standard_name = number_of_vertical_diffusion_tracers + long_name = number of tracers to diffuse vertically + units = count + dimensions = () + type = integer +[mg3_as_mg2] + standard_name = flag_mg3_as_mg2 + long_name = flag for controlling prep for Morrison-Gettelman microphysics + units = flag + dimensions = () + type = logical +[itc] + standard_name = index_of_first_chemical_tracer_for_convection + long_name = index of first chemical tracer transported/scavenged by convection + units = index + dimensions = () + type = integer +[ntk] + standard_name = index_for_turbulent_kinetic_energy_convective_transport_tracer + long_name = index for turbulent kinetic energy in the convectively transported tracer array + units = index + dimensions = () + type = integer +[ntkev] + standard_name = index_for_turbulent_kinetic_energy_vertical_diffusion_tracer + long_name = index for turbulent kinetic energy in the vertically diffused tracer array + units = index + dimensions = () + type = integer +[tracers_total] + standard_name = number_of_total_tracers + long_name = total number of tracers + units = count + dimensions = () + type = integer +[otspt] + standard_name = flag_convective_tracer_transport + long_name = flag to enable tracer transport by updrafts/downdrafts[(:,1)] or subsidence [(:,2)] + units = flag + dimensions = (number_of_tracers_plus_one,2) + type = logical +[otsptflag] + standard_name = flag_convective_tracer_transport_interstitial + long_name = flag for interstitial tracer transport + units = flag + dimensions = (number_of_tracers) + type = logical +[nsamftrac] + standard_name = number_of_tracers_for_samf + long_name = number of tracers for scale-aware mass flux schemes + units = count + dimensions = () + type = integer +[ntcwx] + standard_name = index_for_liquid_cloud_condensate_vertical_diffusion_tracer + long_name = index for liquid cloud condensate in the vertically diffused tracer array + units = index + dimensions = () + type = integer +[ntiwx] + standard_name = index_for_ice_cloud_condensate_vertical_diffusion_tracer + long_name = index for ice cloud condensate in the vertically diffused tracer array + units = index + dimensions = () + type = integer +[ntrwx] + standard_name = index_for_rain_water_vertical_diffusion_tracer + long_name = tracer index for rain water in the vertically diffused tracer array + units = index + dimensions = () + type = integer +[ncstrac] + standard_name = number_of_tracers_for_CS + long_name = number of convectively transported tracers in Chikira-Sugiyama deep convection scheme + units = count + dimensions = () + type = integer +[trans_aero] + standard_name = flag_for_aerosol_convective_transport_and_PBL_diffusion + long_name = flag for aerosol convective transport and PBL diffusion + units = flag + dimensions = () + type = logical [ntrac] standard_name = number_of_tracers long_name = number of tracers @@ -7101,6 +7273,7 @@ dimensions = (number_of_chemical_tracers) type = real kind = kind_phys + active = (number_of_chemical_tracers > 0) [ntot2d] standard_name = number_of_variables_in_xy_dimensioned_restart_array long_name = total number of variables for phyf2d @@ -7481,13 +7654,6 @@ units = flag dimensions = () type = logical -[suite_sim_data] - standard_name = filename_for_CCPP_suite_simulator - long_name = filename for cccpp suite simulator data file - units = none - dimensions = () - type = character - kind = len=256 [nprg_active] standard_name = number_of_prognostics_varaibles_in_CCPP_suite_simulator long_name = number of prognostic variables used in CCPP suite simulator @@ -7554,6 +7720,181 @@ units = flag dimensions = () type = logical +[icld_cfrac] + standard_name = index_for_cloud_fraction_in_cloud_data_array + long_name = index for cloud fraction in cloud data array + units = count + dimensions = () + type = integer +[icld_lwp] + standard_name = index_for_cloud_liquid_water_path_in_cloud_data_array + long_name = index for cloud LWP in cloud data array + units = count + dimensions = () + type = integer +[icld_reliq] + standard_name = index_for_cloud_liquid_effective_radius_in_cloud_data_array + long_name = index for cloud liquid effective radius in cloud data array + units = count + dimensions = () + type = integer +[icld_iwp] + standard_name = index_for_cloud_ice_water_path_in_cloud_data_array + long_name = index for cloud IWP in cloud data array + units = count + dimensions = () + type = integer +[icld_reice] + standard_name = index_for_cloud_ice_effective_radius_in_cloud_data_array + long_name = index for cloud ice effective radius in cloud data array + units = count + dimensions = () + type = integer +[icld_rwp] + standard_name = index_for_cloud_rain_water_path_in_cloud_data_array + long_name = index for cloud rain water path in cloud data array + units = count + dimensions = () + type = integer +[icld_rerain] + standard_name = index_for_cloud_rain_effective_radius_in_cloud_data_array + long_name = index for cloud rain effective radius in cloud data array + units = count + dimensions = () + type = integer +[icld_swp] + standard_name = index_for_cloud_snow_water_path_in_cloud_data_array + long_name = index for cloud snow water path in cloud data array + units = count + dimensions = () + type = integer +[icld_resnow] + standard_name = index_for_cloud_snow_effective_radius_in_cloud_data_array + long_name = index for cloud snow effective radius in cloud data array + units = count + dimensions = () + type = integer +[ialb_nirdir] + standard_name = index_for_surface_albedo_due_to_near_ir_direct + long_name = index for surface albedo due to near IR direct beam + units = count + dimensions = () + type = integer +[ialb_nirdif] + standard_name = index_for_surface_albedo_due_to_near_ir_diffuse + long_name = index for surface albedo due to near IR diffuse beam + units = count + dimensions = () + type = integer +[ialb_uvvisdir] + standard_name = index_for_surface_albedo_due_to_uv_and_vis_direct + long_name = index for surface albedo due to UV+VIS direct beam + units = count + dimensions = () + type = integer +[ialb_uvvisdif] + standard_name = index_for_surface_albedo_due_to_uv_and_vis_diffuse + long_name = index for surface albedo due to UV+VIS diffuse beam + units = count + dimensions = () + type = integer +[iaer_tau] + standard_name = index_for_aerosol_optical_depth_in_aer_array + long_name = index into aerosol array for aerosol optical depth + units = count + dimensions = () + type = integer +[iaer_ssa] + standard_name = index_for_aerosol_single_scattering_albedo_in_aer_array + long_name = index into aerosol array for aerosol single scattering albedo + units = count + dimensions = () + type = integer +[iaer_g] + standard_name = index_for_aerosol_asymmetry_parameter_in_aer_array + long_name = index into aerosol array for aerosol asymmetry_parameter + units = count + dimensions = () + type = integer +[igas_co2] + standard_name = index_for_volume_mixing_ratio_of_co2_in_gasvmr_array + long_name = index for volume mixing ratio co2 + units = count + dimensions = () + type = integer +[igas_n2o] + standard_name = index_for_volume_mixing_ratio_of_n2o_in_gasvmr_array + long_name = index for volume mixing ratio no2 + units = count + dimensions = () + type = integer +[igas_ch4] + standard_name = index_for_volume_mixing_ratio_of_ch4_in_gasvmr_array + long_name = index for volume mixing ratio ch4 + units = count + dimensions = () + type = integer +[igas_o2] + standard_name = index_for_volume_mixing_ratio_of_o2_in_gasvmr_array + long_name = index for volume mixing ratio o2 + units = count + dimensions = () + type = integer +[igas_co] + standard_name = index_for_volume_mixing_ratio_of_co_in_gasvmr_array + long_name = index for volume mixing ratio co + units = count + dimensions = () + type = integer +[igas_cfc11] + standard_name = index_for_volume_mixing_ratio_of_cfc11_in_gasvmr_array + long_name = index for volume mixing ratio cfc11 + units = count + dimensions = () + type = integer +[igas_cfc12] + standard_name = index_for_volume_mixing_ratio_of_cfc12_in_gasvmr_array + long_name = index for volume mixing ratio cfc12 + units = count + dimensions = () + type = integer +[igas_cfc22] + standard_name = index_for_volume_mixing_ratio_of_cfc22_in_gasvmr_array + long_name = index for volume mixing ratio cfc22 + units = count + dimensions = () + type = integer +[igas_ccl4] + standard_name = index_for_volume_mixing_ratio_of_ccl4_in_gasvmr_array + long_name = index for volume mixing ratio ccl4 + units = count + dimensions = () + type = integer +[igas_cfc113] + standard_name = index_for_volume_mixing_ratio_of_cfc113_in_gasvmr_array + long_name = index for volume mixing ratio cfc113 + units = count + dimensions = () + type = integer +[LTP] + standard_name = extra_top_layer + long_name = extra top layer for radiation + units = count + dimensions = () + type = integer +[clear_val] + standard_name = constant_zero + long_name = constant for zero + units = none + dimensions = () + type = real + kind = kind_phys +[isfc_gfs] + standard_name = surface_index_used_in_gfs + long_name = surface index for GFS applications + units = count + dimensions = () + type = integer [ipt] standard_name = index_of_horizontal_gridpoint_for_debug_output long_name = horizontal index for point used for diagnostic printout @@ -8398,6 +8739,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension,number_of_aerosol_tracers_MG) type = real kind = kind_phys + active = (flag_for_aerosol_input_MG_radiation) [aod_gf] standard_name = aerosol_optical_depth_for_grell_freitas_deep_convection long_name = aerosol optical depth used in Grell-Freitas Convective Parameterization @@ -10613,85 +10955,3 @@ kind = kind_phys intent = inout active = (do_lightning_threat_index_calculations) - -######################################################################## -[ccpp-table-properties] - name = GFS_typedefs - type = module - relative_path = ../../ccpp/physics/physics - dependencies = hooks/machine.F,hooks/physcons.F90 - dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f - dependencies = MP/TEMPO/TEMPO/module_mp_tempo_params.F90 - dependencies = photochem/module_ozphys.F90,photochem/module_h2ophys.F90 - dependencies = SFC_Models/Land/Noahmp/lnd_iau_mod.F90 - dependencies = Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.F90 - -[ccpp-arg-table] - name = GFS_typedefs - type = module -[GFS_cldprop_type] - standard_name = GFS_cldprop_type - long_name = definition of type GFS_cldprop_type - units = DDT - dimensions = () - type = GFS_cldprop_type -[GFS_control_type] - standard_name = GFS_control_type - long_name = definition of type GFS_control_type - units = DDT - dimensions = () - type = GFS_control_type -[GFS_coupling_type] - standard_name = GFS_coupling_type - long_name = definition of type GFS_coupling_type - units = DDT - dimensions = () - type = GFS_coupling_type -[GFS_diag_type] - standard_name = GFS_diag_type - long_name = definition of type GFS_diag_type - units = DDT - dimensions = () - type = GFS_diag_type -[GFS_grid_type] - standard_name = GFS_grid_type - long_name = definition of type GFS_grid_type - units = DDT - dimensions = () - type = GFS_grid_type -[GFS_radtend_type] - standard_name = GFS_radtend_type - long_name = definition of type GFS_radtend_type - units = DDT - dimensions = () - type = GFS_radtend_type -[GFS_sfcprop_type] - standard_name = GFS_sfcprop_type - long_name = definition of type GFS_sfcprop_type - units = DDT - dimensions = () - type = GFS_sfcprop_type -[GFS_statein_type] - standard_name = GFS_statein_type - long_name = definition of type GFS_statein_type - units = DDT - dimensions = () - type = GFS_statein_type -[GFS_stateout_type] - standard_name = GFS_stateout_type - long_name = definition of type GFS_stateout_type - units = DDT - dimensions = () - type = GFS_stateout_type -[GFS_tbd_type] - standard_name = GFS_tbd_type - long_name = definition of type GFS_tbd_type - units = DDT - dimensions = () - type = GFS_tbd_type -[LTP] - standard_name = extra_top_layer - long_name = extra top layer for radiation - units = count - dimensions = () - type = integer diff --git a/scm/src/ccpp_config.F90 b/scm/src/ccpp_config.F90 new file mode 100644 index 000000000..137cb0485 --- /dev/null +++ b/scm/src/ccpp_config.F90 @@ -0,0 +1,49 @@ +!> \file ccpp_config.F90 +!! Contains CCPP configuration + +module ccpp_config + use mpi_f08, only: MPI_Comm + implicit none +!> \section arg_table_ccpp_config +!! \htmlinclude ccpp_config.html +!! + !> @var The default loop counter indicating outside of a subcycle loop + integer, parameter :: CCPP_DEFAULT_LOOP_CNT = -999 + integer, parameter :: CCPP_DEFAULT_LOOP_MAX = -999 + + !> @var The default values for block and chunk numbers indicating invalid data + integer, parameter :: CCPP_DEFAULT_CHUNK_NUMBER = -999 + + !> @var The default maximum number of threads for CCPP + integer, parameter :: CCPP_DEFAULT_THREAD_NUMBER = -999 + integer, parameter :: CCPP_DEFAULT_THREAD_COUNT = -999 + +!! \section arg_table_ty_ccpp_config +!! \htmlinclude ty_ccpp_config.html +!! + type :: ty_ccpp_config + ! CCPP-internal variables for physics schemes + integer :: loop_cnt = CCPP_DEFAULT_LOOP_CNT + integer :: loop_max = CCPP_DEFAULT_LOOP_MAX + integer :: thrd_no = CCPP_DEFAULT_THREAD_NUMBER + integer :: thrd_cnt = CCPP_DEFAULT_THREAD_COUNT + integer :: chunk_no = CCPP_DEFAULT_CHUNK_NUMBER + integer :: chunk_cnt = 1 + integer :: ccpp_instance = 1 + integer :: ccpp_errflg = 0 + character(len=512) :: ccpp_errmsg = '' + contains + procedure :: initialized => ccpp_cfg_initialized + end type ty_ccpp_config + +contains + + function ccpp_cfg_initialized(ccpp_d) result(initialized) + implicit none + class(ty_ccpp_config) :: ccpp_d + logical :: initialized + initialized = ccpp_d%thrd_no /= CCPP_DEFAULT_THREAD_NUMBER .or. & + ccpp_d%chunk_no /= CCPP_DEFAULT_CHUNK_NUMBER + end function ccpp_cfg_initialized + +end module ccpp_config diff --git a/scm/src/ccpp_config.meta b/scm/src/ccpp_config.meta new file mode 100644 index 000000000..d14f30be9 --- /dev/null +++ b/scm/src/ccpp_config.meta @@ -0,0 +1,84 @@ +######################################################################## +[ccpp-table-properties] + name = MPI_Comm + type = ddt + dependencies = + +[ccpp-arg-table] + name = MPI_Comm + type = ddt + +######################################################################## +[ccpp-table-properties] + name = ty_ccpp_config + type = ddt + dependencies = + +[ccpp-arg-table] + name = ty_ccpp_config + type = ddt +[loop_cnt] + standard_name = ccpp_loop_counter + long_name = loop counter for subcycling loops in CCPP + units = index + dimensions = () + type = integer +[loop_max] + standard_name = ccpp_loop_extent + long_name = loop extent for subcycling loops in CCPP + units = count + dimensions = () + type = integer +[thrd_no] + standard_name = ccpp_thread_number + long_name = number of thread for threading in CCPP + units = index + dimensions = () + type = integer +[thrd_cnt] + standard_name = ccpp_thread_count + long_name = total number of threads for threading in CCPP + units = index + dimensions = () + type = integer +[ccpp_instance] + standard_name = ccpp_instance + long_name = ccpp_instance + units = index + dimensions = () + type = integer +[chunk_no] + standard_name = ccpp_chunk_number + long_name = number of chunk for using array chunks in CCPP + units = index + dimensions = () + type = integer +[chunk_cnt] + standard_name = ccpp_chunk_count + long_name = total number of chunks of array data used in run phase + units = count + dimensions = () + type = integer +[ccpp_errmsg] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=512 +[ccpp_errflg] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + dimensions = () + type = integer + +######################################################################## +[ccpp-table-properties] + name = ccpp_config + type = module + dependencies = + +[ccpp-arg-table] + name = ccpp_config + type = module diff --git a/scm/src/scm.F90 b/scm/src/scm.F90 index 6d673c204..457d113c7 100644 --- a/scm/src/scm.F90 +++ b/scm/src/scm.F90 @@ -15,33 +15,37 @@ subroutine scm_main_sub() use scm_forcing use scm_time_integration use scm_output - use scm_type_defs + use scm_type_defs, only: scm_state_type, scm_input_type, scm_reference_type + use scm_mod, only: physics, ccpp_cfg use mpi_f08 - - use :: ccpp_static_api, & - only: ccpp_physics_init, & - ccpp_physics_timestep_init, & - ccpp_physics_run, & - ccpp_physics_timestep_finalize, & - ccpp_physics_finalize - + + use :: SCM_ccpp_cap, only: & + ccpp_physics_init => SCM_ccpp_physics_initialize, & + ccpp_physics_timestep_init => SCM_ccpp_physics_timestep_initial, & + ccpp_physics_run => SCM_ccpp_physics_run, & + ccpp_physics_timestep_finalize => SCM_ccpp_physics_timestep_final, & + ccpp_physics_finalize => SCM_ccpp_physics_finalize, & + ccpp_physics_suite_part_list implicit none - type(scm_state_type), target :: scm_state - type(scm_input_type), target :: scm_input_instance + type(scm_state_type), target :: scm_state + type(scm_input_type), target :: scm_input_instance type(scm_reference_type), target :: scm_reference - - type(MPI_Comm) :: fcst_mpi_comm - - integer :: i, j, kdt_rad, idtend, itrac, n_tasks, n_threads - real(kind=8) :: rinc(5) !(DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS) - integer :: jdat(1:8) - - integer :: cdata_time_index - integer :: ierr - character(len=16) :: logfile_name - logical :: in_spinup + type(MPI_Comm) :: fcst_mpi_comm + integer :: i, j, kdt_rad, idtend, itrac, n_tasks, n_threads + real(kind=8) :: rinc(5) !(DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS) + integer :: jdat(1:8) + integer :: cdata_time_index + integer :: ierr + character(len=16) :: logfile_name + logical :: in_spinup + character(len=128), allocatable :: ccpp_suite_parts(:) + integer :: isuite_part + + ! Initialize error handling variables. + ccpp_cfg%ccpp_errflg = 0 + ccpp_cfg%ccpp_errmsg = '' call MPI_INIT(ierr) if (ierr/=0) then @@ -68,8 +72,6 @@ subroutine scm_main_sub() call get_FV3_vgrid(scm_input_instance, scm_state) - !allocate(cdata_cols(scm_state%n_cols)) - call set_state(scm_input_instance, scm_reference, scm_state) call calc_geopotential(1, scm_state) @@ -177,10 +179,10 @@ subroutine scm_main_sub() lcm(scm_state%n_itt_out,physics%Model%nslwr)*scm_state%dt," seconds." end if - cdata%blk_no = 1 - cdata%chunk_no = 1 - cdata%thrd_no = 1 - cdata%thrd_cnt = 1 + ! Initialize CCPP physics control. + ccpp_cfg%thrd_no = 1 + ccpp_cfg%thrd_cnt = n_threads + ccpp_cfg%chunk_no = 1 call physics%associate(scm_state) call physics%set(scm_input_instance, scm_state) @@ -195,12 +197,16 @@ subroutine scm_main_sub() endif !initialize the column's physics - + write(*,'(a,i0,a)') "Calling ccpp_physics_suite_part_list with suite '" // trim(trim(adjustl(scm_state%physics_suite_name))) // "'" + call ccpp_physics_suite_part_list(suite_name = trim(trim(adjustl(scm_state%physics_suite_name))), & + part_list = ccpp_suite_parts, & + ccpp_errmsg = ccpp_cfg%ccpp_errmsg, & + ccpp_errflg = ccpp_cfg%ccpp_errflg) write(*,'(a,i0,a)') "Calling ccpp_physics_init with suite '" // trim(trim(adjustl(scm_state%physics_suite_name))) // "'" - call ccpp_physics_init(cdata, suite_name=trim(trim(adjustl(scm_state%physics_suite_name))), ierr=ierr) - write(*,'(a,i0,a,i0)') "Called ccpp_physics_init with suite '" // trim(trim(adjustl(scm_state%physics_suite_name))) // "', ierr=", ierr - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_init: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_init(suite_name = trim(trim(adjustl(scm_state%physics_suite_name)))) + write(*,'(a,i0,a,i0)') "Called ccpp_physics_init with suite '" // trim(trim(adjustl(scm_state%physics_suite_name))) // "', ccpp_errflg=", ccpp_cfg%ccpp_errflg + if (ccpp_cfg%ccpp_errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_init: ' // trim(ccpp_cfg%ccpp_errmsg) // '. Exiting...' error stop end if @@ -228,7 +234,7 @@ subroutine scm_main_sub() if (.not. scm_state%model_ics) call calc_pres_exner_geopotential(1, scm_state) !pass in state variables to be modified by forcing and physics - call do_time_step(scm_state, physics, cdata, in_spinup) + call do_time_step(scm_state, in_spinup, ccpp_suite_parts) else if (scm_state%time_scheme == 2) then ! !if using the leapfrog scheme, we initialize by taking one half forward time step and one half (unfiltered) leapfrog time step to get to the end of the first time step @@ -293,10 +299,9 @@ subroutine scm_main_sub() endif endif end do - - call ccpp_physics_timestep_init(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_init: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_timestep_init(suite_name = trim(trim(adjustl(scm_state%physics_suite_name)))) + if (ccpp_cfg%ccpp_errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_init: ' // trim(ccpp_cfg%ccpp_errmsg) // '. Exiting...' error stop end if @@ -317,33 +322,21 @@ subroutine scm_main_sub() call physics%Diag%phys_zero (physics%Model) endif - !CCPP run phase - ! time_vary group doesn't have any run phase (omitted) - ! radiation group call physics%Interstitial(1)%create(ixs=1, ixe=1, model=physics%Model) - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="radiation", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group radiation: ' // trim(cdata%errmsg) // '. Exiting...' - error stop - end if - ! process-split physics call physics%Interstitial(1)%reset(physics%Model) - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="phys_ps", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ps: ' // trim(cdata%errmsg) // '. Exiting...' - error stop - end if - ! time-split physics - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="phys_ts", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ts: ' // trim(cdata%errmsg) // '. Exiting...' - error stop - end if - - call ccpp_physics_timestep_finalize(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_finalize: ' // trim(cdata%errmsg) // '. Exiting...' - error stop + do isuite_part=1,size(ccpp_suite_parts) + call ccpp_physics_run(suite_name = trim(trim(adjustl(scm_state%physics_suite_name))), & + suite_part = ccpp_suite_parts(isuite_part)) + if (ccpp_cfg%ccpp_errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run: ' // trim(ccpp_cfg%ccpp_errmsg) // '. Exiting...' + error stop + end if + end do + + call ccpp_physics_timestep_finalize(suite_name = trim(trim(adjustl(scm_state%physics_suite_name)))) + if (ccpp_cfg%ccpp_errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_finalize: ' // trim(ccpp_cfg%ccpp_errmsg) // '. Exiting...' + stop 1 end if !the filter routine (called after the following leapfrog time step) expects time level 2 in temp_tracer to be the updated, unfiltered state after the previous time step @@ -367,7 +360,7 @@ subroutine scm_main_sub() scm_state%state_tracer(:,:,:,1) = scm_state%temp_tracer(:,:,:,1) !go forward one leapfrog time step - call do_time_step(scm_state, physics, cdata, in_spinup) + call do_time_step(scm_state, in_spinup, ccpp_suite_parts) !for filtered-leapfrog scheme, call the filtering routine to calculate values of the state variables to save in slot 1 using slot 2 vars (updated, unfiltered) output from the physics call filter(scm_state) @@ -430,7 +423,7 @@ subroutine scm_main_sub() !call physics%Diag%phys_zero(physics%Model) !pass in state variables to be modified by forcing and physics - call do_time_step(scm_state, physics, cdata, in_spinup) + call do_time_step(scm_state, in_spinup, ccpp_suite_parts) if (scm_state%time_scheme == 2) then !for filtered-leapfrog scheme, call the filtering routine to calculate values of the state variables to save in slot 1 using slot 2 vars (updated, unfiltered) output from the physics @@ -456,10 +449,10 @@ subroutine scm_main_sub() call physics%Interstitial(1)%destroy(physics%Model) end do - call ccpp_physics_finalize(cdata, suite_name=trim(trim(adjustl(scm_state%physics_suite_name))), ierr=ierr) - - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_finalize: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_finalize(suite_name = trim(trim(adjustl(scm_state%physics_suite_name)))) + + if (ccpp_cfg%ccpp_errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_finalize: ' // trim(ccpp_cfg%ccpp_errmsg) // '. Exiting...' error stop end if diff --git a/scm/src/scm_kinds.meta b/scm/src/scm_kinds.meta index bf150f92e..538046f77 100644 --- a/scm/src/scm_kinds.meta +++ b/scm/src/scm_kinds.meta @@ -6,19 +6,19 @@ [ccpp-arg-table] name = scm_kinds type = module -[kind_sp] +[sp] standard_name = kind_sp long_name = definition of kind_sp units = none dimensions = () type = integer -[kind_dp] +[dp] standard_name = kind_dp long_name = definition of kind_dp units = none dimensions = () type = integer -[kind_qp] +[qp] standard_name = kind_qp long_name = definition of kind_qp units = none diff --git a/scm/src/scm_mod.F90 b/scm/src/scm_mod.F90 new file mode 100644 index 000000000..cfb7bfb31 --- /dev/null +++ b/scm/src/scm_mod.F90 @@ -0,0 +1,16 @@ +!> \file scm_mod.F90 +!! Contains variable declarations for CCPP SCM. +!! + +module scm_mod +!> \section arg_table_scm_mod +!! \htmlinclude scm_mod.html +!! + use ccpp_config, only: ty_ccpp_config + use scm_type_defs, only: physics_type + implicit none + + type(physics_type), target :: physics + type(ty_ccpp_config), target :: ccpp_cfg + +end module scm_mod diff --git a/scm/src/scm_mod.meta b/scm/src/scm_mod.meta new file mode 100644 index 000000000..0234745b1 --- /dev/null +++ b/scm/src/scm_mod.meta @@ -0,0 +1,21 @@ +######################################################################## +[ccpp-table-properties] + name = scm_mod + type = module + dependencies = scm_type_defs.F90,ccpp_config.F90 + +[ccpp-arg-table] + name = scm_mod + type = module +[physics] + standard_name = physics + long_name = definition of derived data type physics_type + units = DDT + dimensions = () + type = physics_type +[ccpp_cfg] + standard_name = ccpp_cfg + long_name = definition of derived data type ccpp_config + units = DDT + dimensions = () + type = ty_ccpp_config diff --git a/scm/src/scm_output.F90 b/scm/src/scm_output.F90 index c8f8b022b..f5c97a922 100644 --- a/scm/src/scm_output.F90 +++ b/scm/src/scm_output.F90 @@ -563,14 +563,14 @@ subroutine output_append_sfcprop(ncid, scm_state, physics) if (scm_state%model_ics .or. scm_state%lsm_ics) then if (physics%Model%lsoil_lsm > 0) then missing_value_2D = missing_value - if (physics%Model%lsm == physics%Model%lsm_noah .or. physics%Model%lsm == physics%Model%lsm_noahmp) then + if (physics%Model%lsm == physics%Model%ilsm_noah .or. physics%Model%lsm == physics%Model%ilsm_noahmp) then call NetCDF_put_var(ncid, 'soil_T', physics%Sfcprop%stc(:,:), scm_state%itt_out) call NetCDF_put_var(ncid, 'soil_moisture', physics%Sfcprop%smc(:,:), scm_state%itt_out) call NetCDF_put_var(ncid, 'soil_moisture_unfrozen', physics%Sfcprop%slc(:,:), scm_state%itt_out) call NetCDF_put_var(ncid, 'soil_moisture_total_vol_frac', missing_value_2D, scm_state%itt_out) call NetCDF_put_var(ncid, 'soil_moisture_unfrozen_vol_frac', missing_value_2D, scm_state%itt_out) call NetCDF_put_var(ncid, 'soil_moisture_frozen_vol_frac', missing_value_2D, scm_state%itt_out) - else if (physics%Model%lsm == physics%Model%lsm_ruc) then + else if (physics%Model%lsm == physics%Model%ilsm_ruc) then call NetCDF_put_var(ncid, 'soil_T', physics%Sfcprop%tslb(:,:), scm_state%itt_out) call NetCDF_put_var(ncid, 'soil_moisture', missing_value_2D, scm_state%itt_out) call NetCDF_put_var(ncid, 'soil_moisture_unfrozen', missing_value_2D, scm_state%itt_out) diff --git a/scm/src/scm_physical_constants.F90 b/scm/src/scm_physical_constants.F90 index 099836c3f..8aa7314b7 100644 --- a/scm/src/scm_physical_constants.F90 +++ b/scm/src/scm_physical_constants.F90 @@ -1,6 +1,6 @@ module scm_physical_constants -use scm_kinds, only: dp +use scm_kinds, only: kind_phys=>dp implicit none @@ -9,64 +9,63 @@ module scm_physical_constants !> \section arg_table_scm_physical_constants !! \htmlinclude scm_physical_constants.html !! - integer ,parameter:: con_zero =0 - real(kind=dp),parameter:: con_pi =3.1415926535897931 - - real(kind=dp),parameter:: con_rerth =6.3712e+6 - real(kind=dp),parameter:: con_g =9.80665e+0 - real(kind=dp),parameter:: con_omega =7.2921e-5 - real(kind=dp),parameter:: con_p0 =1.01325e+5 + integer ,parameter:: con_zero =0 + real(kind=kind_phys),parameter:: con_pi =3.1415926535897931 + + real(kind=kind_phys),parameter:: con_rerth =6.3712e+6 + real(kind=kind_phys),parameter:: con_g =9.80665e+0 + real(kind=kind_phys),parameter:: con_omega =7.2921e-5 + real(kind=kind_phys),parameter:: con_p0 =1.01325e+5 - real(kind=dp),parameter:: con_rgas =8.314472_dp - real(kind=dp),parameter:: con_rd =2.8705e+2 - real(kind=dp),parameter:: con_rv =4.6150e+2 - real(kind=dp),parameter:: con_cp =1.0046e+3 - real(kind=dp),parameter:: con_cliq =4.1855e+3 - real(kind=dp),parameter:: con_csol =2.1060e+3 - real(kind=dp),parameter:: con_cvap =1.8460e+3 - real(kind=dp),parameter:: con_hvap =2.5000e+6 - real(kind=dp),parameter:: con_hfus =3.3358e+5 - real(kind=dp),parameter:: con_psat =6.1078e+2_dp !< pres at H2O 3pt (\f$Pa\f$) - real(kind=dp),parameter:: con_t0c =2.7315e+2 - real(kind=dp),parameter:: con_ttp =2.7316e+2 - real(kind=dp),parameter:: con_epsq =1.0E-12_dp - real(kind=dp),parameter:: con_epsqs =1.0E-10_dp + real(kind=kind_phys),parameter:: con_rgas =8.314472_kind_phys + real(kind=kind_phys),parameter:: con_rd =2.8705e+2 + real(kind=kind_phys),parameter:: con_rv =4.6150e+2 + real(kind=kind_phys),parameter:: con_cp =1.0046e+3 + real(kind=kind_phys),parameter:: con_cliq =4.1855e+3 + real(kind=kind_phys),parameter:: con_csol =2.1060e+3 + real(kind=kind_phys),parameter:: con_cvap =1.8460e+3 + real(kind=kind_phys),parameter:: con_hvap =2.5000e+6 + real(kind=kind_phys),parameter:: con_hfus =3.3358e+5 + real(kind=kind_phys),parameter:: con_psat =6.1078e+2_kind_phys !< pres at H2O 3pt (\f$Pa\f$) + real(kind=kind_phys),parameter:: con_t0c =2.7315e+2 + real(kind=kind_phys),parameter:: con_ttp =2.7316e+2 + real(kind=kind_phys),parameter:: con_epsq =1.0E-12_kind_phys + real(kind=kind_phys),parameter:: con_epsqs =1.0E-10_kind_phys - real(kind=dp),parameter:: con_rocp =con_rd/con_cp - real(kind=dp),parameter:: con_rog =con_rd/con_g - real(kind=dp),parameter:: con_fvirt =con_rv/con_rd - 1._dp - real(kind=dp),parameter:: con_eps =con_rd/con_rv - real(kind=dp),parameter:: con_epsm1 =con_rd/con_rv - 1._dp - real(kind=dp),parameter:: con_1ovg =1._dp/con_g + real(kind=kind_phys),parameter:: con_rocp =con_rd/con_cp + real(kind=kind_phys),parameter:: con_rog =con_rd/con_g + real(kind=kind_phys),parameter:: con_fvirt =con_rv/con_rd - 1._kind_phys + real(kind=kind_phys),parameter:: con_eps =con_rd/con_rv + real(kind=kind_phys),parameter:: con_epsm1 =con_rd/con_rv-1._kind_phys + real(kind=kind_phys),parameter:: con_1ovg =1._kind_phys/con_g - real(kind=dp),parameter:: con_avgd =6.0221415e23_dp - real(kind=dp),parameter:: con_amd =28.9644_dp !< molecular wght of dry air (\f$g/mol\f$) - real(kind=dp),parameter:: con_amw =18.0154_dp - real(kind=dp),parameter:: karman =0.4_dp + real(kind=kind_phys),parameter:: con_avgd =6.0221415e23_kind_phys + real(kind=kind_phys),parameter:: con_amd =28.9644_kind_phys !< molecular wght of dry air (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amw =18.0154_kind_phys + real(kind=kind_phys),parameter:: karman =0.4_kind_phys - real(kind=dp),parameter:: cimin =0.15 + real(kind=kind_phys),parameter:: cimin =0.15 !> minimum rain amount - real(kind=dp),parameter:: rainmin =1.e-13_dp - real(kind=dp),parameter:: rlapse =0.65e-2 - real(kind=dp),parameter:: con_jcal =4.1855E+0 - real(kind=dp),parameter:: con_rhw0 =1022.0 - real(kind=dp),parameter:: con_sbc =5.670400e-8 - real(kind=dp),parameter:: con_tice =2.7120e+2 + real(kind=kind_phys),parameter:: rainmin =1.e-13_kind_phys + real(kind=kind_phys),parameter:: rlapse =0.65e-2 + real(kind=kind_phys),parameter:: con_jcal =4.1855E+0 + real(kind=kind_phys),parameter:: con_rhw0 =1022.0 + real(kind=kind_phys),parameter:: con_sbc =5.670400e-8 + real(kind=kind_phys),parameter:: con_tice =2.7120e+2 - real(kind=dp),parameter:: rhowater =1000._dp - real(kind=dp),parameter:: rholakeice = 0.917e3_dp !< density of ice on lake (kg/m^3) + real(kind=kind_phys),parameter:: rhowater =1000._kind_phys + real(kind=kind_phys),parameter:: rholakeice = 0.917e3_kind_phys !< density of ice on lake (kg/m^3) + real(kind=kind_phys),parameter:: con_c = 2.99792458e+8_kind_phys !< speed of light (\f$m/s\f$) + real(kind=kind_phys),parameter:: con_plnk = 6.6260693e-34_kind_phys !< planck constant (\f$J/s\f$) + real(kind=kind_phys),parameter:: con_boltz = 1.3806505e-23_kind_phys !< boltzmann constant (\f$J/K\f$) + real(kind=kind_phys),parameter:: con_solr_2002 = 1.3660e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-Liu(2002) + real(kind=kind_phys),parameter:: con_solr_2008 = 1.3608e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) + real(kind=kind_phys),parameter:: con_thgni = -38.15_kind_phys !< temperature the H.G.Nuc. ice starts - real(kind=dp),parameter:: con_c = 2.99792458e+8_dp !< speed of light (\f$m/s\f$) - real(kind=dp),parameter:: con_plnk = 6.6260693e-34_dp !< planck constant (\f$J/s\f$) - real(kind=dp),parameter:: con_boltz = 1.3806505e-23_dp !< boltzmann constant (\f$J/K\f$) - real(kind=dp),parameter:: con_solr_2002 = 1.3660e+3_dp !< solar constant (\f$W/m^{2}\f$)-Liu(2002) - real(kind=dp),parameter:: con_solr_2008 = 1.3608e+3_dp !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) - real(kind=dp),parameter:: con_thgni = -38.15_dp !< temperature the H.G.Nuc. ice starts - ! for gfdlmp v3 - real(kind=dp), parameter :: con_one = 1_dp - real(kind=dp), parameter :: con_p001 = 0.001_dp - real(kind=dp), parameter :: con_secinday = 86400._dp + real(kind=kind_phys), parameter :: con_one = 1_kind_phys + real(kind=kind_phys), parameter :: con_p001 = 0.001_kind_phys + real(kind=kind_phys), parameter :: con_secinday = 86400._kind_phys end module scm_physical_constants diff --git a/scm/src/scm_time_integration.F90 b/scm/src/scm_time_integration.F90 index 5bb319033..472867d82 100644 --- a/scm/src/scm_time_integration.F90 +++ b/scm/src/scm_time_integration.F90 @@ -6,13 +6,12 @@ module scm_time_integration use iso_fortran_env, only: error_unit use scm_kinds, only: sp, dp, qp use scm_forcing +use ccpp_config, only: ty_ccpp_config -use ccpp_types, only: ccpp_t -use :: ccpp_static_api, & - only: ccpp_physics_timestep_init, & - ccpp_physics_run, & - ccpp_physics_timestep_finalize - +use :: SCM_ccpp_cap, only: & + ccpp_physics_timestep_init => SCM_ccpp_physics_timestep_initial, & + ccpp_physics_run => SCM_ccpp_physics_run, & + ccpp_physics_timestep_finalize => SCM_ccpp_physics_timestep_final implicit none @@ -54,15 +53,15 @@ subroutine filter(scm_state) !! The subroutine nuopc_rad_update calculates the time-dependent parameters required to run radiation, and nuopc_rad_run calculates the radiative heating rate (but does not apply it). The !! subroutine apply_forcing_leapfrog advances the state variables forward using the leapfrog method and nuopc_phys_run further changes the state variables using the forward method. By the end of !! this subroutine, the unfiltered state variables will have been stepped forward in time. -subroutine do_time_step(scm_state, physics, cdata, in_spinup) +subroutine do_time_step(scm_state, in_spinup, ccpp_suite_parts) use scm_type_defs, only: scm_state_type, physics_type + use scm_mod, only: physics, ccpp_cfg - type(scm_state_type), intent(inout) :: scm_state - type(physics_type), intent(inout) :: physics - type(ccpp_t), intent(inout) :: cdata - logical, intent(in) :: in_spinup + type(scm_state_type), intent(inout) :: scm_state + logical, intent(in) :: in_spinup + character(len=128), intent(in) :: ccpp_suite_parts(:) - integer :: i, ierr, kdt_rad, idtend, itrac + integer :: i, ierr, kdt_rad, idtend, itrac, isuite_part !> \section do_time_step_alg Algorithm !! @{ @@ -133,10 +132,10 @@ subroutine do_time_step(scm_state, physics, cdata, in_spinup) endif enddo - call ccpp_physics_timestep_init(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_init: ' // trim(cdata%errmsg) // '. Exiting...' - error stop trim(cdata%errmsg) + call ccpp_physics_timestep_init(suite_name = trim(trim(adjustl(scm_state%physics_suite_name)))) + if (ccpp_cfg%ccpp_errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_init: ' // trim(ccpp_cfg%ccpp_errmsg) // '. Exiting...' + error stop trim(ccpp_cfg%ccpp_errmsg) end if !--- determine if radiation diagnostics buckets need to be cleared @@ -156,33 +155,22 @@ subroutine do_time_step(scm_state, physics, cdata, in_spinup) call physics%Diag%phys_zero (physics%Model) endif - !CCPP run phase - ! time_vary group doesn't have any run phase (omitted) - ! radiation group - - call physics%Interstitial(1)%create(ixs=1, ixe=1, model=physics%Model) - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="radiation", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group radiation: ' // trim(cdata%errmsg) // '. Exiting...' - error stop - end if - ! process-split physics + !--- Call physics Groups w/ run phase. + call physics%Interstitial(1)%create(ixs=1, ixe=1, model=physics%Model) call physics%Interstitial(1)%reset(physics%Model) - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="phys_ps", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ps: ' // trim(cdata%errmsg) // '. Exiting...' - error stop - end if - ! time-split physics - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="phys_ts", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ts: ' // trim(cdata%errmsg) // '. Exiting...' - error stop - end if - call ccpp_physics_timestep_finalize(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_finalize: ' // trim(cdata%errmsg) // '. Exiting...' - error stop trim(cdata%errmsg) + do isuite_part=1,size(ccpp_suite_parts) + call ccpp_physics_run(suite_name = trim(trim(adjustl(scm_state%physics_suite_name))), & + suite_part = trim(trim(adjustl(ccpp_suite_parts(isuite_part))))) + if (ccpp_cfg%ccpp_errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run: ' // trim(ccpp_cfg%ccpp_errmsg) // '. Exiting...' + error stop trim(ccpp_cfg%ccpp_errmsg) + end if + enddo + + call ccpp_physics_timestep_finalize(suite_name = trim(trim(adjustl(scm_state%physics_suite_name)))) + if (ccpp_cfg%ccpp_errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_finalize: ' // trim(ccpp_cfg%ccpp_errmsg) // '. Exiting...' + error stop trim(ccpp_cfg%ccpp_errmsg) end if !if no physics call, need to transfer state_variables(:,:,1) to state_variables (:,:,2) diff --git a/scm/src/scm_type_defs.F90 b/scm/src/scm_type_defs.F90 index a06e49e81..be2b303a8 100644 --- a/scm/src/scm_type_defs.F90 +++ b/scm/src/scm_type_defs.F90 @@ -2,11 +2,6 @@ !! Contains type definitions for SCM-related variables and physics-related variables module scm_type_defs - -!> \section arg_table_scm_type_defs -!! \htmlinclude scm_type_defs.html -!! - use iso_fortran_env, only: error_unit use scm_kinds, only: sp, dp, qp use GFS_typedefs, only: GFS_control_type, & @@ -23,9 +18,29 @@ module scm_type_defs get_tracer_index use CCPP_typedefs, only: GFS_interstitial_type use machine, only: kind_phys - use ccpp_types, only: ccpp_t - + implicit none +!> \section arg_table_physics_type +!! \htmlinclude physics_type.html +!! + type physics_type + type(GFS_control_type) :: Model + type(GFS_statein_type) :: Statein + type(GFS_stateout_type) :: Stateout + type(GFS_sfcprop_type) :: Sfcprop + type(GFS_coupling_type) :: Coupling + type(GFS_grid_type) :: Grid + type(GFS_tbd_type) :: Tbd + type(GFS_cldprop_type) :: Cldprop + type(GFS_radtend_type) :: Radtend + type(GFS_diag_type) :: Diag + type(GFS_interstitial_type), allocatable :: Interstitial(:) + type(GFS_init_type) :: Init_parm + contains + procedure :: create => physics_create + procedure :: associate => physics_associate + procedure :: set => physics_set + end type physics_type integer, parameter :: character_length = 80 integer, parameter :: int_zero = 0 @@ -36,17 +51,19 @@ module scm_type_defs character(len = character_length) :: clear_char = '' - +!> \section arg_table_scm_state_type +!! \htmlinclude scm_state_type.html +!! type scm_state_type - character(len=character_length) :: experiment_name !> name of model configuration file - character(len=character_length) :: npz_type !< used to define different FV3 vertical grids - character(len=character_length) :: vert_coord_file !< name of vertical coordinate file - character(len=character_length) :: output_dir !< name of output directory to place netCDF file - character(len=character_length) :: output_file !< name of output file (without the file extension) - character(len=character_length) :: case_name !< name of case initialization and forcing to use (different than experiment name, which names the model run (as a control, experiment_1, etc.)) - character(len=character_length) :: physics_suite_name !< name of physics suite (must be "GFS_operational" for prototype) - character(len=character_length) :: physics_nml + character(len=80) :: experiment_name !> name of model configuration file + character(len=80) :: npz_type !< used to define different FV3 vertical grids + character(len=80) :: vert_coord_file !< name of vertical coordinate file + character(len=80) :: output_dir !< name of output directory to place netCDF file + character(len=80) :: output_file !< name of output file (without the file extension) + character(len=80) :: case_name !< name of case initialization and forcing to use (different than experiment name, which names the model run (as a control, experiment_1, etc.)) + character(len=80) :: physics_suite_name !< name of physics suite (must be "GFS_operational" for prototype) + character(len=80) :: physics_nml integer :: n_levels !< number of model levels integer :: n_soil !< number of model levels @@ -179,6 +196,9 @@ module scm_type_defs end type scm_state_type +!> \section arg_table_scm_input_type +!! \htmlinclude scm_input_type.html +!! type scm_input_type !> - Define the case-specific initialization and forcing variables. integer :: input_nlev !< number of levels in the input file @@ -405,6 +425,9 @@ module scm_type_defs end type scm_input_type +!> \section arg_table_scm_reference_type +!! \htmlinclude scm_reference_type.html +!! type scm_reference_type !> - Define the reference profile variables. integer :: ref_nlev !< number of levels in the reference profile @@ -418,40 +441,12 @@ module scm_type_defs end type scm_reference_type -!> \section arg_table_physics_type -!! \htmlinclude physics_type.html -!! - type physics_type - - type(GFS_control_type) :: Model - type(GFS_statein_type) :: Statein - type(GFS_stateout_type) :: Stateout - type(GFS_sfcprop_type) :: Sfcprop - type(GFS_coupling_type) :: Coupling - type(GFS_grid_type) :: Grid - type(GFS_tbd_type) :: Tbd - type(GFS_cldprop_type) :: Cldprop - type(GFS_radtend_type) :: Radtend - type(GFS_diag_type) :: Diag - type(GFS_interstitial_type), allocatable :: Interstitial(:) - type(GFS_init_type) :: Init_parm - - contains - procedure :: create => physics_create - procedure :: associate => physics_associate - procedure :: set => physics_set - end type physics_type - - type(physics_type), target :: physics - - type(ccpp_t), target :: cdata - contains subroutine scm_state_create(scm_state, n_columns, n_levels, n_soil, n_snow, n_time_levels, tracers, tracer_types) class(scm_state_type) :: scm_state integer, intent(in) :: n_columns, n_levels, n_soil, n_snow, n_time_levels - character(len=character_length), intent(in), dimension(:) :: tracers + character(len=80), intent(in), dimension(:) :: tracers integer, intent(in), dimension(:) :: tracer_types integer :: i @@ -1435,7 +1430,7 @@ subroutine physics_set(physics, scm_input, scm_state) physics%Sfcprop%emis_ice(i) = 0.96 end if - if (((is_missing_value(scm_input%input_sncovr_ice) .or. scm_input%input_sncovr_ice == real_zero)) .and. physics%Model%lsm /= physics%Model%lsm_ruc) then + if (((is_missing_value(scm_input%input_sncovr_ice) .or. scm_input%input_sncovr_ice == real_zero)) .and. physics%Model%lsm /= physics%Model%ilsm_ruc) then physics%Sfcprop%sncovr_ice(i) = real_zero end if diff --git a/scm/src/scm_type_defs.meta b/scm/src/scm_type_defs.meta index 0950d4568..b47728920 100644 --- a/scm/src/scm_type_defs.meta +++ b/scm/src/scm_type_defs.meta @@ -1,7 +1,38 @@ +######################################################################## +[ccpp-table-properties] + name = scm_state_type + type = ddt + dependencies = + +[ccpp-arg-table] + name = scm_state_type + type = ddt + +######################################################################## +[ccpp-table-properties] + name = scm_input_type + type = ddt + dependencies = + +[ccpp-arg-table] + name = scm_input_type + type = ddt + +######################################################################## +[ccpp-table-properties] + name = scm_reference_type + type = ddt + dependencies = + +[ccpp-arg-table] + name = scm_reference_type + type = ddt + +######################################################################## [ccpp-table-properties] name = physics_type type = ddt - dependencies = GFS_typedefs.F90,CCPP_typedefs.F90 + dependencies = GFS_typedefs.F90,CCPP_typedefs.F90,scm_utils.F90 [ccpp-arg-table] name = physics_type @@ -78,31 +109,9 @@ units = DDT dimensions = (number_of_openmp_threads) type = GFS_interstitial_type - -######################################################################## -[ccpp-table-properties] - name = scm_type_defs - type = module - dependencies = scm_kinds.F90,GFS_typedefs.F90,CCPP_typedefs.F90,../../ccpp/physics/physics/hooks/machine.F - -[ccpp-arg-table] - name = scm_type_defs - type = module -[physics_type] - standard_name = physics_type - long_name = definition of type physics_type - units = DDT - dimensions = () - type = physics_type -[physics] - standard_name = physics_type_instance - long_name = instance of derived data type physics_type - units = DDT - dimensions = () - type = physics_type -[cdata] - standard_name = ccpp_t_instance - long_name = instance of derived data type ccpp_t +[Init_parm] + standard_name = GFS_init_type_instance + long_name = instance of derived type GFS_init_type units = DDT dimensions = () - type = ccpp_t + type = GFS_init_type diff --git a/test/rt_test_cases.py b/test/rt_test_cases.py index 9d200e832..fcd0c223b 100644 --- a/test/rt_test_cases.py +++ b/test/rt_test_cases.py @@ -62,7 +62,6 @@ {"case": "bomex", "suite": "SCM_RRFS_v1beta"}, \ {"case": "bomex", "suite": "SCM_RAP"}, \ {"case": "bomex", "suite": "SCM_GFS_v15p2"}, \ - {"case": "bomex", "suite": "SCM_GFS_v16_debug"}, \ {"case": "astex", "suite": "SCM_GFS_v17_p8"}, \ {"case": "astex", "suite": "SCM_HRRR"}, \ {"case": "astex", "suite": "SCM_RRFS_v1beta"}, \ @@ -73,3 +72,4 @@ {"case": "LASSO_2016051812", "suite": "SCM_RRFS_v1beta"}, \ {"case": "LASSO_2016051812", "suite": "SCM_RAP"}, \ {"case": "LASSO_2016051812", "suite": "SCM_GFS_v15p2"}] + diff --git a/test/rt_test_cases_v7.py b/test/rt_test_cases_v7.py new file mode 100644 index 000000000..8d3ff0a00 --- /dev/null +++ b/test/rt_test_cases_v7.py @@ -0,0 +1,40 @@ +run_list = [\ + #---------------------------------------------------------------------------------------------------------------------------------------------- + # Supported suites for CCPP Version 7 release + #---------------------------------------------------------------------------------------------------------------------------------------------- + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16_RRTMGP"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_WoFS_v0"}, \ + {"case": "arm_sgp_summer_1997_A", "suite": "SCM_HRRR_gf"}, \ + {"case": "twpice", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \ + {"case": "twpice", "suite": "SCM_GFS_v16_RRTMGP"}, \ + {"case": "twpice", "suite": "SCM_GFS_v16"}, \ + {"case": "twpice", "suite": "SCM_WoFS_v0"}, \ + {"case": "twpice", "suite": "SCM_HRRR_gf"}, \ + {"case": "bomex", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \ + {"case": "bomex", "suite": "SCM_GFS_v16_RRTMGP"}, \ + {"case": "bomex", "suite": "SCM_GFS_v16"}, \ + {"case": "bomex", "suite": "SCM_WoFS_v0"}, \ + {"case": "bomex", "suite": "SCM_HRRR_gf"}, \ + {"case": "astex", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \ + {"case": "astex", "suite": "SCM_GFS_v16_RRTMGP"}, \ + {"case": "astex", "suite": "SCM_GFS_v16"}, \ + {"case": "astex", "suite": "SCM_WoFS_v0"}, \ + {"case": "astex", "suite": "SCM_HRRR_gf"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_GFS_v16_RRTMGP"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_GFS_v16"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_WoFS_v0"}, \ + {"case": "LASSO_2016051812", "suite": "SCM_HRRR_gf"}, \ + {"case": "COMBLE", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \ + {"case": "COMBLE", "suite": "SCM_GFS_v16_RRTMGP"}, \ + {"case": "COMBLE", "suite": "SCM_GFS_v16"}, \ + {"case": "COMBLE", "suite": "SCM_WoFS_v0"}, \ + {"case": "COMBLE", "suite": "SCM_HRRR_gf"}, \ + {"case": "MOSAiC-AMPS", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \ + {"case": "MOSAiC-AMPS", "suite": "SCM_GFS_v16_RRTMGP"}, \ + {"case": "MOSAiC-AMPS", "suite": "SCM_GFS_v16"}, \ + {"case": "MOSAiC-AMPS", "suite": "SCM_WoFS_v0"}, \ + {"case": "MOSAiC-AMPS", "suite": "SCM_HRRR_gf"}, \ + {"case": "gabls3", "suite": "SCM_GFS_v16"}]