diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..21c5ba4f4 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,7 @@ +# This is a comment. +# Each line is a file pattern followed by one or more owners. +# Order is important; the last matching pattern takes the most +# precedence. + +# The components are owned by their respective teams +/FV3/ @noaa-emc/fv3atm-team diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..faa664ab3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,56 @@ +--- +name: Bug report +about: Create a report to fix bugs +title: '' +labels: bug +assignees: '' + +--- + +## Description +Provide a clear and concise description of what the bug is. +Also give a description of how to fix the bug. + + +### To Reproduce: +What compilers/machines are you seeing this with? +Give explicit steps to reproduce the behavior. +1. do this +2. then that +3. then, oops, look at the bug + + +## Additional context +Add any other context about the problem here. +Directly reference any issues or PRs in this or other repositories that this is related to, and describe how they are related. Example: +- needs to be fixed also in noaa-emc/nems/issues/ +- needed for noaa-emc/fv3atm/pull/ + + +## Output + +**Screenshots** +If applicable, drag and drop screenshots to help explain your problem. + +**output logs** +If applicable, include relevant output logs. +Either drag and drop the entire log file here (if a long log) or + +``` +paste the code here (if a short section of log) +``` + +## Testing: + +1. Have you tested the code changes? On what platforms? + +2. Have you run regression test in ufs-weather-model or ufs-s2s-model with code changes? +- Will the baseline results change? +- If the baseline results change, is it expected? Please give brief explanation. + +## Dependent PRs: + +Directly reference any issues or PRs in this or other repositories that this is related to, and describe how they are related. Example: +- required to support noaa-emc/GFDL_atmos_cubed_sphere/issues/ +- ncar/ccpp-physics/pull/ +- associated ufs-weather-model/pull/ diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..12db08eda --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,32 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +## Description +Provide a clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +## Solution +Add a clear and concise description of what solution you provide. + +## Alternatives +If applicable, add a description of any alternative solutions or features you've considered. + +## Testing: + +1. Have you tested the code changes? On what platforms? +2. Have you run regression test in ufs-weather-model or ufs-s2s-model with code changes? +- Will the baseline results change? +- If yes, please give brief explanation of your code updates on the regression test. + +## Dependent PRs: + +Directly reference any issues or PRs in this or other repositories that this is related to, and describe how they are related. Example: +- required to support noaa-emc/GFDL_atmos_cubed_sphere/issues/ +- ncar/ccpp-physics/pull/ +- associated ufs-weather-model/pull/ + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..e4d67029f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,37 @@ +## Description + +(Instructions: this, and all subsequent sections of text should be removed and filled in as appropriate.) +Provide a detailed description of what this PR does. +What bug does it fix, or what feature does it add? +Is a change of answers expected from this PR? + + + +### Issue(s) addressed + +Link the issues to be closed with this PR, whether in this repository, or in another repository. +(Remember, issues should always be created before starting work on a PR branch!) +- fixes # +- fixes noaa-emc/fv3atm/issues/ + + + +## Testing + +How were these changes tested? +What compilers / HPCs was it tested with? +Are the changes covered by regression tests? (If not, why? Do new tests need to be added?) +Have the ufs-weather-model regression test been run? On what platform? +- Will the code updates change regression test baseline? If yes, why? Please show the baseline directory below. +- Please commit the regression test log files in your ufs-weather-model branch + + +## Dependencies + +If testing this branch requires non-default branches in other repositories, list them. +Those branches should have matching names (ideally) + +Do PRs in upstream repositories need to be merged first? +If so add the "waiting for other repos" label and list the upstream PRs +- waiting on noaa-emc/nems/pull/ +- waiting on noaa-emc/fv3atm/pull/ diff --git a/.gitignore b/.gitignore index ac5fcf245..aafab21cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ -*.o +*.[aox] *.mod -*.a *.pyc + +*.sw[a-p] +~ + +build/ +install/ + diff --git a/.gitmodules b/.gitmodules index d253f6966..a14e6cb1c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,16 @@ [submodule "atmos_cubed_sphere"] - path = atmos_cubed_sphere - url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere - branch = dev/emc + path = atmos_cubed_sphere + url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere + branch = dev/emc [submodule "ccpp/framework"] - path = ccpp/framework - url = https://github.com/NCAR/ccpp-framework - branch = master + path = ccpp/framework + url = https://github.com/NCAR/ccpp-framework + branch = main [submodule "ccpp/physics"] - path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = master + path = ccpp/physics + url = https://github.com/dustinswales/ccpp-physics + branch = enhanced_GP2cld_coupling_tight +[submodule "upp"] + path = upp + url = https://github.com/NOAA-EMC/UPP + branch = develop diff --git a/CMakeLists.txt b/CMakeLists.txt index 0af2ea9a7..718ba11b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,120 +1,98 @@ -if(CCPP) - add_definitions(-DCCPP) -endif() -add_subdirectory(cpl) -add_subdirectory(gfsphysics) -add_subdirectory(ipd) -add_subdirectory(io) +############################################################################### +### CCPP +############################################################################### + +add_subdirectory(ccpp) -# fv3core library +############################################################################### +### fv3 dynamical core +############################################################################### + +# These ifdefs need to be turned ON in the dycore. +set(use_WRTCOMP ON) +set(GFS_PHYS ON) +set(GFS_TYPES ON) +set(USE_GFSL63 ON) +add_subdirectory(atmos_cubed_sphere) + +############################################################################### +### fv3atm +############################################################################### +if(INLINE_POST) + set(BUILD_POSTEXEC OFF) + add_subdirectory(upp) + set(POST_SRC io/inline_post.F90 io/post_nems_routines.F90 io/post_gfs.F90 io/post_regional.F90) +else() + set(POST_SRC io/inline_post_stub.F90) + list(APPEND _fv3atm_defs_private NO_INLINE_POST) +endif() -if(NOT CCPP) -set(FAST_PHYSICS_SRCS_F90 atmos_cubed_sphere/model/fv_cmp.F90) +if(NOT PARALLEL_NETCDF) + list(APPEND _fv3atm_defs_private NO_PARALLEL_NETCDF) endif() -add_library( - fv3core - - atmos_cubed_sphere/model/a2b_edge.F90 - atmos_cubed_sphere/model/multi_gases.F90 - atmos_cubed_sphere/model/boundary.F90 - atmos_cubed_sphere/model/dyn_core.F90 - atmos_cubed_sphere/model/fv_arrays.F90 - ${FAST_PHYSICS_SRCS_F90} - atmos_cubed_sphere/model/fv_control.F90 - atmos_cubed_sphere/model/fv_dynamics.F90 - atmos_cubed_sphere/model/fv_fill.F90 - atmos_cubed_sphere/model/fv_grid_utils.F90 - atmos_cubed_sphere/model/fv_mapz.F90 - atmos_cubed_sphere/model/fv_nesting.F90 - atmos_cubed_sphere/model/fv_regional_bc.F90 - atmos_cubed_sphere/model/fv_sg.F90 - atmos_cubed_sphere/model/fv_tracer2d.F90 - atmos_cubed_sphere/model/fv_update_phys.F90 - atmos_cubed_sphere/model/sw_core.F90 - atmos_cubed_sphere/model/tp_core.F90 - atmos_cubed_sphere/model/nh_core.F90 - atmos_cubed_sphere/model/nh_utils.F90 - atmos_cubed_sphere/tools/external_ic.F90 - atmos_cubed_sphere/tools/external_sst.F90 - atmos_cubed_sphere/tools/fv_diagnostics.F90 - atmos_cubed_sphere/tools/fv_eta.F90 - atmos_cubed_sphere/tools/fv_grid_tools.F90 - atmos_cubed_sphere/tools/fv_io.F90 - atmos_cubed_sphere/tools/fv_mp_mod.F90 - atmos_cubed_sphere/tools/fv_nudge.F90 - atmos_cubed_sphere/tools/fv_treat_da_inc.F90 - atmos_cubed_sphere/tools/fv_iau_mod.F90 - atmos_cubed_sphere/tools/fv_restart.F90 - atmos_cubed_sphere/tools/fv_surf_map.F90 - atmos_cubed_sphere/tools/fv_timing.F90 - atmos_cubed_sphere//tools/init_hydro.F90 - atmos_cubed_sphere/tools/sim_nc_mod.F90 - atmos_cubed_sphere/tools/sorted_index.F90 - atmos_cubed_sphere/tools/test_cases.F90 - atmos_cubed_sphere/driver/fvGFS/DYCORE_typedefs.F90 - atmos_cubed_sphere/driver/fvGFS/fv_nggps_diag.F90 - atmos_cubed_sphere/driver/fvGFS/atmosphere.F90 +add_library(fv3atm + atmos_model.F90 + fv3_cap.F90 + module_fv3_config.F90 + module_fcst_grid_comp.F90 + stochastic_physics/stochastic_physics_wrapper.F90 + cpl/module_block_data.F90 + cpl/module_cplfields.F90 + cpl/module_cap_cpl.F90 + io/FV3GFS_io.F90 + io/module_write_netcdf.F90 + io/module_fv3_io_def.F90 + io/module_write_internal_state.F90 + io/module_wrt_grid_comp.F90 + ${POST_SRC} ) -set_property(SOURCE atmos_cubed_sphere/model/nh_utils.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FAST}") -set_property(SOURCE atmos_cubed_sphere/model/fv_mapz.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FAST}") +add_dependencies(fv3atm fv3 fv3ccpp stochastic_physics) -target_link_libraries(fv3core PRIVATE fms) -target_link_libraries(fv3core PRIVATE gfsphysics) -target_link_libraries(fv3core PRIVATE ipd) +list(APPEND _fv3atm_defs_private GFS_PHYS + INTERNAL_FILE_NML + use_WRTCOMP) -target_include_directories(fv3core PRIVATE atmos_cubed_sphere ${ESMF_MOD}) +target_compile_definitions(fv3atm PRIVATE "${_fv3atm_defs_private}") -# end of fv3core +set_target_properties(fv3atm PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) +target_include_directories(fv3atm INTERFACE $ + $) -############################################################################### -### ccpp -############################################################################### -if(CCPP) - add_subdirectory(ccpp) - add_subdirectory(ccpp/driver) - add_dependencies(gfsphysics ccpp ccppphys) - add_dependencies(ccppdriver ccpp ccppphys) - add_dependencies(ccppphys ccpp) - - target_include_directories(fv3core PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src) - target_include_directories(fv3core PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/driver) +if(MULTI_GASES) + list(APPEND _fv3atm_defs_private MULTI_GASES) endif() -set_target_properties(fv3core PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) -target_include_directories(fv3core PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/mod) - -# When specifying an out-of-tree source a binary directory must be explicitly specified. -#add_subdirectory(../stochastic_physics stochastic_physics) -add_subdirectory(stochastic_physics) +target_link_libraries(fv3atm PUBLIC fv3 + fv3ccpp + stochastic_physics + fms) -add_library( - fv3cap +target_link_libraries(fv3atm PUBLIC w3nco::w3nco_d + sp::sp_d + bacio::bacio_4 + esmf) - atmos_model.F90 - fv3_cap.F90 - module_fv3_config.F90 - module_fcst_grid_comp.F90 - time_utils.F90 -) +if(INLINE_POST) + target_link_libraries(fv3atm PUBLIC upp::upp) +endif() -if(CCPP) -target_include_directories(fv3cap PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ccpp/driver/mod) -add_dependencies(fv3cap ccppdriver ccppphys) +if(OPENMP) + target_link_libraries(fv3atm PUBLIC OpenMP::OpenMP_Fortran) endif() -target_include_directories(fv3cap PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/stochastic_physics) -target_compile_definitions(fv3cap PRIVATE -DESMF_VERSION_MAJOR=${ESMF_VERSION_MAJOR}) -target_include_directories(fv3cap PRIVATE ${ESMF_MOD}) - -target_link_libraries(fv3cap PRIVATE fms) -target_link_libraries(fv3cap PRIVATE fv3cpl) -target_link_libraries(fv3cap PRIVATE gfsphysics) -target_link_libraries(fv3cap PRIVATE ipd) -target_link_libraries(fv3cap PRIVATE io) -target_link_libraries(fv3cap PRIVATE fv3core) -target_link_libraries(fv3cap PRIVATE stochastic_physics) - -set_target_properties(fv3cap PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod) -target_include_directories(fv3cap PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/mod) + +############################################################################### +### Install +############################################################################### +install( + TARGETS fv3atm + EXPORT fv3atm-config + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX}) + +install(EXPORT fv3atm-config + DESTINATION lib/cmake) diff --git a/README.md b/README.md new file mode 100644 index 000000000..83df0fe66 --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ + +# fv3atm + +This repository contains a driver and key subcomponents of the +atmospheric component of the NOAA's [Unified Forecast System +(UFS)](https://ufscommunity.org/) weather model. + +The subcomponents include: + + - The Finite-Volume Cubed-Sphere (FV3) dynamical core, originally +from the [Geophysical Fluid Dynamics +Laboratory](https://www.gfdl.noaa.gov/). + - The Common Community Physics Package (CCPP) supported by the + [Developmental Testbed Center + (DTC)](https://dtcenter.org/community-code/common-community-physics-package-ccpp), + including: + - [CCPP Framework](https://github.com/NCAR/ccpp-framework). + - [CCPP Physics](https://github.com/NCAR/ccpp-physics) + - wrapper code to call [UFS stochastic + physics](https://stochastic-physics.readthedocs.io/en/latest/) + - The io code handles netCDF I/O. + - The cpl coupler code connects the different components and allows + them to communicate. + +## Prerequisites + +This package requires the following +[NCEPLIBS](https://github.com/NOAA-EMC/NCEPLIBS) packages: + - [NCEPLIBS-w3nco](https://github.com/NOAA-EMC/NCEPLIBS-w3nco) + - [NCEPLIBS-w3emc](https://github.com/NOAA-EMC/NCEPLIBS-w3emc) + - [NCEPLIBS-bacio](https://github.com/NOAA-EMC/NCEPLIBS-bacio) + - [NCEPLIBS-nemsio](https://github.com/NOAA-EMC/NCEPLIBS-nemsio) + - [NCEPLIBS-sp](https://github.com/NOAA-EMC/NCEPLIBS-sp) + +If the INLINE_POST cmake variable is set, the upp library will be +needed: + - [Unified Post Processing Library](https://github.com/NOAA-EMC/EMC_post) + +This package also requires the following external packages: + - [netcdf-c Library](https://github.com/Unidata/netcdf-c) + - [netcdf-fortran Library](https://github.com/Unidata/netcdf-fortran) + - [ESMF](https://github.com/esmf-org/esmf) + - [GFDL's Flexible Modeling System](https://github.com/NOAA-GFDL/FMS) + +## Obtaining fv3atm + +To obtain fv3atm, clone the git repository, and update the submodules: + +``` +git clone https://github.com/NOAA-EMC/fv3atm.git +cd fv3atm +git submodule update --init --recursive +``` + +## Disclaimer + +The United States Department of Commerce (DOC) GitHub project code is +provided on an "as is" basis and the user assumes responsibility for +its use. DOC has relinquished control of the information and no longer +has responsibility to protect the integrity, confidentiality, or +availability of the information. Any claims against the Department of +Commerce stemming from the use of its GitHub project will be governed +by all applicable Federal law. Any reference to specific commercial +products, processes, or services by service mark, trademark, +manufacturer, or otherwise, does not constitute or imply their +endorsement, recommendation or favoring by the Department of +Commerce. The Department of Commerce seal and logo, or the seal and +logo of a DOC bureau, shall not be used in any manner to imply +endorsement of any commercial product or activity by DOC or the United +States Government. + diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index b108ed294..fab2a60e9 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit b108ed294f4c9f98233a23a37408db664f6344e5 +Subproject commit fab2a60e9c5978dd4a8dbcdc927d366b1e540791 diff --git a/atmos_model.F90 b/atmos_model.F90 index 8637ed838..132b4f403 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -47,12 +47,8 @@ module atmos_model_mod use mpp_mod, only: FATAL, mpp_min, mpp_max, mpp_error, mpp_chksum use mpp_domains_mod, only: domain2d use mpp_mod, only: mpp_get_current_pelist_name -#ifdef INTERNAL_FILE_NML use mpp_mod, only: input_nml_file -#else -use fms_mod, only: open_namelist_file -#endif -use fms_mod, only: file_exist, error_mesg +use fms2_io_mod, only: file_exists use fms_mod, only: close_file, write_version_number, stdlog, stdout use fms_mod, only: clock_flag_default use fms_mod, only: check_nml_error @@ -78,43 +74,32 @@ module atmos_model_mod use atmosphere_mod, only: atmosphere_scalar_field_halo use atmosphere_mod, only: atmosphere_get_bottom_layer use atmosphere_mod, only: set_atmosphere_pelist -use atmosphere_mod, only: Atm, mygrid +use atmosphere_mod, only: Atm, mygrid, get_nth_domain_info use block_control_mod, only: block_control_type, define_blocks_packed use DYCORE_typedefs, only: DYCORE_data_type, DYCORE_diag_type -#ifdef CCPP -use IPD_typedefs, only: IPD_init_type, IPD_diag_type, & - IPD_restart_type, IPD_kind_phys, & - IPD_func0d_proc, IPD_func1d_proc -#else -use IPD_typedefs, only: IPD_init_type, IPD_control_type, & - IPD_data_type, IPD_diag_type, & - IPD_restart_type, IPD_kind_phys, & - IPD_func0d_proc, IPD_func1d_proc -#endif -#ifdef CCPP -use CCPP_data, only: ccpp_suite, & - IPD_control => GFS_control, & - IPD_data => GFS_data, & - IPD_interstitial => GFS_interstitial -use IPD_driver, only: IPD_initialize, IPD_initialize_rst +use GFS_typedefs, only: GFS_init_type, GFS_kind_phys => kind_phys +use GFS_restart, only: GFS_restart_type, GFS_restart_populate +use GFS_diagnostics, only: GFS_externaldiag_type, & + GFS_externaldiag_populate +use CCPP_data, only: ccpp_suite, GFS_control, & + GFS_data, GFS_interstitial +use GFS_init, only: GFS_initialize use CCPP_driver, only: CCPP_step, non_uniform_blocks -#else -use IPD_driver, only: IPD_initialize, IPD_initialize_rst, IPD_step -use physics_abstraction_layer, only: time_vary_step, radiation_step1, physics_step1, physics_step2 -#endif -use stochastic_physics, only: init_stochastic_physics, & - run_stochastic_physics -use stochastic_physics_sfc, only: run_stochastic_physics_sfc +use stochastic_physics_wrapper_mod, only: stochastic_physics_wrapper,stochastic_physics_wrapper_end use FV3GFS_io_mod, only: FV3GFS_restart_read, FV3GFS_restart_write, & - FV3GFS_IPD_checksum, & + FV3GFS_GFS_checksum, & FV3GFS_diag_register, FV3GFS_diag_output, & DIAG_SIZE use fv_iau_mod, only: iau_external_data_type,getiauforcing,iau_initialize use module_fv3_config, only: output_1st_tstep_rst, first_kdt, nsout, & - frestart, restart_endfcst + restart_endfcst, output_fh, fcst_mpi_comm, & + fcst_ntasks +use module_block_data, only: block_atmos_copy, block_data_copy, & + block_data_copy_or_fill, & + block_data_combine_fractions !----------------------------------------------------------------------- @@ -128,34 +113,38 @@ module atmos_model_mod public atmos_model_exchange_phase_1, atmos_model_exchange_phase_2 public atmos_model_restart public get_atmos_model_ungridded_dim +public atmos_model_get_nth_domain_info public addLsmask2grid +public setup_exportdata !----------------------------------------------------------------------- ! type atmos_data_type - integer :: axes(4) ! axis indices (returned by diag_manager) for the atmospheric grid + integer :: axes(4) ! axis indices (returned by diag_manager) for the atmospheric grid ! (they correspond to the x, y, pfull, phalf axes) integer, pointer :: pelist(:) =>null() ! pelist where atmosphere is running. integer :: layout(2) ! computer task laytout logical :: regional ! true if domain is regional logical :: nested ! true if there is a nest + integer :: ngrids ! + integer :: mygrid ! integer :: mlon, mlat integer :: iau_offset ! iau running window length logical :: pe ! current pe. real(kind=8), pointer, dimension(:) :: ak, bk real, pointer, dimension(:,:) :: lon_bnd => null() ! local longitude axis grid box corners in radians. real, pointer, dimension(:,:) :: lat_bnd => null() ! local latitude axis grid box corners in radians. - real(kind=IPD_kind_phys), pointer, dimension(:,:) :: lon => null() ! local longitude axis grid box centers in radians. - real(kind=IPD_kind_phys), pointer, dimension(:,:) :: lat => null() ! local latitude axis grid box centers in radians. - real(kind=IPD_kind_phys), pointer, dimension(:,:) :: dx, dy + real(kind=GFS_kind_phys), pointer, dimension(:,:) :: lon => null() ! local longitude axis grid box centers in radians. + real(kind=GFS_kind_phys), pointer, dimension(:,:) :: lat => null() ! local latitude axis grid box centers in radians. + real(kind=GFS_kind_phys), pointer, dimension(:,:) :: dx, dy real(kind=8), pointer, dimension(:,:) :: area real(kind=8), pointer, dimension(:,:,:) :: layer_hgt, level_hgt type(domain2d) :: domain ! domain decomposition type(time_type) :: Time ! current time type(time_type) :: Time_step ! atmospheric time step. type(time_type) :: Time_init ! reference time. - type(grid_box_type) :: grid ! hold grid information needed for 2nd order conservative flux exchange - type(IPD_diag_type), pointer, dimension(:) :: Diag + type(grid_box_type) :: grid ! hold grid information needed for 2nd order conservative flux exchange + type(GFS_externaldiag_type), pointer, dimension(:) :: Diag end type atmos_data_type ! to calculate gradient on cubic sphere grid. ! @@ -169,14 +158,8 @@ module atmos_model_mod logical :: debug = .false. !logical :: debug = .true. logical :: sync = .false. -integer, parameter :: maxhr = 4096 -real, dimension(maxhr) :: fdiag = 0. -real :: fhmax=384.0, fhmaxhf=120.0, fhout=3.0, fhouthf=1.0,avg_max_length=3600. -#ifdef CCPP -namelist /atmos_model_nml/ blocksize, chksum_debug, dycore_only, debug, sync, fdiag, fhmax, fhmaxhf, fhout, fhouthf, ccpp_suite, avg_max_length -#else -namelist /atmos_model_nml/ blocksize, chksum_debug, dycore_only, debug, sync, fdiag, fhmax, fhmaxhf, fhout, fhouthf, avg_max_length -#endif +real :: avg_max_length=3600. +namelist /atmos_model_nml/ blocksize, chksum_debug, dycore_only, debug, sync, ccpp_suite, avg_max_length type (time_type) :: diag_time, diag_time_fhzero @@ -185,21 +168,12 @@ module atmos_model_mod ! DYCORE containers !------------------- type(DYCORE_data_type), allocatable :: DYCORE_Data(:) ! number of blocks -type(DYCORE_diag_type) :: DYCORE_Diag(25) !---------------- -! IPD containers +! GFS containers !---------------- -#ifndef CCPP -type(IPD_control_type) :: IPD_Control -type(IPD_data_type), allocatable :: IPD_Data(:) ! number of blocks -type(IPD_diag_type), target :: IPD_Diag(DIAG_SIZE) -type(IPD_restart_type) :: IPD_Restart -#else -! IPD_Control and IPD_Data are coming from CCPP_data -type(IPD_diag_type), target :: IPD_Diag(DIAG_SIZE) -type(IPD_restart_type) :: IPD_Restart -#endif +type(GFS_externaldiag_type), target :: GFS_Diag(DIAG_SIZE) +type(GFS_restart_type) :: GFS_restart_var !-------------- ! IAU container @@ -222,21 +196,22 @@ module atmos_model_mod logical,parameter :: flip_vc = .true. #endif - real(kind=IPD_kind_phys), parameter :: zero = 0.0_IPD_kind_phys, & - one = 1.0_IPD_kind_phys, & - epsln = 1.0e-10_IPD_kind_phys + real(kind=GFS_kind_phys), parameter :: zero = 0.0_GFS_kind_phys, & + one = 1.0_GFS_kind_phys, & + epsln = 1.0e-10_GFS_kind_phys, & + zorlmin = 1.0e-7_GFS_kind_phys contains !####################################################################### -! +! ! ! ! Called every time step as the atmospheric driver to compute the ! atmospheric tendencies for dynamics, radiation, vertical diffusion of ! momentum, tracers, and heat/moisture. For heat/moisture only the ! downward sweep of the tridiagonal elimination is performed, hence -! the name "_down". +! the name "_down". ! !