From 3c2a8adf698c6d5a49901d5efa45a3d06a7d2c22 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 7 May 2025 16:56:04 -0600 Subject: [PATCH 01/22] Add cam_in variables to registry --- src/data/registry.xml | 138 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 3 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index e0de24647..54ae71ea2 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -574,13 +574,65 @@ - horizontal_dimension 0.0_kind_phys - landfrac cam_in_landfrac + aldif cam_in_aldif + + + horizontal_dimension + 0.0_kind_phys + aldir cam_in_aldir + + + horizontal_dimension + 0.0_kind_phys + asdif cam_in_asdif + + + horizontal_dimension + 0.0_kind_phys + asdir cam_in_asdir + + + horizontal_dimension number_of_ccpp_constituents + 0.0_kind_phys + cflx cam_in_cflx + + + + + + horizontal_dimension ccpp_constant_four + 0.0_kind_phys + dstflx cam_in_dstflx + + + horizontal_dimension + 0.0_kind_phys + fv cam_in_fv 0.0_kind_phys icefrac cam_in_icefrac + + horizontal_dimension + 0.0_kind_phys + landfrac cam_in_landfrac + + + horizontal_dimension + 0.0_kind_phys + lhf cam_in_lhf + + + horizontal_dimension + 0.0_kind_phys + lwup cam_in_lwup + + + horizontal_dimension + 0.0_kind_phys + ocnfrac cam_in_ocnfrac + + + horizontal_dimension + 0.0_kind_phys + ram1 cam_in_ram1 + + + horizontal_dimension + 0.0_kind_phys + shf cam_in_shf + + + horizontal_dimension + 0.0_kind_phys + snowhice cam_in_snowhice + 273.15_kind_phys sst cam_in_sst + + horizontal_dimension + 0.0_kind_phys + ts cam_in_ts + + + horizontal_dimension + 0.0_kind_phys + wsx cam_in_wsx + + + horizontal_dimension + 0.0_kind_phys + wsy cam_in_wsy + From 45de65ffd0b0c4c63aa5fdd0fc070e04b937e87f Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 8 May 2025 14:18:08 -0600 Subject: [PATCH 02/22] Add cam_out variables --- src/data/registry.xml | 189 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 188 insertions(+), 1 deletion(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index 54ae71ea2..a1bd608ac 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -675,7 +675,7 @@ ocnfrac cam_in_ocnfrac horizontal_dimension @@ -741,6 +741,193 @@ wsy cam_in_wsy + + + horizontal_dimension + 0.0_kind_phys + bcphidry cam_out_bcphidry + + + horizontal_dimension + 0.0_kind_phys + bcphiwet cam_out_bcphidwet + + + horizontal_dimension + 0.0_kind_phys + bcphodry cam_out_bcphodry + + + horizontal_dimension + 0.0_kind_phys + dstdry1 cam_out_dstdry1 + + + horizontal_dimension + 0.0_kind_phys + dstdry2 cam_out_dstdry2 + + + horizontal_dimension + 0.0_kind_phys + dstdry3 cam_out_dstdry3 + + + horizontal_dimension + 0.0_kind_phys + dstdry4 cam_out_dstdry4 + + + horizontal_dimension + 0.0_kind_phys + dstwet1 cam_out_dstwet1 + + + horizontal_dimension + 0.0_kind_phys + dstwet2 cam_out_dstwet2 + + + horizontal_dimension + 0.0_kind_phys + dstwet3 cam_out_dstwet3 + + + horizontal_dimension + 0.0_kind_phys + dstwet4 cam_out_dstwet4 + + + horizontal_dimension + 0.0_kind_phys + netsw cam_out_netsw + + + horizontal_dimension + 0.0_kind_phys + ocphidry cam_out_ocphidry + + + horizontal_dimension + 0.0_kind_phys + ocphiwet cam_out_ocphiwet + + + horizontal_dimension + 0.0_kind_phys + ocphodry cam_out_ocphodry + + + horizontal_dimension + 0.0_kind_phys + precc cam_out_precc + + + horizontal_dimension + 0.0_kind_phys + precl cam_out_precl + + + horizontal_dimension + 0.0_kind_phys + precsc cam_out_precsc + + + horizontal_dimension + 0.0_kind_phys + precsl cam_out_precsl + + + horizontal_dimension + 0.0_kind_phys + soll cam_out_soll + + + horizontal_dimension + 0.0_kind_phys + solld cam_out_solld + + + horizontal_dimension + 0.0_kind_phys + sols cam_out_sols + + + horizontal_dimension + 0.0_kind_phys + solsd cam_out_solsd + + + Date: Fri, 16 May 2025 12:49:59 -0600 Subject: [PATCH 03/22] First mods for cam_in/out --- src/data/physconst.F90 | 2 + src/data/physconst.meta | 6 +++ src/data/registry.xml | 69 ++++++++++++++++++++++++++++----- src/physics/utils/phys_comp.F90 | 3 +- 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/src/data/physconst.F90 b/src/data/physconst.F90 index 8a5283426..f4190414f 100644 --- a/src/data/physconst.F90 +++ b/src/data/physconst.F90 @@ -88,6 +88,8 @@ module physconst real(kind_phys), public, protected :: rearth = real(shr_const_rearth, kind_phys) ! radius of earth (m) real(kind_phys), public, protected :: tmelt = real(shr_const_tkfrz, kind_phys) ! Freezing point of water (K) + integer, public, protected :: ccpp_constant_four = 4 ! constant four + !----- Variables below here are derived from those above ----------------- real(kind_phys), public, protected :: rga = 1._kind_phys/real(shr_const_g, kind_phys) ! reciprocal of gravit (s2 m-1) diff --git a/src/data/physconst.meta b/src/data/physconst.meta index aafe0880b..181c753e8 100644 --- a/src/data/physconst.meta +++ b/src/data/physconst.meta @@ -236,6 +236,12 @@ type = real | kind = kind_phys dimensions = () protected = True +[ ccpp_constant_four ] + standard_name = ccpp_constant_four + units = none + type = integer + dimensions = () + protected = True [ rga ] standard_name = reciprocal_of_gravitational_acceleration units = s2 m-1 diff --git a/src/data/registry.xml b/src/data/registry.xml index a1bd608ac..d9fe7f265 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -431,6 +431,7 @@ tendency_of_eastward_wind_due_to_model_physics tendency_of_northward_wind_due_to_model_physics + @@ -575,7 +576,7 @@ horizontal_dimension @@ -583,7 +584,7 @@ aldif cam_in_aldif horizontal_dimension @@ -591,7 +592,7 @@ aldir cam_in_aldir horizontal_dimension @@ -599,7 +600,7 @@ asdif cam_in_asdif horizontal_dimension @@ -626,6 +627,7 @@ 0.0_kind_phys dstflx cam_in_dstflx + sst cam_in_sst horizontal_dimension @@ -726,7 +728,7 @@ horizontal_dimension 0.0_kind_phys @@ -895,7 +897,7 @@ precsl cam_out_precsl horizontal_dimension @@ -903,7 +905,7 @@ soll cam_out_soll horizontal_dimension @@ -911,7 +913,7 @@ solld cam_out_solld horizontal_dimension @@ -919,7 +921,7 @@ sols cam_out_sols horizontal_dimension @@ -927,6 +929,53 @@ solsd cam_out_solsd + + surface_albedo_due_to_near_ir_diffuse + surface_albedo_due_to_near_ir_direct + surface_albedo_due_to_uv_and_vis_diffuse + surface_albedo_due_to_uv_and_vis_direct + surface_upward_ccpp_constituent_fluxes + surface_upward_dust_fluxes + surface_friction_velocity + sea_ice_area_fraction + land_area_fraction + surface_upward_latent_heat_flux + longwave_upward_radiative_flux_at_surface + ocean_area_fraction + aerodynamical_resistance_tempcac + surface_upward_sensible_heat_flux + lwe_surface_snow_depth_over_ice + lwe_surface_snow_depth_over_land + sea_surface_temperature + blackbody_temperature_at_surface + surface_eastward_wind_stress + surface_northward_wind_stress + + + dry_deposition_flux_of_hydrophilic_black_carbon_at_surface + wet_deposition_flux_of_hydrophilic_black_carbon_at_surface + dry_deposition_flux_of_hydrophobic_black_carbon_at_surface + dry_deposition_of_dust_bin1_tempcac + dry_deposition_of_dust_bin2_tempcac + dry_deposition_of_dust_bin3_tempcac + dry_deposition_of_dust_bin4_tempcac + wet_deposition_of_dust_bin1_tempcac + wet_deposition_of_dust_bin2_tempcac + wet_deposition_of_dust_bin3_tempcac + wet_deposition_of_dust_bin4_tempcac + net_shortwave_flux_at_surface + dry_deposition_flux_of_hydrophilic_organic_carbon_at_surface + wet_deposition_flux_of_hydrophilic_organic_carbon_at_surface + dry_deposition_flux_of_hydrophobic_organic_carbon_at_surface + lwe_convective_precipitation_rate_at_surface + lwe_large_scale_precipitation_rate_at_surface + lwe_convective_snowfall_rate_at_surface + lwe_large_scale_snowfall_rate_at_surface + direct_solar_rad_on_surface_ge_07_tempcac + diffuse_solar_rad_on_surface_ge_07_tempcac + direct_solar_rad_on_surface_lt_07_tempcac + diffuse_solar_rad_on_surface_lt_07_tempcac + diff --git a/src/physics/utils/phys_comp.F90 b/src/physics/utils/phys_comp.F90 index 998f365a1..d463248fd 100644 --- a/src/physics/utils/phys_comp.F90 +++ b/src/physics/utils/phys_comp.F90 @@ -178,12 +178,13 @@ subroutine phys_init() use physics_types, only: allocate_physics_types_fields use cam_ccpp_cap, only: cam_ccpp_physics_initialize use cam_constituents, only: num_advected + use physconst, only: ccpp_constant_four call cam_thermo_init(columns_on_task, pver, pverp) call cam_thermo_formula_init() call allocate_physics_types_fields(columns_on_task, pver, pverp, & - num_advected, set_init_val_in=.true., reallocate_in=.false.) + ccpp_constant_four, num_advected, set_init_val_in=.true., reallocate_in=.false.) call cam_ccpp_physics_initialize(phys_suite_name) if (errcode /= 0) then call endrun('cam_ccpp_physics_initialize: '//trim(errmsg)) From 730ed79719b9dd6c64990cd8989854067afc149f Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 21 May 2025 10:00:33 -0600 Subject: [PATCH 04/22] mods to allow cam_in/out to compile --- src/control/cam_comp.F90 | 11 +- src/control/camsrfexch.F90 | 186 --------------- src/cpl/nuopc/atm_comp_nuopc.F90 | 2 +- src/cpl/nuopc/atm_import_export.F90 | 36 ++- src/cpl/nuopc/atm_stream_ndep.F90 | 9 +- src/data/registry.xml | 355 +++++++++++++++++++++++++++- src/dynamics/mpas/stepon.F90 | 2 +- src/dynamics/none/stepon.F90 | 2 +- src/dynamics/se/stepon.F90 | 2 +- 9 files changed, 374 insertions(+), 231 deletions(-) delete mode 100644 src/control/camsrfexch.F90 diff --git a/src/control/cam_comp.F90 b/src/control/cam_comp.F90 index 16e32984b..16c691b6a 100644 --- a/src/control/cam_comp.F90 +++ b/src/control/cam_comp.F90 @@ -25,7 +25,7 @@ module cam_comp use time_manager, only: is_first_step, is_first_restart_step use time_manager, only: get_curr_calday - use camsrfexch, only: cam_out_t, cam_in_t + use physics_types, only: cam_out_t, cam_in_t use physics_types, only: phys_state, phys_tend use physics_types, only: dtime_phys use physics_types, only: calday @@ -90,7 +90,6 @@ subroutine cam_init(caseid, ctitle, model_doi_url, & use phys_comp, only: phys_register use dyn_comp, only: dyn_init ! use cam_restart, only: cam_read_restart - use camsrfexch, only: hub2atm_alloc, atm2hub_alloc use cam_history, only: history_init_files ! use history_scam, only: scm_intht use cam_pio_utils, only: init_pio_subsystem @@ -234,10 +233,6 @@ subroutine cam_init(caseid, ctitle, model_doi_url, & call dyn_init(cam_runtime_opts, dyn_in, dyn_out) - ! Allocate and setup surface exchange data - call atm2hub_alloc(cam_out) - call hub2atm_alloc(cam_in) - else !!XXgoldyXX: v need to import this @@ -543,7 +538,6 @@ subroutine cam_final(cam_out, cam_in) use stepon, only: stepon_final use phys_comp, only: phys_final use cam_initfiles, only: cam_initfiles_close - use camsrfexch, only: atm2hub_deallocate, hub2atm_deallocate ! use ionosphere_interface, only: ionosphere_final use cam_control_mod, only: initial_run @@ -563,9 +557,6 @@ subroutine cam_final(cam_out, cam_in) call cam_initfiles_close() end if - call hub2atm_deallocate(cam_in) - call atm2hub_deallocate(cam_out) - ! This flush attempts to ensure that asynchronous diagnostic prints ! from all processes do not get mixed up with the "END OF MODEL RUN" ! message printed by masterproc below. The test-model script diff --git a/src/control/camsrfexch.F90 b/src/control/camsrfexch.F90 deleted file mode 100644 index 912ba87f0..000000000 --- a/src/control/camsrfexch.F90 +++ /dev/null @@ -1,186 +0,0 @@ -module camsrfexch - - !----------------------------------------------------------------------- - ! Module to handle data that is exchanged between the CAM atmosphere - ! model and the surface models (land, sea-ice, and ocean). - !----------------------------------------------------------------------- - - use shr_kind_mod, only: r8 => shr_kind_r8, r4 => shr_kind_r4 - use shr_infnan_mod, only: posinf => shr_infnan_posinf, assignment(=) - use cam_abortutils, only: endrun - use string_utils, only: to_str - use cam_logfile, only: iulog - use physics_grid, only: phys_grid_initialized - use srf_field_check, only: active_Sl_ram1, active_Sl_fv, active_Sl_soilw - use srf_field_check, only: active_Fall_flxdst1, active_Fall_flxvoc - use srf_field_check, only: active_Fall_flxfire, active_Faxa_nhx - use srf_field_check, only: active_Faxa_noy - - implicit none - private - - ! Public interfaces - public atm2hub_alloc ! Atmosphere to surface data allocation - public hub2atm_alloc ! Merged hub surface to atmosphere data allocation - public atm2hub_deallocate - public hub2atm_deallocate - public cam_export - - ! Public data types - public cam_out_t ! Data from atmosphere - public cam_in_t ! Merged surface data - - !--------------------------------------------------------------------------- - ! This is the data that is sent from the atmosphere to the surface models - !--------------------------------------------------------------------------- - - !> \section arg_table_cam_out_t Argument Table - !! \htmlinclude arg_table_cam_out_t.html - !! - type cam_out_t - integer :: ncol ! number of columns in chunk - end type cam_out_t - - !--------------------------------------------------------------------------- - ! This is the merged state of and flux from sea-ice, land and ocean surfaces - !--------------------------------------------------------------------------- - - !> \section arg_table_cam_in_t Argument Table - !! \htmlinclude arg_table_cam_in_t.html - !! - type cam_in_t - integer :: ncol ! number of active columns - end type cam_in_t - -!============================================================================== -CONTAINS -!============================================================================== - - subroutine hub2atm_alloc(cam_in) - - ! Allocate space for the surface to atmosphere data type. And initialize - ! the values. - - ! ARGUMENTS: - type(cam_in_t), pointer :: cam_in ! Merged surface state - - ! LOCAL VARIABLES: - integer :: ierror ! Error code - character(len=*), parameter :: subname = 'hub2atm_alloc' - !----------------------------------------------------------------------- - - if ( .not. phys_grid_initialized ) then - call endrun(subname//": phys_grid_init not called yet") - end if - if (associated(cam_in)) then - deallocate(cam_in) - nullify(cam_in) - end if - allocate(cam_in, stat=ierror) - if ( ierror /= 0 )then - call endrun(subname//': allocate cam_in failed with stat: '//& - to_str(ierror)) - end if - - cam_in%ncol = 0 - - end subroutine hub2atm_alloc - - !=========================================================================== - - subroutine atm2hub_alloc(cam_out) - - ! Allocate space for the atmosphere to surface data type. And initialize - ! the values. - - ! ARGUMENTS: - type(cam_out_t), pointer :: cam_out ! Atmosphere to surface input - - ! LOCAL VARIABLES: - integer :: ierror ! Error code - character(len=*), parameter :: subname = 'atm2hub_alloc' - !----------------------------------------------------------------------- - - if (.not. phys_grid_initialized) then - call endrun(subname//": phys_grid_init not called yet") - end if - if (associated(cam_out)) then - deallocate(cam_out) - nullify(cam_out) - end if - allocate(cam_out, stat=ierror) - if ( ierror /= 0 )then - call endrun(subname//': allocate cam_out failed with stat: '//& - to_str(ierror)) - - end if - - end subroutine atm2hub_alloc - - !=========================================================================== - - subroutine atm2hub_deallocate(cam_out) - - type(cam_out_t), pointer :: cam_out ! Atmosphere to surface input - !----------------------------------------------------------------------- - - if(associated(cam_out)) then - deallocate(cam_out) - end if - nullify(cam_out) - - end subroutine atm2hub_deallocate - - !=========================================================================== - - subroutine hub2atm_deallocate(cam_in) - - type(cam_in_t), pointer :: cam_in ! Atmosphere to surface input - - !----------------------------------------------------------------------- - if(associated(cam_in)) then - deallocate(cam_in) - end if - nullify(cam_in) - - end subroutine hub2atm_deallocate - - !====================================================================== - - subroutine cam_export(state, cam_out) - - ! Transfer atmospheric fields into necessary surface data structures - - use physics_types, only: physics_state - use vert_coord, only: pver - use physconst, only: rair, mwdry, mwco2, gravit - - ! Input arguments - type(physics_state), intent(in) :: state - type (cam_out_t), intent(inout) :: cam_out - - ! Local variables - - integer :: i ! Longitude index - integer :: m ! constituent index - integer :: lchnk ! Chunk index - integer :: ncol - integer :: psl_idx - integer :: prec_dp_idx, snow_dp_idx, prec_sh_idx, snow_sh_idx - integer :: prec_sed_idx,snow_sed_idx,prec_pcw_idx,snow_pcw_idx - - real(r8), pointer :: psl(:) - - real(r8), pointer :: prec_dp(:) ! total precip. from deep convection - real(r8), pointer :: snow_dp(:) ! snow from deep convection - real(r8), pointer :: prec_sh(:) ! total precip. from shallow convection - real(r8), pointer :: snow_sh(:) ! snow from shallow convection - real(r8), pointer :: prec_sed(:) ! total precip. from deep convection - real(r8), pointer :: snow_sed(:) ! snow from deep convection - real(r8), pointer :: prec_pcw(:) ! total precipl from shallow convection - real(r8), pointer :: snow_pcw(:) ! snow from shallos convection - !----------------------------------------------------------------------- - - end subroutine cam_export - -end module camsrfexch diff --git a/src/cpl/nuopc/atm_comp_nuopc.F90 b/src/cpl/nuopc/atm_comp_nuopc.F90 index 45fb6ac8d..4e7498b99 100644 --- a/src/cpl/nuopc/atm_comp_nuopc.F90 +++ b/src/cpl/nuopc/atm_comp_nuopc.F90 @@ -43,7 +43,7 @@ module atm_comp_nuopc use cam_instance , only : cam_instance_init, inst_suffix, inst_index use cam_comp , only : cam_init, cam_run1, cam_run2, cam_run3, cam_run4, cam_final use cam_comp , only : cam_timestep_init, cam_timestep_final - use camsrfexch , only : cam_out_t, cam_in_t + use physics_types , only : cam_out_t, cam_in_t ! use radiation , only : nextsw_cday !uncomment once radiation has been CCPP-ized -JN use cam_logfile , only : cam_set_log_unit, iulog use cam_abortutils , only : check_allocate diff --git a/src/cpl/nuopc/atm_import_export.F90 b/src/cpl/nuopc/atm_import_export.F90 index 733e93d5e..24da69356 100644 --- a/src/cpl/nuopc/atm_import_export.F90 +++ b/src/cpl/nuopc/atm_import_export.F90 @@ -458,7 +458,7 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) ! copy from field pointer to CAM-SIMA array data structure ! ----------------------------------------------------- - use camsrfexch , only : cam_in_t + use physics_types , only : cam_in_t use shr_const_mod , only : shr_const_stebol use shr_sys_mod , only : shr_sys_abort use nuopc_shr_methods , only : chkerr @@ -526,9 +526,6 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) ! Required atmosphere input fields !-------------------------- -!Remove once the "cam_in" object has been fully implemented. -JN -#if 0 - if (overwrite_flds) then call state_getfldptr(importState, 'Faxx_taux', fldptr=fldptr_taux, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -540,7 +537,7 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return do i = 1, columns_on_task cam_in%wsx(i) = -fldptr_taux(i) * med2mod_areacor(i) - cam_in%wsy(i) = -fldptr_tauy(g) * med2mod_areacor(i) + cam_in%wsy(i) = -fldptr_tauy(i) * med2mod_areacor(i) cam_in%shf(i) = -fldptr_sen(i) * med2mod_areacor(i) cam_in%cflx(i,1) = -fldptr_evap(i) * med2mod_areacor(i) end do @@ -599,6 +596,8 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) cam_in%landfrac(i) = fldptr_lfrac(i) end do +! Commented out until dimesions are figured out +#if 0 ! Optional fields call state_getfldptr(importState, 'Sl_ram1', fldptr=fldptr1d, exists=exists, rc=rc) @@ -676,7 +675,11 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) cam_in%fireztop(i) = fldptr1d(i) end do end if +#endif +#if 0 +# Ignoring depvel for now as it has a problematic dimension and it was determined that it probably +# will not be used in CAM-SIMA for some time ! dry dep velocities call state_getfldptr(importState, 'Sl_ddvel', fldptr2d=fldptr2d, exists=exists, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -687,7 +690,9 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) end do end do end if +#endif +#if 0 ! fields needed to calculate water isotopes to ocean evaporation processes call state_getfldptr(importState, 'So_ustar', fldptr=fldptr1d, exists=exists, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -806,7 +811,9 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) cam_in%cflx(i,c_i(4)) = cam_in%cflx(i,c_i(1)) + cam_in%cflx(i,c_i(2)) + cam_in%cflx(i,c_i(3)) end do end do + end if +#endif ! if first step, determine longwave up flux from the surface temperature if (first_time) then @@ -818,9 +825,6 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) first_time = .false. end if -!Remove once the "cam_in" object has been fully implemented. -JN -#endif - end subroutine import_fields !=============================================================================== @@ -835,7 +839,7 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) use ESMF , only : ESMF_Clock use nuopc_shr_methods , only : chkerr use srf_field_check , only : active_Faxa_nhx, active_Faxa_noy - use camsrfexch , only : cam_out_t + use physics_types , only : cam_out_t use time_manager , only : is_first_step, get_nstep use physics_grid , only : columns_on_task use atm_stream_ndep , only : stream_ndep_init, stream_ndep_interp @@ -884,9 +888,6 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) call NUOPC_ModelGet(gcomp, exportState=exportState, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return -!Remove once the "cam_in" object has been fully implemented. -JN -#if 0 - ! required export state variables call state_getfldptr(exportState, 'Sa_topo', fldptr=fldptr_topo, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -947,8 +948,8 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) fldptr_swnet(i) = cam_out%netsw(i) * mod2med_areacor(i) fldptr_snowc(i) = cam_out%precsc(i)*1000._r8 * mod2med_areacor(i) fldptr_snowl(i) = cam_out%precsl(i)*1000._r8 * mod2med_areacor(i) - fldptr_rainc(i) = (cam_out%precc(i) - cam_out(c)%precsc(i))*1000._r8 * mod2med_areacor(i) - fldptr_rainl(i) = (cam_out%precl(i) - cam_out(c)%precsl(i))*1000._r8 * mod2med_areacor(i) + fldptr_rainc(i) = (cam_out%precc(i) - cam_out%precsc(i))*1000._r8 * mod2med_areacor(i) + fldptr_rainl(i) = (cam_out%precl(i) - cam_out%precsl(i))*1000._r8 * mod2med_areacor(i) fldptr_soll(i) = cam_out%soll(i) * mod2med_areacor(i) fldptr_sols(i) = cam_out%sols(i) * mod2med_areacor(i) fldptr_solld(i) = cam_out%solld(i) * mod2med_areacor(i) @@ -1035,13 +1036,10 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) scale_ndep = 1._r8 end if do i = 1, columns_on_task - fldptr_ndep(1,i) = cam_out(c)%nhx_nitrogen_flx(i) * scale_ndep * mod2med_areacor(i) - fldptr_ndep(2,i) = cam_out(c)%noy_nitrogen_flx(i) * scale_ndep * mod2med_areacor(i) + fldptr_ndep(1,i) = cam_out%nhx_nitrogen_flx(i) * scale_ndep * mod2med_areacor(i) + fldptr_ndep(2,i) = cam_out%noy_nitrogen_flx(i) * scale_ndep * mod2med_areacor(i) end do -!Remove once the "cam_in" object has been fully implemented. -JN -#endif - end subroutine export_fields !=============================================================================== diff --git a/src/cpl/nuopc/atm_stream_ndep.F90 b/src/cpl/nuopc/atm_stream_ndep.F90 index dc8616ad8..2769f28a8 100644 --- a/src/cpl/nuopc/atm_stream_ndep.F90 +++ b/src/cpl/nuopc/atm_stream_ndep.F90 @@ -211,7 +211,7 @@ subroutine stream_ndep_interp(cam_out, rc) use dshr_methods_mod , only : dshr_fldbun_getfldptr use dshr_strdata_mod , only : shr_strdata_advance use shr_kind_mod , only : r8 => shr_kind_r8 - use camsrfexch , only : cam_out_t + use physics_types , only : cam_out_t use time_manager , only : get_curr_date use physics_grid , only : columns_on_task use cam_logfile , only : iulog @@ -249,13 +249,10 @@ subroutine stream_ndep_interp(cam_out, rc) call ESMF_Finalize(endflag=ESMF_END_ABORT) end if -!Un-comment once cam_out data structure has been populated -JN -#if 0 do i = 1, columns_on_task - cam_out%nhx_nitrogen_flx(i) = dataptr1d_nhx(g) - cam_out%noy_nitrogen_flx(i) = dataptr1d_noy(g) + cam_out%nhx_nitrogen_flx(i) = dataptr1d_nhx(i) + cam_out%noy_nitrogen_flx(i) = dataptr1d_noy(i) end do -#endif end subroutine stream_ndep_interp diff --git a/src/data/registry.xml b/src/data/registry.xml index d9fe7f265..61d5b9d43 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -6,7 +6,6 @@ $SRCROOT/src/utils/spmd_utils.meta $SRCROOT/src/control/cam_control_mod.meta $SRCROOT/src/control/cam_logfile.meta - $SRCROOT/src/control/camsrfexch.meta $SRCROOT/src/control/runtime_obj.meta $SRCROOT/src/data/physconst.meta $SRCROOT/src/physics/utils/orbital_data.meta @@ -607,6 +606,22 @@ 0.0_kind_phys asdir cam_in_asdir + + horizontal_dimension number_of_ccpp_constituents + 0.0_kind_phys + data_flux_fuel cam_in_data_flux_fuel + + + horizontal_dimension number_of_ccpp_constituents + 0.0_kind_phys + data_flux_ocn cam_in_data_flux_ocn + + + + + + + + + + + + horizontal_dimension ccpp_constant_four + 0.0_kind_phys + fireztop cam_in_fireztop + + + + 0.0_kind_phys lwup cam_in_lwup + + + 0.0_kind_phys ocnfrac cam_in_ocnfrac + + horizontal_dimension + 0.0_kind_phys + cam_in_qref + + + + + + 0.0_kind_phys snowhland cam_in_snowhland + + + + + 273.15_kind_phys sst cam_in_sst + + horizontal_dimension + 0.0_kind_phys + cam_in_tref + 0.0_kind_phys ts cam_in_ts + + horizontal_dimension + 0.0_kind_phys + u10 cam_in_u10 + + + + + + + + 0.0_kind_phys bcphodry cam_out_bcphodry + + horizontal_dimension + 0.0_kind_phys + co2diag cam_out_co2diag + + + horizontal_dimension + 0.0_kind_phys + co2prog cam_out_co2prog + 0.0_kind_phys dstwet4 cam_out_dstwet4 + + horizontal_dimension + 0.0_kind_phys + flwds cam_out_flwds + + + horizontal_dimension + 0.0_kind_phys + lightning_flash_freq cam_out_lightning_flash_freq + 0.0_kind_phys netsw cam_out_netsw + + horizontal_dimension + 0.0_kind_phys + nhx_nitrogen_flx cam_out_nhx_nitrogen_flx + + + horizontal_dimension + 0.0_kind_phys + noy_nitrogen_flx cam_out_noy_nitrogen_flx + 0.0_kind_phys ocphodry cam_out_ocphodry + + horizontal_dimension + 0.0_kind_phys + ozone cam_out_ozone + + + horizontal_dimension + 0.0_kind_phys + pbot cam_out_pbot + 0.0_kind_phys precsl cam_out_precsl + + horizontal_dimension + 0.0_kind_phys + psl cam_out_psl + + + horizontal_dimension number_of_ccpp_constituents + 0.0_kind_phys + qbot cam_out_qbot + + + horizontal_dimension + 0.0_kind_phys + rho cam_out_rho + 0.0_kind_phys solsd cam_out_solsd + + horizontal_dimension + 0.0_kind_phys + thbot cam_out_thbot + + + horizontal_dimension + 0.0_kind_phys + tbot cam_out_tbot + + + horizontal_dimension + 0.0_kind_phys + topo cam_out_topo + + + horizontal_dimension + 0.0_kind_phys + ubot cam_out_ubot + + + horizontal_dimension + 0.0_kind_phys + vbot cam_out_vbot + + + horizontal_dimension + 0.0_kind_phys + zbot cam_out_zbot + - + surface_albedo_due_to_near_ir_diffuse surface_albedo_due_to_near_ir_direct surface_albedo_due_to_uv_and_vis_diffuse surface_albedo_due_to_uv_and_vis_direct surface_upward_ccpp_constituent_fluxes - surface_upward_dust_fluxes - surface_friction_velocity + + + + + + fireztop_tempcac + sea_ice_area_fraction land_area_fraction surface_upward_latent_heat_flux longwave_upward_radiative_flux_at_surface ocean_area_fraction - aerodynamical_resistance_tempcac + water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_at_2m + surface_upward_sensible_heat_flux lwe_surface_snow_depth_over_ice lwe_surface_snow_depth_over_land + sea_surface_temperature + air_temperature_at_2m blackbody_temperature_at_surface + wind_speed_at_10m surface_eastward_wind_stress surface_northward_wind_stress - + dry_deposition_flux_of_hydrophilic_black_carbon_at_surface wet_deposition_flux_of_hydrophilic_black_carbon_at_surface dry_deposition_flux_of_hydrophobic_black_carbon_at_surface + co2diag_tempcac + co2prog_tempcac dry_deposition_of_dust_bin1_tempcac dry_deposition_of_dust_bin2_tempcac dry_deposition_of_dust_bin3_tempcac @@ -963,18 +1291,33 @@ wet_deposition_of_dust_bin2_tempcac wet_deposition_of_dust_bin3_tempcac wet_deposition_of_dust_bin4_tempcac + flwds_tempcac + lightning_flash_freq_tempcac net_shortwave_flux_at_surface + reduced_nitrogen_deposition_flux_tempcac + nitrogen_oxides_deposition_flux_tempcac dry_deposition_flux_of_hydrophilic_organic_carbon_at_surface wet_deposition_flux_of_hydrophilic_organic_carbon_at_surface dry_deposition_flux_of_hydrophobic_organic_carbon_at_surface + ozone_tempcac + pbot_tempcac lwe_convective_precipitation_rate_at_surface lwe_large_scale_precipitation_rate_at_surface lwe_convective_snowfall_rate_at_surface lwe_large_scale_snowfall_rate_at_surface direct_solar_rad_on_surface_ge_07_tempcac + psl_tempcac + qbot_tempcac + rho_tempcac diffuse_solar_rad_on_surface_ge_07_tempcac direct_solar_rad_on_surface_lt_07_tempcac diffuse_solar_rad_on_surface_lt_07_tempcac + thbot_tempcac + tbot_tempcac + topo_tempcac + ubot_tempcac + vbot_tempcac + zbot_tempcac diff --git a/src/dynamics/mpas/stepon.F90 b/src/dynamics/mpas/stepon.F90 index 436792c59..addf9ea55 100644 --- a/src/dynamics/mpas/stepon.F90 +++ b/src/dynamics/mpas/stepon.F90 @@ -72,7 +72,7 @@ end subroutine stepon_run2 ! Called by `cam_run3` in `src/control/cam_comp.F90`. subroutine stepon_run3(dtime_phys, cam_runtime_opts, cam_out, phys_state, dyn_in, dyn_out) ! Module(s) from CAM-SIMA. - use camsrfexch, only: cam_out_t + use physics_types, only: cam_out_t use dyn_comp, only: dyn_export_t, dyn_import_t, dyn_run use physics_types, only: physics_state use runtime_obj, only: runtime_options diff --git a/src/dynamics/none/stepon.F90 b/src/dynamics/none/stepon.F90 index ac343eee6..153a7b4e6 100644 --- a/src/dynamics/none/stepon.F90 +++ b/src/dynamics/none/stepon.F90 @@ -76,7 +76,7 @@ end subroutine stepon_run2 subroutine stepon_run3(dtime, cam_runtime_opts, cam_out, phys_state, & dyn_in, dyn_out) use runtime_obj, only: runtime_options - use camsrfexch, only: cam_out_t + use physics_types, only: cam_out_t use dyn_comp, only: dyn_run use perf_mod, only: t_startf, t_stopf, t_barrierf diff --git a/src/dynamics/se/stepon.F90 b/src/dynamics/se/stepon.F90 index 138a61256..ac46e2af2 100644 --- a/src/dynamics/se/stepon.F90 +++ b/src/dynamics/se/stepon.F90 @@ -121,7 +121,7 @@ end subroutine stepon_run2 subroutine stepon_run3(dtime, cam_runtime_opts, cam_out, phys_state, dyn_in, dyn_out) - use camsrfexch, only: cam_out_t + use physics_types, only: cam_out_t !SE/CAM interface: use dyn_comp, only: dyn_run From cfea13ba87a8eeacd94cb447233ab2b6231c91e2 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 22 May 2025 10:47:25 -0600 Subject: [PATCH 05/22] changes to get the code to compile/run on derecho --- src/data/registry.xml | 14 +++++++++++++- src/physics/utils/musica_ccpp_dependencies.F90 | 15 +++------------ src/physics/utils/musica_ccpp_dependencies.meta | 12 ------------ 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index 61d5b9d43..65f0cb65e 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -909,7 +909,7 @@ horizontal_dimension 0.0_kind_phys @@ -1277,6 +1277,13 @@ surface_eastward_wind_stress surface_northward_wind_stress + + + + + dry_deposition_flux_of_hydrophilic_black_carbon_at_surface wet_deposition_flux_of_hydrophilic_black_carbon_at_surface @@ -1320,6 +1327,11 @@ zbot_tempcac + + + Date: Thu, 26 Jun 2025 16:20:44 -0600 Subject: [PATCH 06/22] Update cam_in variable standard names --- src/data/registry.xml | 86 +++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index 0375200bc..5b8bc27c0 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -573,9 +573,19 @@ GRAUQM cnst_GRAUQM + + horizontal_dimension + + 0.0_kind_phys + LANDM_COSLAT pbuf_LANDM + + horizontal_dimension @@ -583,7 +593,7 @@ aldif cam_in_aldif horizontal_dimension @@ -591,7 +601,7 @@ aldir cam_in_aldir horizontal_dimension @@ -599,7 +609,7 @@ asdif cam_in_asdif horizontal_dimension @@ -623,7 +633,7 @@ data_flux_ocn cam_in_data_flux_ocn horizontal_dimension number_of_ccpp_constituents @@ -636,7 +646,7 @@ horizontal_dimension ccpp_constant_four @@ -700,7 +710,7 @@ horizontal_dimension @@ -718,7 +728,7 @@ icefrac cam_in_icefrac horizontal_dimension @@ -726,7 +736,7 @@ landfrac cam_in_landfrac horizontal_dimension @@ -734,7 +744,7 @@ lhf cam_in_lhf horizontal_dimension @@ -754,7 +764,7 @@ END COMMENT --> horizontal_dimension @@ -762,7 +772,7 @@ ocnfrac cam_in_ocnfrac horizontal_dimension @@ -772,7 +782,7 @@ horizontal_dimension @@ -801,7 +811,7 @@ shf cam_in_shf horizontal_dimension @@ -809,7 +819,7 @@ snowhice cam_in_snowhice horizontal_dimension @@ -819,7 +829,7 @@ horizontal_dimension @@ -850,7 +860,7 @@ sst cam_in_sst horizontal_dimension @@ -858,7 +868,7 @@ cam_in_tref horizontal_dimension @@ -866,7 +876,7 @@ ts cam_in_ts horizontal_dimension @@ -876,7 +886,7 @@ - - horizontal_dimension - - 0.0_kind_phys - LANDM_COSLAT pbuf_LANDM - - horizontal_dimension @@ -926,7 +926,7 @@ wsx cam_in_wsx horizontal_dimension From 9ab9bf594e317dea49296e79225e93616df7a63a Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 27 Jun 2025 14:29:21 -0600 Subject: [PATCH 07/22] Mods for cam_in/out --- src/data/registry.xml | 214 ++++++++++++++++++++++-------------------- 1 file changed, 111 insertions(+), 103 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index 5b8bc27c0..befdcb576 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -936,7 +936,7 @@ horizontal_dimension @@ -944,7 +944,7 @@ bcphidry cam_out_bcphidry horizontal_dimension @@ -952,7 +952,7 @@ bcphiwet cam_out_bcphidwet horizontal_dimension @@ -976,7 +976,7 @@ co2prog cam_out_co2prog horizontal_dimension @@ -984,7 +984,7 @@ dstdry1 cam_out_dstdry1 horizontal_dimension @@ -992,7 +992,7 @@ dstdry2 cam_out_dstdry2 horizontal_dimension @@ -1000,7 +1000,7 @@ dstdry3 cam_out_dstdry3 horizontal_dimension @@ -1008,7 +1008,7 @@ dstdry4 cam_out_dstdry4 horizontal_dimension @@ -1016,7 +1016,7 @@ dstwet1 cam_out_dstwet1 horizontal_dimension @@ -1024,7 +1024,7 @@ dstwet2 cam_out_dstwet2 horizontal_dimension @@ -1032,7 +1032,7 @@ dstwet3 cam_out_dstwet3 horizontal_dimension @@ -1040,7 +1040,7 @@ dstwet4 cam_out_dstwet4 horizontal_dimension @@ -1048,7 +1048,7 @@ flwds cam_out_flwds horizontal_dimension @@ -1056,7 +1056,7 @@ lightning_flash_freq cam_out_lightning_flash_freq horizontal_dimension @@ -1064,7 +1064,7 @@ netsw cam_out_netsw horizontal_dimension @@ -1072,7 +1072,7 @@ nhx_nitrogen_flx cam_out_nhx_nitrogen_flx horizontal_dimension @@ -1080,7 +1080,7 @@ noy_nitrogen_flx cam_out_noy_nitrogen_flx horizontal_dimension @@ -1088,7 +1088,7 @@ ocphidry cam_out_ocphidry horizontal_dimension @@ -1096,7 +1096,7 @@ ocphiwet cam_out_ocphiwet horizontal_dimension @@ -1104,7 +1104,7 @@ ocphodry cam_out_ocphodry horizontal_dimension @@ -1112,7 +1112,7 @@ ozone cam_out_ozone horizontal_dimension @@ -1120,7 +1120,7 @@ pbot cam_out_pbot horizontal_dimension @@ -1128,7 +1128,7 @@ precc cam_out_precc horizontal_dimension @@ -1136,7 +1136,7 @@ precl cam_out_precl horizontal_dimension @@ -1144,7 +1144,7 @@ precsc cam_out_precsc horizontal_dimension @@ -1152,7 +1152,7 @@ precsl cam_out_precsl horizontal_dimension @@ -1160,7 +1160,7 @@ psl cam_out_psl horizontal_dimension number_of_ccpp_constituents @@ -1168,7 +1168,7 @@ qbot cam_out_qbot horizontal_dimension @@ -1208,7 +1208,7 @@ solsd cam_out_solsd horizontal_dimension @@ -1216,7 +1216,7 @@ thbot cam_out_thbot horizontal_dimension @@ -1224,7 +1224,7 @@ tbot cam_out_tbot horizontal_dimension @@ -1232,7 +1232,7 @@ topo cam_out_topo horizontal_dimension @@ -1240,7 +1240,7 @@ ubot cam_out_ubot horizontal_dimension @@ -1248,7 +1248,7 @@ vbot cam_out_vbot horizontal_dimension @@ -1257,35 +1257,43 @@ - surface_albedo_due_to_near_ir_diffuse - surface_albedo_due_to_near_ir_direct - surface_albedo_due_to_uv_and_vis_diffuse - surface_albedo_due_to_uv_and_vis_direct - surface_upward_ccpp_constituent_fluxes - - - - - - fireztop_tempcac - - sea_ice_area_fraction - land_area_fraction - surface_upward_latent_heat_flux - longwave_upward_radiative_flux_at_surface - ocean_area_fraction - water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_at_2m - - surface_upward_sensible_heat_flux - lwe_surface_snow_depth_over_ice - lwe_surface_snow_depth_over_land - - sea_surface_temperature - air_temperature_at_2m - blackbody_temperature_at_surface - wind_speed_at_10m - surface_eastward_wind_stress - surface_northward_wind_stress + surface_albedo_due_to_near_ir_diffuse_from_coupler + surface_albedo_due_to_near_ir_direct_from_coupler + surface_albedo_due_to_uv_and_vis_diffuse_from_coupler + surface_albedo_due_to_uv_and_vis_direct_from_coupler + data_flux_fuel_tempcac + data_flux_ocn_tempcac + surface_upward_ccpp_constituent_fluxes_from_coupler + + + + + + top_height_for_vertically_distributed_fire_emissions_from_coupler + + sea_ice_area_fraction_from_coupler + land_area_fraction_from_coupler + surface_upward_latent_heat_flux_from_coupler + longwave_upward_radiative_flux_at_surface_from_coupler + + ocean_area_fraction_from_coupler + water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_at_2m_from_coupler + + + surface_upward_sensible_heat_flux_from_coupler + lwe_surface_snow_depth_over_ice_from_coupler + lwe_surface_snow_depth_over_land_from_coupler + + + sea_surface_temperature_from_coupler + air_temperature_at_2m_from_coupler + blackbody_temperature_at_surface_from_coupler + wind_speed_at_10m_from_coupler + + + + surface_eastward_wind_stress_from_coupler + surface_northward_wind_stress_from_coupler - dry_deposition_flux_of_hydrophilic_black_carbon_at_surface - wet_deposition_flux_of_hydrophilic_black_carbon_at_surface - dry_deposition_flux_of_hydrophobic_black_carbon_at_surface - co2diag_tempcac - co2prog_tempcac - dry_deposition_of_dust_bin1_tempcac - dry_deposition_of_dust_bin2_tempcac - dry_deposition_of_dust_bin3_tempcac - dry_deposition_of_dust_bin4_tempcac - wet_deposition_of_dust_bin1_tempcac - wet_deposition_of_dust_bin2_tempcac - wet_deposition_of_dust_bin3_tempcac - wet_deposition_of_dust_bin4_tempcac - flwds_tempcac - lightning_flash_freq_tempcac - net_shortwave_flux_at_surface - reduced_nitrogen_deposition_flux_tempcac - nitrogen_oxides_deposition_flux_tempcac - dry_deposition_flux_of_hydrophilic_organic_carbon_at_surface - wet_deposition_flux_of_hydrophilic_organic_carbon_at_surface - dry_deposition_flux_of_hydrophobic_organic_carbon_at_surface - ozone_tempcac - pbot_tempcac - lwe_convective_precipitation_rate_at_surface - lwe_large_scale_precipitation_rate_at_surface - lwe_convective_snowfall_rate_at_surface - lwe_large_scale_snowfall_rate_at_surface - direct_solar_rad_on_surface_ge_07_tempcac - psl_tempcac - qbot_tempcac - rho_tempcac - diffuse_solar_rad_on_surface_ge_07_tempcac - direct_solar_rad_on_surface_lt_07_tempcac - diffuse_solar_rad_on_surface_lt_07_tempcac - thbot_tempcac - tbot_tempcac - topo_tempcac - ubot_tempcac - vbot_tempcac - zbot_tempcac + dry_deposition_flux_of_hydrophilic_black_carbon_at_surface_to_coupler + wet_deposition_flux_of_hydrophilic_black_carbon_at_surface_to_coupler + dry_deposition_flux_of_hydrophobic_black_carbon_at_surface_to_coupler + co2diag_tempcac + co2prog_tempcac + dry_deposition_of_dust_bin1_at_surface_to_coupler + dry_deposition_of_dust_bin2_at_surface_to_coupler + dry_deposition_of_dust_bin3_at_surface_to_coupler + dry_deposition_of_dust_bin4_at_surface_to_coupler + wet_deposition_of_dust_bin1_at_surface_to_coupler + wet_deposition_of_dust_bin2_at_surface_to_coupler + wet_deposition_of_dust_bin3_at_surface_to_coupler + wet_deposition_of_dust_bin4_at_surface_to_coupler + longwave_downward_radiative_flux_at_surface_to_coupler + cloud_to_ground_lightning_flash_frequency_to_coupler + net_shortwave_flux_at_surface_to_coupler + amine_deposition_flux_at_surface_to_coupler + nitrogen_oxides_deposition_flux_at_surface_to_coupler + dry_deposition_flux_of_hydrophilic_organic_carbon_at_surface_to_coupler + wet_deposition_flux_of_hydrophilic_organic_carbon_at_surface_to_coupler + dry_deposition_flux_of_hydrophobic_organic_carbon_at_surface_to_coupler + volumne_mixing_ratio_of_ozone_at_bottom_layer_to_coupler + air_pressure_at_bottom_layer_to_coupler + lwe_convective_precipitation_rate_at_surface_to_coupler + lwe_large_scale_precipitation_rate_at_surface_to_coupler + lwe_convective_snowfall_rate_at_surface_to_coupler + lwe_large_scale_snowfall_rate_at_surface_to_coupler + air_pressure_at_sea_level_to_coupler + constituent_mixing_ratio_at_bottom_layer_to_coupler + air_density_to_coupler + direct_solar_rad_on_surface_ge_07_tempcac + diffuse_solar_rad_on_surface_ge_07_tempcac + direct_solar_rad_on_surface_lt_07_tempcac + diffuse_solar_rad_on_surface_lt_07_tempcac + potential_temperature_wrt_surface_pressure_at_bottom_layer_to_coupler + air_temperature_at_bottom_layer_to_coupler + surface_topographic_height_to_coupler + eastward_wind_at_bottom_layer_to_coupler + northward_wind_at_bottom_layer_to_coupler + geopotential_height_wrt_surface_at_bottom_layer_to_coupler Date: Mon, 30 Jun 2025 12:22:27 -0600 Subject: [PATCH 08/22] Add _tbd to the end of standard_names which are not finalized --- src/data/registry.xml | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index befdcb576..2b5d106a4 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -617,7 +617,7 @@ asdir cam_in_asdir horizontal_dimension number_of_ccpp_constituents @@ -625,7 +625,7 @@ data_flux_fuel cam_in_data_flux_fuel horizontal_dimension number_of_ccpp_constituents @@ -754,7 +754,7 @@ @@ -1275,11 +1275,11 @@ land_area_fraction_from_coupler surface_upward_latent_heat_flux_from_coupler longwave_upward_radiative_flux_at_surface_from_coupler - + ocean_area_fraction_from_coupler water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_at_2m_from_coupler - + surface_upward_sensible_heat_flux_from_coupler lwe_surface_snow_depth_over_ice_from_coupler lwe_surface_snow_depth_over_land_from_coupler @@ -1297,7 +1297,7 @@ @@ -1306,8 +1306,8 @@ dry_deposition_flux_of_hydrophilic_black_carbon_at_surface_to_coupler wet_deposition_flux_of_hydrophilic_black_carbon_at_surface_to_coupler dry_deposition_flux_of_hydrophobic_black_carbon_at_surface_to_coupler - co2diag_tempcac - co2prog_tempcac + co2diag_tbd + co2prog_tbd dry_deposition_of_dust_bin1_at_surface_to_coupler dry_deposition_of_dust_bin2_at_surface_to_coupler dry_deposition_of_dust_bin3_at_surface_to_coupler @@ -1333,10 +1333,10 @@ air_pressure_at_sea_level_to_coupler constituent_mixing_ratio_at_bottom_layer_to_coupler air_density_to_coupler - direct_solar_rad_on_surface_ge_07_tempcac - diffuse_solar_rad_on_surface_ge_07_tempcac - direct_solar_rad_on_surface_lt_07_tempcac - diffuse_solar_rad_on_surface_lt_07_tempcac + direct_solar_rad_on_surface_ge_07_tbd + diffuse_solar_rad_on_surface_ge_07_tbd + direct_solar_rad_on_surface_lt_07_tbd + diffuse_solar_rad_on_surface_lt_07_tbd potential_temperature_wrt_surface_pressure_at_bottom_layer_to_coupler air_temperature_at_bottom_layer_to_coupler surface_topographic_height_to_coupler @@ -1346,7 +1346,7 @@ From c857060bf469daa0ce2acad9d139b18c54399bc6 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 30 Jun 2025 15:16:37 -0600 Subject: [PATCH 09/22] final cleanup of standard_names and units for initial PR --- src/data/registry.xml | 94 ++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 55 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index 2b5d106a4..5e38ac596 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -616,22 +616,6 @@ 0.0_kind_phys asdir cam_in_asdir - - horizontal_dimension number_of_ccpp_constituents - 0.0_kind_phys - data_flux_fuel cam_in_data_flux_fuel - - - horizontal_dimension number_of_ccpp_constituents - 0.0_kind_phys - data_flux_ocn cam_in_data_flux_ocn - cflx cam_in_cflx - + + @@ -1324,7 +1308,7 @@ dry_deposition_flux_of_hydrophilic_organic_carbon_at_surface_to_coupler wet_deposition_flux_of_hydrophilic_organic_carbon_at_surface_to_coupler dry_deposition_flux_of_hydrophobic_organic_carbon_at_surface_to_coupler - volumne_mixing_ratio_of_ozone_at_bottom_layer_to_coupler + volume_mixing_ratio_of_ozone_at_bottom_layer_to_coupler air_pressure_at_bottom_layer_to_coupler lwe_convective_precipitation_rate_at_surface_to_coupler lwe_large_scale_precipitation_rate_at_surface_to_coupler @@ -1333,10 +1317,10 @@ air_pressure_at_sea_level_to_coupler constituent_mixing_ratio_at_bottom_layer_to_coupler air_density_to_coupler - direct_solar_rad_on_surface_ge_07_tbd - diffuse_solar_rad_on_surface_ge_07_tbd - direct_solar_rad_on_surface_lt_07_tbd - diffuse_solar_rad_on_surface_lt_07_tbd + direct_solar_rad_at_surface_ge_700nm_to_coupler + diffuse_solar_rad_at_surface_ge_700nm_to_coupler + direct_solar_rad_at_surface_lt_700nm_to_coupler + diffuse_solar_rad_at_surface_lt_700nm_to_coupler potential_temperature_wrt_surface_pressure_at_bottom_layer_to_coupler air_temperature_at_bottom_layer_to_coupler surface_topographic_height_to_coupler From 2d6fc075b996c61b5bd503f3b807df23370c5496 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 3 Jul 2025 10:47:35 -0600 Subject: [PATCH 10/22] Change order of dimensions in allocate_physics_types_fields call --- src/physics/utils/phys_comp.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/physics/utils/phys_comp.F90 b/src/physics/utils/phys_comp.F90 index d463248fd..973ae8ce9 100644 --- a/src/physics/utils/phys_comp.F90 +++ b/src/physics/utils/phys_comp.F90 @@ -183,8 +183,9 @@ subroutine phys_init() call cam_thermo_init(columns_on_task, pver, pverp) call cam_thermo_formula_init() + ! to add new dimensions, also change generate_registry_data.py __dim_order: call allocate_physics_types_fields(columns_on_task, pver, pverp, & - ccpp_constant_four, num_advected, set_init_val_in=.true., reallocate_in=.false.) + num_advected, ccpp_constant_four, set_init_val_in=.true., reallocate_in=.false.) call cam_ccpp_physics_initialize(phys_suite_name) if (errcode /= 0) then call endrun('cam_ccpp_physics_initialize: '//trim(errmsg)) From 1ef2258f23b7cff24b14c761c3a2e2b74e885bd9 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 3 Jul 2025 10:50:51 -0600 Subject: [PATCH 11/22] Fix constituent dimension name --- src/data/generate_registry_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/generate_registry_data.py b/src/data/generate_registry_data.py index f4bcc10b1..e5907733d 100755 --- a/src/data/generate_registry_data.py +++ b/src/data/generate_registry_data.py @@ -1235,7 +1235,7 @@ class File: __dim_order = {'horizontal_dimension' : 1, 'vertical_layer_dimension' : 2, 'vertical_interface_dimension' : 3, - 'number_of_constituents' : 4} + 'number_of_ccpp_constituents' : 4} __min_dim_key = 5 # For sorting unknown dimensions def __init__(self, file_node, known_types, dycore, From 64e3b8243479778bad9d869f2f88aa5735612185 Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Mon, 7 Jul 2025 16:08:26 -0600 Subject: [PATCH 12/22] Modify registry generator to bring in dimensions via use statements instead of subroutine arguments. --- src/data/generate_registry_data.py | 71 +++++----- src/physics/utils/phys_comp.F90 | 9 +- .../sample_files/physics_types_complete.F90 | 13 +- .../sample_files/physics_types_complete.meta | 2 +- .../sample_files/physics_types_ddt2.F90 | 7 +- .../sample_files/physics_types_ddt_array.F90 | 8 +- .../sample_files/physics_types_ddt_eul.F90 | 9 +- .../sample_files/physics_types_ddt_eul.meta | 2 +- .../sample_files/physics_types_ddt_fv.F90 | 9 +- .../sample_files/physics_types_ddt_fv.meta | 2 +- .../sample_files/physics_types_ddt_mf.F90 | 130 ++++++++++++++++++ .../sample_files/physics_types_ddt_mf.meta | 43 ++++++ .../sample_files/physics_types_ddt_se.F90 | 9 +- .../sample_files/physics_types_ddt_se.meta | 2 +- .../sample_files/physics_types_parameter.F90 | 6 +- .../sample_files/physics_types_simple.F90 | 6 +- .../python/sample_files/reg_good_complete.xml | 8 +- .../unit/python/sample_files/reg_good_ddt.xml | 2 +- test/unit/python/sample_files/reg_good_mf.xml | 4 +- test/unit/python/test_registry.py | 20 +-- 20 files changed, 270 insertions(+), 92 deletions(-) create mode 100644 test/unit/python/sample_files/physics_types_ddt_mf.F90 create mode 100644 test/unit/python/sample_files/physics_types_ddt_mf.meta diff --git a/src/data/generate_registry_data.py b/src/data/generate_registry_data.py index e5907733d..5ad30eac9 100755 --- a/src/data/generate_registry_data.py +++ b/src/data/generate_registry_data.py @@ -1231,13 +1231,6 @@ class File: CCPPError: Unknown registry File element, 'user' """ - # Some data for sorting dimension names - __dim_order = {'horizontal_dimension' : 1, - 'vertical_layer_dimension' : 2, - 'vertical_interface_dimension' : 3, - 'number_of_ccpp_constituents' : 4} - __min_dim_key = 5 # For sorting unknown dimensions - def __init__(self, file_node, known_types, dycore, logger, gen_code=True, file_path=None): """Initialize a File object from a registry node (XML)""" @@ -1311,17 +1304,7 @@ def write_metadata(self, outdir, logger): self.__var_dict.write_metadata(outfile) # end with - @classmethod - def dim_sort_key(cls, dim_name): - """Return an integer sort key for """ - if dim_name not in File.__dim_order: - key = File.__min_dim_key - File.__min_dim_key += 1 - File.__dim_order[dim_name] = key - # end if - return File.__dim_order[dim_name] - - def write_source(self, outdir, indent, logger, physconst_vars): + def write_source(self, outdir, indent, logger, physconst_vars, var_module_dict): """Write out source code for the variables in this file""" ofilename = os.path.join(outdir, f"{self.name}.F90") logger.info(f"Writing registry source file, {ofilename}") @@ -1378,7 +1361,7 @@ def write_source(self, outdir, indent, logger, physconst_vars): outfile.end_module_header() outfile.write("", 0) # Write data management subroutines - self.write_allocate_routine(outfile, physconst_vars) + self.write_allocate_routine(outfile, physconst_vars, var_module_dict) self.write_tstep_init_routine(outfile, physconst_vars) # end with @@ -1391,20 +1374,39 @@ def tstep_init_routine_name(self): """Return the name of the physics timestep init routine for this module""" return f"{self.name}_tstep_init" - def write_allocate_routine(self, outfile, physconst_vars): + def write_allocate_routine(self, outfile, physconst_vars, var_module_dict): """Write a subroutine to allocate all the data in this module""" subname = self.allocate_routine_name() - args = list(self.__var_dict.known_dimensions) - args.sort(key=File.dim_sort_key) # Attempt at a consistent interface init_var = 'set_init_val' - args.append(f'{init_var}_in') + args = [f'{init_var}_in'] reall_var = 'reallocate' args.append(f'{reall_var}_in') outfile.write(f'subroutine {subname}({", ".join(args)})', 1) + # Use statements nanmods = 'nan => shr_infnan_nan, assignment(=)' outfile.write(f'use shr_infnan_mod, only: {nanmods}', 2) outfile.write('use cam_abortutils, only: endrun', 2) + + #Bring in all host dimension variables + #in via use statments: + outfile.blank_line() + for dim in sorted(self.__var_dict.known_dimensions): + if dim in var_module_dict: + dim_module = var_module_dict[dim][0] + dim_loc_name = var_module_dict[dim][1] + outfile.write(f'use {dim_module}, only: {dim}=>{dim_loc_name}', 2) + + #Bring in "num_advected" as well if needed, as the + #standard name in the cam_constituents.meta file doesn't + #match the standard name that is actually used to represent + #all constituents. Please note that once the CCPP-framework + #supports a separation between total and advected constituents + #then this section of code will likely need to be modified: + if ('number_of_ccpp_constituents' in self.__var_dict.known_dimensions): + outfile.write("use cam_constituents, only: number_of_ccpp_constituents=>num_advected", 2) + outfile.blank_line() + # Dummy arguments outfile.write('!! Dummy arguments', 2) for arg in args: @@ -1540,6 +1542,7 @@ def metadata_file_to_files(file_path, known_types, dycore, run_env): """ known_ddts = known_types.known_ddt_names() mfiles = [] + var_module_dict = {} #Dictionary used to find relevant Fortran modules if os.path.exists(file_path): if run_env.logger: run_env.logger.info(f"Parsing metadata_file, '{file_path}'") @@ -1571,10 +1574,10 @@ def metadata_file_to_files(file_path, known_types, dycore, run_env): raise CCPPError(emsg) # end if for var in mheader.variable_list(loop_vars=False, consts=False): - prop = var.get_prop_value('local_name') - vnode_str = f' shr_infnan_nan, assignment(=) use cam_abortutils, only: endrun + + use physics_grid, only: horizontal_dimension=>columns_on_task + use vert_coord, only: vertical_layer_dimension=>pver + use cam_constituents, only: number_of_ccpp_constituents=>num_advected + !! Dummy arguments - integer, intent(in) :: horizontal_dimension - integer, intent(in) :: vertical_layer_dimension - integer, intent(in) :: number_of_constituents logical, optional, intent(in) :: set_init_val_in logical, optional, intent(in) :: reallocate_in @@ -186,7 +187,7 @@ subroutine allocate_physics_types_complete_fields(horizontal_dimension, end if end if allocate(phys_state%q(horizontal_dimension, vertical_layer_dimension, & - number_of_constituents)) + number_of_ccpp_constituents)) if (set_init_val) then phys_state%q = nan end if diff --git a/test/unit/python/sample_files/physics_types_complete.meta b/test/unit/python/sample_files/physics_types_complete.meta index c617a8003..c945afa9c 100644 --- a/test/unit/python/sample_files/physics_types_complete.meta +++ b/test/unit/python/sample_files/physics_types_complete.meta @@ -63,7 +63,7 @@ standard_name = constituent_mixing_ratio units = kg kg-1 type = real | kind = kind_phys - dimensions = (horizontal_dimension, vertical_layer_dimension, number_of_constituents) + dimensions = (horizontal_dimension, vertical_layer_dimension, number_of_ccpp_constituents) [ q(:,:,index_of_water_vapor_specific_humidity) ] standard_name = water_vapor_specific_humidity units = kg kg-1 diff --git a/test/unit/python/sample_files/physics_types_ddt2.F90 b/test/unit/python/sample_files/physics_types_ddt2.F90 index ac7080a32..2b1c1348b 100644 --- a/test/unit/python/sample_files/physics_types_ddt2.F90 +++ b/test/unit/python/sample_files/physics_types_ddt2.F90 @@ -63,13 +63,12 @@ module physics_types_ddt2 CONTAINS - subroutine allocate_physics_types_ddt2_fields(horizontal_dimension, vertical_layer_dimension, & - set_init_val_in, reallocate_in) + subroutine allocate_physics_types_ddt2_fields(set_init_val_in, reallocate_in) use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) use cam_abortutils, only: endrun + + !! Dummy arguments - integer, intent(in) :: horizontal_dimension - integer, intent(in) :: vertical_layer_dimension logical, optional, intent(in) :: set_init_val_in logical, optional, intent(in) :: reallocate_in diff --git a/test/unit/python/sample_files/physics_types_ddt_array.F90 b/test/unit/python/sample_files/physics_types_ddt_array.F90 index 2de800b70..0792b5263 100644 --- a/test/unit/python/sample_files/physics_types_ddt_array.F90 +++ b/test/unit/python/sample_files/physics_types_ddt_array.F90 @@ -51,14 +51,12 @@ module physics_types_ddt_array CONTAINS - subroutine allocate_physics_types_ddt_array_fields(horizontal_dimension, & - vertical_layer_dimension, number_of_constituents, set_init_val_in, reallocate_in) + subroutine allocate_physics_types_ddt_array_fields(set_init_val_in, reallocate_in) use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) use cam_abortutils, only: endrun + + !! Dummy arguments - integer, intent(in) :: horizontal_dimension - integer, intent(in) :: vertical_layer_dimension - integer, intent(in) :: number_of_constituents logical, optional, intent(in) :: set_init_val_in logical, optional, intent(in) :: reallocate_in diff --git a/test/unit/python/sample_files/physics_types_ddt_eul.F90 b/test/unit/python/sample_files/physics_types_ddt_eul.F90 index 0cd8e191d..9ab680952 100644 --- a/test/unit/python/sample_files/physics_types_ddt_eul.F90 +++ b/test/unit/python/sample_files/physics_types_ddt_eul.F90 @@ -50,13 +50,12 @@ module physics_types_ddt CONTAINS - subroutine allocate_physics_types_ddt_fields(horizontal_dimension, vertical_layer_dimension, & - set_init_val_in, reallocate_in) + subroutine allocate_physics_types_ddt_fields(set_init_val_in, reallocate_in) use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) use cam_abortutils, only: endrun + + !! Dummy arguments - integer, intent(in) :: horizontal_dimension - integer, intent(in) :: vertical_layer_dimension logical, optional, intent(in) :: set_init_val_in logical, optional, intent(in) :: reallocate_in @@ -108,7 +107,7 @@ subroutine allocate_physics_types_ddt_fields(horizontal_dimension, vertical_laye call endrun(subname//": cappav is already allocated, cannot allocate") end if end if - allocate(cappav(horizontal_dimension, vertical_layer_dimension)) + allocate(cappav(horizontal_dimension, reference_pressure)) if (set_init_val) then cappav = rair/cpair call & diff --git a/test/unit/python/sample_files/physics_types_ddt_eul.meta b/test/unit/python/sample_files/physics_types_ddt_eul.meta index 5b3b38dc1..8e6d6130f 100644 --- a/test/unit/python/sample_files/physics_types_ddt_eul.meta +++ b/test/unit/python/sample_files/physics_types_ddt_eul.meta @@ -34,7 +34,7 @@ long_name = Composition-dependent ratio of dry air gas constant to specific heat at constant pressure units = 1 type = real | kind = kind_phys - dimensions = (horizontal_dimension, vertical_layer_dimension) + dimensions = (horizontal_dimension, reference_pressure) [ phys_state ] standard_name = physics_state_due_to_dynamics long_name = Physics state variables updated by dynamical core diff --git a/test/unit/python/sample_files/physics_types_ddt_fv.F90 b/test/unit/python/sample_files/physics_types_ddt_fv.F90 index e3d4afe3b..dc63817bf 100644 --- a/test/unit/python/sample_files/physics_types_ddt_fv.F90 +++ b/test/unit/python/sample_files/physics_types_ddt_fv.F90 @@ -50,13 +50,12 @@ module physics_types_ddt CONTAINS - subroutine allocate_physics_types_ddt_fields(horizontal_dimension, vertical_layer_dimension, & - set_init_val_in, reallocate_in) + subroutine allocate_physics_types_ddt_fields(set_init_val_in, reallocate_in) use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) use cam_abortutils, only: endrun + + !! Dummy arguments - integer, intent(in) :: horizontal_dimension - integer, intent(in) :: vertical_layer_dimension logical, optional, intent(in) :: set_init_val_in logical, optional, intent(in) :: reallocate_in @@ -96,7 +95,7 @@ subroutine allocate_physics_types_ddt_fields(horizontal_dimension, vertical_laye call endrun(subname//": cappav is already allocated, cannot allocate") end if end if - allocate(cappav(horizontal_dimension, vertical_layer_dimension)) + allocate(cappav(horizontal_dimension, reference_pressure)) if (set_init_val) then cappav = rair/cpair call & diff --git a/test/unit/python/sample_files/physics_types_ddt_fv.meta b/test/unit/python/sample_files/physics_types_ddt_fv.meta index 94705ce0f..b7be3aba4 100644 --- a/test/unit/python/sample_files/physics_types_ddt_fv.meta +++ b/test/unit/python/sample_files/physics_types_ddt_fv.meta @@ -34,7 +34,7 @@ long_name = Composition-dependent ratio of dry air gas constant to specific heat at constant pressure units = 1 type = real | kind = kind_phys - dimensions = (horizontal_dimension, vertical_layer_dimension) + dimensions = (horizontal_dimension, reference_pressure) [ phys_state ] standard_name = physics_state_due_to_dynamics long_name = Physics state variables updated by dynamical core diff --git a/test/unit/python/sample_files/physics_types_ddt_mf.F90 b/test/unit/python/sample_files/physics_types_ddt_mf.F90 new file mode 100644 index 000000000..b61184592 --- /dev/null +++ b/test/unit/python/sample_files/physics_types_ddt_mf.F90 @@ -0,0 +1,130 @@ +! +! This work (Common Community Physics Package Framework), identified by +! NOAA, NCAR, CU/CIRES, is free of known copyright restrictions and is +! placed in the public domain. +! +! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +! THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +! IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +! CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +!> +!! @brief Auto-generated Variables for registry source file, physics_types_ddt_mf +!! +! +module physics_types_ddt_mf + + use ccpp_kinds, only: kind_phys + use physconst, only: cpair + use physconst, only: rair + + + implicit none + private + +!> \section arg_table_physics_state Argument Table +!! \htmlinclude physics_state.html + type, public :: physics_state + ! ncol: Number of horizontal columns + integer :: ncol = 0 + ! latitude: Latitude + real(kind_phys), pointer :: latitude(:) => NULL() + end type physics_state + +!> \section arg_table_physics_types_ddt_mf Argument Table +!! \htmlinclude physics_types_ddt_mf.html + ! longitude: Longitude + real(kind_phys), public, pointer, protected :: longitude(:) => NULL() + ! cappav: Composition-dependent ratio of dry air gas constant to specific heat at constant + ! pressure + real(kind_phys), public, allocatable :: cappav(:, :) + ! phys_state: Physics state variables updated by dynamical core + type(physics_state), public :: phys_state + +!! public interfaces + public :: allocate_physics_types_ddt_mf_fields + public :: physics_types_ddt_mf_tstep_init + +CONTAINS + + subroutine allocate_physics_types_ddt_mf_fields(set_init_val_in, reallocate_in) + use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) + use cam_abortutils, only: endrun + + use ref_pres, only: reference_pressure=>pref_mid + + !! Dummy arguments + logical, optional, intent(in) :: set_init_val_in + logical, optional, intent(in) :: reallocate_in + + !! Local variables + logical :: set_init_val + logical :: reallocate + character(len=*), parameter :: subname = "allocate_physics_types_ddt_mf_fields" + + ! Set optional argument values + if (present(set_init_val_in)) then + set_init_val = set_init_val_in + else + set_init_val = .true. + end if + if (present(reallocate_in)) then + reallocate = reallocate_in + else + reallocate = .false. + end if + + if (associated(longitude)) then + if (reallocate) then + deallocate(longitude) + nullify(longitude) + else + call endrun(subname//": longitude is already associated, cannot allocate") + end if + end if + allocate(longitude(horizontal_dimension)) + if (set_init_val) then + longitude = nan + end if + if (allocated(cappav)) then + if (reallocate) then + deallocate(cappav) + else + call endrun(subname//": cappav is already allocated, cannot allocate") + end if + end if + allocate(cappav(horizontal_dimension, reference_pressure)) + if (set_init_val) then + cappav = rair/cpair + call & + mark_as_initialized('composition_dependent_ratio_of_dry_air_gas_constant_to_specific_heat_at_constant_pressure') + + end if + if (set_init_val) then + phys_state%ncol = 0 + end if + if (associated(phys_state%latitude)) then + if (reallocate) then + deallocate(phys_state%latitude) + nullify(phys_state%latitude) + else + call endrun(subname//": phys_state%latitude is already associated, cannot allocate") + end if + end if + allocate(phys_state%latitude(horizontal_dimension)) + if (set_init_val) then + phys_state%latitude = nan + end if + end subroutine allocate_physics_types_ddt_mf_fields + + subroutine physics_types_ddt_mf_tstep_init() + + !! Local variables + character(len=*), parameter :: subname = "physics_types_ddt_mf_tstep_init" + + end subroutine physics_types_ddt_mf_tstep_init + +end module physics_types_ddt_mf diff --git a/test/unit/python/sample_files/physics_types_ddt_mf.meta b/test/unit/python/sample_files/physics_types_ddt_mf.meta new file mode 100644 index 000000000..63bde7df2 --- /dev/null +++ b/test/unit/python/sample_files/physics_types_ddt_mf.meta @@ -0,0 +1,43 @@ +[ccpp-table-properties] + name = physics_state + type = ddt +[ccpp-arg-table] + name = physics_state + type = ddt +[ ncol ] + standard_name = horizontal_dimension + long_name = Number of horizontal columns + units = count + type = integer + dimensions = () + protected = True +[ latitude ] + standard_name = latitude + units = radians + type = real | kind = kind_phys + dimensions = (horizontal_dimension) + protected = True +[ccpp-table-properties] + name = physics_types_ddt_mf + type = module +[ccpp-arg-table] + name = physics_types_ddt_mf + type = module +[ longitude ] + standard_name = longitude + units = radians + type = real | kind = kind_phys + dimensions = (horizontal_dimension) + protected = True +[ cappav ] + standard_name = composition_dependent_ratio_of_dry_air_gas_constant_to_specific_heat_at_constant_pressure + long_name = Composition-dependent ratio of dry air gas constant to specific heat at constant pressure + units = 1 + type = real | kind = kind_phys + dimensions = (horizontal_dimension, reference_pressure) +[ phys_state ] + standard_name = physics_state_due_to_dynamics + long_name = Physics state variables updated by dynamical core + units = None + type = physics_state + dimensions = () diff --git a/test/unit/python/sample_files/physics_types_ddt_se.F90 b/test/unit/python/sample_files/physics_types_ddt_se.F90 index 3019e2d71..fe0641871 100644 --- a/test/unit/python/sample_files/physics_types_ddt_se.F90 +++ b/test/unit/python/sample_files/physics_types_ddt_se.F90 @@ -50,13 +50,12 @@ module physics_types_ddt CONTAINS - subroutine allocate_physics_types_ddt_fields(horizontal_dimension, vertical_layer_dimension, & - set_init_val_in, reallocate_in) + subroutine allocate_physics_types_ddt_fields(set_init_val_in, reallocate_in) use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) use cam_abortutils, only: endrun + + !! Dummy arguments - integer, intent(in) :: horizontal_dimension - integer, intent(in) :: vertical_layer_dimension logical, optional, intent(in) :: set_init_val_in logical, optional, intent(in) :: reallocate_in @@ -96,7 +95,7 @@ subroutine allocate_physics_types_ddt_fields(horizontal_dimension, vertical_laye call endrun(subname//": cappav is already allocated, cannot allocate") end if end if - allocate(cappav(horizontal_dimension, vertical_layer_dimension)) + allocate(cappav(horizontal_dimension, reference_pressure)) if (set_init_val) then cappav = rair/cpair call & diff --git a/test/unit/python/sample_files/physics_types_ddt_se.meta b/test/unit/python/sample_files/physics_types_ddt_se.meta index 019433817..987c938d0 100644 --- a/test/unit/python/sample_files/physics_types_ddt_se.meta +++ b/test/unit/python/sample_files/physics_types_ddt_se.meta @@ -34,7 +34,7 @@ long_name = Composition-dependent ratio of dry air gas constant to specific heat at constant pressure units = 1 type = real | kind = kind_phys - dimensions = (horizontal_dimension, vertical_layer_dimension) + dimensions = (horizontal_dimension, reference_pressure) [ phys_state ] standard_name = physics_state_due_to_dynamics long_name = Physics state variables updated by dynamical core diff --git a/test/unit/python/sample_files/physics_types_parameter.F90 b/test/unit/python/sample_files/physics_types_parameter.F90 index bac3e7b51..6c2706018 100644 --- a/test/unit/python/sample_files/physics_types_parameter.F90 +++ b/test/unit/python/sample_files/physics_types_parameter.F90 @@ -40,12 +40,12 @@ module physics_types_parameter CONTAINS - subroutine allocate_physics_types_parameter_fields(horizontal_dimension, set_init_val_in, & - reallocate_in) + subroutine allocate_physics_types_parameter_fields(set_init_val_in, reallocate_in) use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) use cam_abortutils, only: endrun + + !! Dummy arguments - integer, intent(in) :: horizontal_dimension logical, optional, intent(in) :: set_init_val_in logical, optional, intent(in) :: reallocate_in diff --git a/test/unit/python/sample_files/physics_types_simple.F90 b/test/unit/python/sample_files/physics_types_simple.F90 index 20c642c90..6df217ed7 100644 --- a/test/unit/python/sample_files/physics_types_simple.F90 +++ b/test/unit/python/sample_files/physics_types_simple.F90 @@ -38,12 +38,12 @@ module physics_types_simple CONTAINS - subroutine allocate_physics_types_simple_fields(horizontal_dimension, set_init_val_in, & - reallocate_in) + subroutine allocate_physics_types_simple_fields(set_init_val_in, reallocate_in) use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) use cam_abortutils, only: endrun + + !! Dummy arguments - integer, intent(in) :: horizontal_dimension logical, optional, intent(in) :: set_init_val_in logical, optional, intent(in) :: reallocate_in diff --git a/test/unit/python/sample_files/reg_good_complete.xml b/test/unit/python/sample_files/reg_good_complete.xml index ff7488237..0497fda94 100644 --- a/test/unit/python/sample_files/reg_good_complete.xml +++ b/test/unit/python/sample_files/reg_good_complete.xml @@ -74,15 +74,15 @@ type="real" kind="kind_phys" allocatable="pointer"> horizontal_dimension vertical_layer_dimension - number_of_constituents + number_of_ccpp_constituents + index_pos="number_of_ccpp_constituents"> Q Q_snapshot + index_pos="number_of_ccpp_constituents"> CLDLIQ CLDLIQ_snapshot @@ -109,4 +109,6 @@ $SRCROOT/test/unit/python/sample_files/ref_pres.meta + $SRCROOT/src/physics/utils/physics_grid.meta + $SRCROOT/src/dynamics/utils/vert_coord.meta diff --git a/test/unit/python/sample_files/reg_good_ddt.xml b/test/unit/python/sample_files/reg_good_ddt.xml index 10d85be6b..23a02dc4e 100644 --- a/test/unit/python/sample_files/reg_good_ddt.xml +++ b/test/unit/python/sample_files/reg_good_ddt.xml @@ -27,7 +27,7 @@ units="1" type="real" kind="kind_phys" allocatable="allocatable"> Composition-dependent ratio of dry air gas constant to specific heat at constant pressure - horizontal_dimension vertical_layer_dimension + horizontal_dimension reference_pressure rair/cpair diff --git a/test/unit/python/sample_files/reg_good_mf.xml b/test/unit/python/sample_files/reg_good_mf.xml index 2dfba333d..1d12094ea 100644 --- a/test/unit/python/sample_files/reg_good_mf.xml +++ b/test/unit/python/sample_files/reg_good_mf.xml @@ -1,7 +1,7 @@ - + @@ -27,7 +27,7 @@ units="1" type="real" kind="kind_phys" allocatable="allocatable"> Composition-dependent ratio of dry air gas constant to specific heat at constant pressure - horizontal_dimension vertical_layer_dimension + horizontal_dimension reference_pressure rair/cpair diff --git a/test/unit/python/test_registry.py b/test/unit/python/test_registry.py index 9acbd9afd..99bb6b3e5 100644 --- a/test/unit/python/test_registry.py +++ b/test/unit/python/test_registry.py @@ -276,9 +276,9 @@ def test_good_metadata_file_registry(self): for the SE dycore""" # Setup test filename = os.path.join(_SAMPLE_FILES_DIR, "reg_good_mf.xml") - out_name = "physics_types_ddt" - in_source = os.path.join(_SAMPLE_FILES_DIR, out_name + '_se.F90') - in_meta = os.path.join(_SAMPLE_FILES_DIR, out_name + '_se.meta') + out_name = "physics_types_ddt_mf" + in_source = os.path.join(_SAMPLE_FILES_DIR, out_name + '.F90') + in_meta = os.path.join(_SAMPLE_FILES_DIR, out_name + '.meta') out_source = os.path.join(_TMP_DIR, out_name + '.F90') out_meta = os.path.join(_TMP_DIR, out_name + '.meta') remove_files([out_source, out_meta]) @@ -319,9 +319,9 @@ def test_diff_src_root_metadata_file_registry(self): """ # Setup test filename = os.path.join(_SAMPLE_FILES_DIR, "reg_good_mf.xml") - out_name = "physics_types_ddt" - in_source = os.path.join(_SAMPLE_FILES_DIR, out_name + '_se.F90') - in_meta = os.path.join(_SAMPLE_FILES_DIR, out_name + '_se.meta') + out_name = "physics_types_ddt_mf" + in_source = os.path.join(_SAMPLE_FILES_DIR, out_name + '.F90') + in_meta = os.path.join(_SAMPLE_FILES_DIR, out_name + '.meta') out_source = os.path.join(_TMP_DIR, out_name + '.F90') out_meta = os.path.join(_TMP_DIR, out_name + '.meta') remove_files([out_source, out_meta]) @@ -373,9 +373,9 @@ def test_SourceMods_metadata_file_registry(self): """ # Setup test filename = os.path.join(_SAMPLE_FILES_DIR, "reg_good_mf.xml") - out_name = "physics_types_ddt" - in_source = os.path.join(_SAMPLE_FILES_DIR, out_name + '_se.F90') - in_meta = os.path.join(_SAMPLE_FILES_DIR, out_name + '_se.meta') + out_name = "physics_types_ddt_mf" + in_source = os.path.join(_SAMPLE_FILES_DIR, out_name + '.F90') + in_meta = os.path.join(_SAMPLE_FILES_DIR, out_name + '.meta') out_source = os.path.join(_TMP_DIR, out_name + '.F90') out_meta = os.path.join(_TMP_DIR, out_name + '.meta') remove_files([out_source, out_meta]) @@ -455,7 +455,7 @@ def test_good_complete_registry(self): self.assertEqual(retcode, 0, msg=amsg) flen = len(files) amsg = f"Test failure: Found {flen} files, expected 2" - self.assertEqual(flen, 2, msg=amsg) + self.assertEqual(flen, 4, msg=amsg) # Make sure each output file was created amsg = f"{out_meta} does not exist" From 39759ca28ca0724ef634071dc5c0d4b322d04a94 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 10 Jul 2025 14:26:25 -0600 Subject: [PATCH 13/22] Update atmospheric_physics external --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 2e09f9e86..50fca8b25 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,7 +20,7 @@ [submodule "ncar-physics"] path = src/physics/ncar_ccpp url = https://github.com/ESCOMP/atmospheric_physics - fxtag = 2b66267fe263d9268effeaa1d47e3c03e6121d74 + fxtag = 754a0c2 fxrequired = AlwaysRequired fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics [submodule "rrtmgp-data"] From 11390476eebfeb1526e967b3ad314308bc15e145 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 10 Jul 2025 14:40:05 -0600 Subject: [PATCH 14/22] Update atmospheric_physics for git-fleximod --- src/physics/ncar_ccpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics/ncar_ccpp b/src/physics/ncar_ccpp index 2b66267fe..754a0c286 160000 --- a/src/physics/ncar_ccpp +++ b/src/physics/ncar_ccpp @@ -1 +1 @@ -Subproject commit 2b66267fe263d9268effeaa1d47e3c03e6121d74 +Subproject commit 754a0c28631655289765e99f747c1d96a6d882f4 From 79bbc45f3b66573e293244541abd971ed2b4ba05 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 24 Jul 2025 11:51:44 -0600 Subject: [PATCH 15/22] Remove values which are no longer needed when these changes are committed --- src/physics/utils/musica_ccpp_dependencies.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/physics/utils/musica_ccpp_dependencies.F90 b/src/physics/utils/musica_ccpp_dependencies.F90 index 7a10bfc46..8e0371857 100644 --- a/src/physics/utils/musica_ccpp_dependencies.F90 +++ b/src/physics/utils/musica_ccpp_dependencies.F90 @@ -253,8 +253,6 @@ subroutine musica_ccpp_dependencies_init( & 'extraterrestrial_radiation_flux(photolysis_wavelength_grid_section_dimension)', & file=__FILE__, line=__LINE__) - cam_in%asdir(:) = 0.1_kind_phys - cam_in%ts(:) = 292.3_kind_phys extraterrestrial_radiation_flux(:) = 1.0e14_kind_phys photolysis_wavelength_grid_interfaces = (/ & 120.0e-9_kind_phys, & From c7b9abb872c0277fdd23bda244da942310f8ef43 Mon Sep 17 00:00:00 2001 From: cacraigucar Date: Thu, 24 Jul 2025 11:53:09 -0600 Subject: [PATCH 16/22] Update .gitmodules Co-authored-by: Haipeng Lin --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 50fca8b25..07463213c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,7 +20,7 @@ [submodule "ncar-physics"] path = src/physics/ncar_ccpp url = https://github.com/ESCOMP/atmospheric_physics - fxtag = 754a0c2 + fxtag = 754a0c28631655289765e99f747c1d96a6d882f4 fxrequired = AlwaysRequired fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics [submodule "rrtmgp-data"] From 5ce540ae86338a4505f08037268b6d3cd6f60514 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 24 Jul 2025 15:52:16 -0600 Subject: [PATCH 17/22] Address some of the review comments --- src/cpl/nuopc/atm_import_export.F90 | 7 ++- src/data/generate_registry_data.py | 2 +- src/data/registry.xml | 55 ++++++++++--------- .../utils/musica_ccpp_dependencies.F90 | 2 + 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/cpl/nuopc/atm_import_export.F90 b/src/cpl/nuopc/atm_import_export.F90 index 24da69356..8ad9edb90 100644 --- a/src/cpl/nuopc/atm_import_export.F90 +++ b/src/cpl/nuopc/atm_import_export.F90 @@ -596,7 +596,7 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) cam_in%landfrac(i) = fldptr_lfrac(i) end do -! Commented out until dimesions are figured out +! Commented out until dimensions and usage are figured out #if 0 ! Optional fields @@ -678,8 +678,8 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) #endif #if 0 -# Ignoring depvel for now as it has a problematic dimension and it was determined that it probably -# will not be used in CAM-SIMA for some time +! Ignoring depvel for now as it has a problematic second dimension (number of dry deposited species) +! and it was determined that it probably will not be used in CAM-SIMA for some time ! dry dep velocities call state_getfldptr(importState, 'Sl_ddvel', fldptr2d=fldptr2d, exists=exists, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -693,6 +693,7 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc) #endif #if 0 +! Commented out until water isotopes or carbon ccle fluxe are implemented in CAM-SIMA ! fields needed to calculate water isotopes to ocean evaporation processes call state_getfldptr(importState, 'So_ustar', fldptr=fldptr1d, exists=exists, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return diff --git a/src/data/generate_registry_data.py b/src/data/generate_registry_data.py index 5ad30eac9..3c09ce40d 100755 --- a/src/data/generate_registry_data.py +++ b/src/data/generate_registry_data.py @@ -1608,7 +1608,7 @@ def metadata_file_to_files(file_path, known_types, dycore, run_env): mfile.add_variable(var_node, run_env.logger) # Add variable to module dictionary in case it # is needed during code generation: - if local_name not in var_module_dict.keys(): + if std_name not in var_module_dict.keys(): var_module_dict[std_name] = [mtable.module_name, local_name] # end for if htype == 'ddt': diff --git a/src/data/registry.xml b/src/data/registry.xml index 5e38ac596..c491bf80a 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -754,7 +754,7 @@ units="fraction" type="real" kind="kind_phys" allocatable="allocatable"> horizontal_dimension - 0.0_kind_phys + 1.0_kind_phys ocnfrac cam_in_ocnfrac END COMMENT --> - - + 1.275_kind_phys rho cam_out_rho horizontal_dimension @@ -1170,7 +1171,7 @@ soll cam_out_soll horizontal_dimension @@ -1178,7 +1179,7 @@ solld cam_out_solld horizontal_dimension @@ -1186,7 +1187,7 @@ sols cam_out_sols horizontal_dimension @@ -1198,7 +1199,7 @@ units="K" type="real" kind="kind_phys" allocatable="allocatable"> horizontal_dimension - 0.0_kind_phys + 273.15_kind_phys thbot cam_out_thbot horizontal_dimension - 0.0_kind_phys + 273.15_kind_phys tbot cam_out_tbot @@ -1308,7 +1309,7 @@ dry_deposition_flux_of_hydrophilic_organic_carbon_at_surface_to_coupler wet_deposition_flux_of_hydrophilic_organic_carbon_at_surface_to_coupler dry_deposition_flux_of_hydrophobic_organic_carbon_at_surface_to_coupler - volume_mixing_ratio_of_ozone_at_bottom_layer_to_coupler + volume_mixing_ratio_of_ozone_wrt_dry_air_at_bottom_layer_to_coupler air_pressure_at_bottom_layer_to_coupler lwe_convective_precipitation_rate_at_surface_to_coupler lwe_large_scale_precipitation_rate_at_surface_to_coupler @@ -1316,11 +1317,11 @@ lwe_large_scale_snowfall_rate_at_surface_to_coupler air_pressure_at_sea_level_to_coupler constituent_mixing_ratio_at_bottom_layer_to_coupler - air_density_to_coupler - direct_solar_rad_at_surface_ge_700nm_to_coupler - diffuse_solar_rad_at_surface_ge_700nm_to_coupler - direct_solar_rad_at_surface_lt_700nm_to_coupler - diffuse_solar_rad_at_surface_lt_700nm_to_coupler + dry_air_density_at_bottom_layer_to_coupler + direct_solar_radiative_flux_at_surface_ge_700nm_to_coupler + diffuse_solar_radiative_flux_at_surface_ge_700nm_to_coupler + direct_solar_radiative_flux_at_surface_lt_700nm_to_coupler + diffuse_solar_radiative_flux_at_surface_lt_700nm_to_coupler potential_temperature_wrt_surface_pressure_at_bottom_layer_to_coupler air_temperature_at_bottom_layer_to_coupler surface_topographic_height_to_coupler @@ -1330,7 +1331,7 @@ @@ -1351,7 +1352,7 @@ units="K" type="real" kind="kind_phys" allocatable="allocatable"> horizontal_dimension - 0.0_kind_phys + 273.15_kind_phys tpert pbuf_tpert diff --git a/src/physics/utils/musica_ccpp_dependencies.F90 b/src/physics/utils/musica_ccpp_dependencies.F90 index 8e0371857..7a10bfc46 100644 --- a/src/physics/utils/musica_ccpp_dependencies.F90 +++ b/src/physics/utils/musica_ccpp_dependencies.F90 @@ -253,6 +253,8 @@ subroutine musica_ccpp_dependencies_init( & 'extraterrestrial_radiation_flux(photolysis_wavelength_grid_section_dimension)', & file=__FILE__, line=__LINE__) + cam_in%asdir(:) = 0.1_kind_phys + cam_in%ts(:) = 292.3_kind_phys extraterrestrial_radiation_flux(:) = 1.0e14_kind_phys photolysis_wavelength_grid_interfaces = (/ & 120.0e-9_kind_phys, & From 8693f11017b274a7eaab785d5c97cd6cfad8a6c0 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 24 Jul 2025 16:43:19 -0600 Subject: [PATCH 18/22] fix metadata file which was accidentally reverted --- src/physics/utils/musica_ccpp_dependencies.meta | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/physics/utils/musica_ccpp_dependencies.meta b/src/physics/utils/musica_ccpp_dependencies.meta index bc79f0343..c7ceb258f 100644 --- a/src/physics/utils/musica_ccpp_dependencies.meta +++ b/src/physics/utils/musica_ccpp_dependencies.meta @@ -28,3 +28,15 @@ type = real | kind = kind_phys dimensions = (photolysis_wavelength_grid_section_dimension) protected = True +[ surface_albedo ] + standard_name = surface_albedo_due_to_UV_and_VIS_direct + units = fraction + type = real | kind = kind_phys + dimensions = (horizontal_dimension) + protected = True +[ blackbody_temperature_at_surface ] + standard_name = blackbody_temperature_at_surface + type = real | kind = kind_phys + units = K + dimensions = (horizontal_dimension) + protected = True From ddb5d8d1edef90f793e4387275f096e947396f1f Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 25 Jul 2025 11:40:33 -0600 Subject: [PATCH 19/22] Removed ccpp_constant_four which crept into a number of variables by erroneously --- src/data/registry.xml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index 91ed7ee43..f9f61d3b3 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -632,16 +632,14 @@ - - END COMMENT --> - u10 cam_in_u10 - - - Date: Mon, 28 Jul 2025 10:35:50 -0600 Subject: [PATCH 20/22] Removed comments on a number of commented out variables into the registry --- src/data/registry.xml | 48 ++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index f9f61d3b3..0371676a0 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -641,7 +641,6 @@ dstflx cam_in_dstflx - - - - cam_in_qref - snowhland cam_in_snowhland - horizontal_dimension @@ -1239,13 +1227,13 @@ surface_albedo_due_to_uv_and_vis_diffuse_from_coupler surface_albedo_due_to_uv_and_vis_direct_from_coupler surface_upward_ccpp_constituent_fluxes_from_coupler - - - - + surface_upward_dust_fluxes_from_coupler + co2_flux_from_land_from_coupler + co2_flux_from_ocean_from_coupler + dms_flux_from_coupler top_height_for_vertically_distributed_fire_emissions_from_coupler - + surface_friction_velocity_over_land_from_coupler sea_ice_area_fraction_from_coupler land_area_fraction_from_coupler surface_upward_latent_heat_flux_from_coupler @@ -1253,20 +1241,20 @@ ocean_area_fraction_from_coupler water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_at_2m_from_coupler - - + aerodynamical_resistance_at_surface_from_coupler + re_tbd surface_upward_sensible_heat_flux_from_coupler lwe_surface_snow_depth_over_ice_from_coupler lwe_surface_snow_depth_over_land_from_coupler - - + volumetric_equilibrium_soil_moisture_from_coupler + sea_surface_saturation_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_from_coupler sea_surface_temperature_from_coupler air_temperature_at_2m_from_coupler blackbody_temperature_at_surface_from_coupler wind_speed_at_10m_from_coupler - - - + wind_speed_plus_parameterized_wind_gusts_at_10m_from_coupler + surface_friction_velocity_over_ocean_from_coupler + parameterized_wind_gust_at_10m_from_coupler surface_eastward_wind_stress_from_coupler surface_northward_wind_stress_from_coupler From f410257d0ceb8e6f56aa5e26bf1902b1b328bb42 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 28 Jul 2025 11:36:28 -0600 Subject: [PATCH 21/22] Remove some unused code --- src/control/camsrfexch.meta | 13 ------------- src/data/physconst.F90 | 2 -- src/data/physconst.meta | 6 ------ 3 files changed, 21 deletions(-) delete mode 100644 src/control/camsrfexch.meta diff --git a/src/control/camsrfexch.meta b/src/control/camsrfexch.meta deleted file mode 100644 index 1630479a1..000000000 --- a/src/control/camsrfexch.meta +++ /dev/null @@ -1,13 +0,0 @@ -[ccpp-table-properties] - name = cam_out_t - type = ddt -[ccpp-arg-table] - name = cam_out_t - type = ddt - -[ccpp-table-properties] - name = cam_in_t - type = ddt -[ccpp-arg-table] - name = cam_in_t - type = ddt diff --git a/src/data/physconst.F90 b/src/data/physconst.F90 index f4190414f..8a5283426 100644 --- a/src/data/physconst.F90 +++ b/src/data/physconst.F90 @@ -88,8 +88,6 @@ module physconst real(kind_phys), public, protected :: rearth = real(shr_const_rearth, kind_phys) ! radius of earth (m) real(kind_phys), public, protected :: tmelt = real(shr_const_tkfrz, kind_phys) ! Freezing point of water (K) - integer, public, protected :: ccpp_constant_four = 4 ! constant four - !----- Variables below here are derived from those above ----------------- real(kind_phys), public, protected :: rga = 1._kind_phys/real(shr_const_g, kind_phys) ! reciprocal of gravit (s2 m-1) diff --git a/src/data/physconst.meta b/src/data/physconst.meta index 181c753e8..aafe0880b 100644 --- a/src/data/physconst.meta +++ b/src/data/physconst.meta @@ -236,12 +236,6 @@ type = real | kind = kind_phys dimensions = () protected = True -[ ccpp_constant_four ] - standard_name = ccpp_constant_four - units = none - type = integer - dimensions = () - protected = True [ rga ] standard_name = reciprocal_of_gravitational_acceleration units = s2 m-1 From 7eba557e6d58d8aac50a9401a64fca0afb9ccf41 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 28 Jul 2025 11:55:41 -0600 Subject: [PATCH 22/22] Minor comment change --- src/data/generate_registry_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/generate_registry_data.py b/src/data/generate_registry_data.py index 3c09ce40d..0d0e93b3d 100755 --- a/src/data/generate_registry_data.py +++ b/src/data/generate_registry_data.py @@ -1388,7 +1388,7 @@ def write_allocate_routine(self, outfile, physconst_vars, var_module_dict): outfile.write(f'use shr_infnan_mod, only: {nanmods}', 2) outfile.write('use cam_abortutils, only: endrun', 2) - #Bring in all host dimension variables + #Bring all host dimension variables #in via use statments: outfile.blank_line() for dim in sorted(self.__var_dict.known_dimensions):