From bba7da5dcbb12f5de3e154cf2dfc318bdcd4fbf9 Mon Sep 17 00:00:00 2001 From: "Samuel Trahan (NOAA contractor)" <39415369+SamuelTrahanNOAA@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:12:10 -0400 Subject: [PATCH] Quartet of bug fixes for: c3 scheme, quilting restart with 32-bit physics, and string length mismatch in dycore plus PR #705 and #699 (#695) * GFDL_atmos_cubed_sphere: consistent string lengths in array * stop FV3_HRRR_c3 from crashing with gnu debug * in dycore, initialize srf_wnd_var2 and tracers_var3 arrays * Write netcdf axis variables using the same real kind as data variables * "GF radar reflectivity, dust bug fix, C3 updates, more fluxes output" * Fix race condition in GFS_phys_time_vary.fv3.F90 error detection * More bug fixes to GFS_phys_time_vary.fv3.F90: 1. detect empty errmsg from subroutines 2. Initialize err variables in set_soilveg.f, which is called from GFS_phys_time_vary.fv3.F90 * initialize errmsg & errflg in noahmp_tables.f90 * only read h2odata, ozdata and noahmp table when they are needed * remove all constant 3D variables from clm lake * calculate clm lake constants only once per i loop --------- Co-authored-by: Dusan Jovic Co-authored-by: Haiqin.Li --- atmos_cubed_sphere | 2 +- ccpp/data/GFS_typedefs.F90 | 43 ++++----- ccpp/data/GFS_typedefs.meta | 93 ++++++------------ ccpp/driver/GFS_diagnostics.F90 | 80 +++++++++------- ccpp/physics | 2 +- ccpp/suites/suite_FV3_GFS_v17_p8_c3.xml | 2 + io/fv3atm_clm_lake_io.F90 | 119 +++--------------------- io/module_wrt_grid_comp.F90 | 8 +- 8 files changed, 109 insertions(+), 240 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 9616e4e38..caba092f6 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 9616e4e383ed716838fa543d6e98d792e9b861ca +Subproject commit caba092f682c9713a485e782b8f9ba6480adaca2 diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 171591a53..580101d68 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -431,13 +431,7 @@ module GFS_typedefs ! CLM Lake model internal variables: real (kind=kind_phys), pointer :: lake_albedo(:) => null() ! - real (kind=kind_phys), pointer :: lake_z3d(:,:) => null() ! - real (kind=kind_phys), pointer :: lake_dz3d(:,:) => null() ! - real (kind=kind_phys), pointer :: lake_soil_watsat3d(:,:) => null() ! - real (kind=kind_phys), pointer :: lake_csol3d(:,:) => null() ! - real (kind=kind_phys), pointer :: lake_soil_tkmg3d(:,:) => null() ! - real (kind=kind_phys), pointer :: lake_soil_tkdry3d(:,:) => null() ! - real (kind=kind_phys), pointer :: lake_soil_tksatu3d(:,:) => null() ! + real (kind=kind_phys), pointer :: input_lakedepth(:) => null() ! real (kind=kind_phys), pointer :: lake_h2osno2d(:) => null() ! real (kind=kind_phys), pointer :: lake_sndpth2d(:) => null() ! real (kind=kind_phys), pointer :: lake_snl2d(:) => null() ! @@ -454,8 +448,6 @@ module GFS_typedefs real (kind=kind_phys), pointer :: lake_icefrac3d(:,:)=> null() real (kind=kind_phys), pointer :: lake_rho0(:)=> null() real (kind=kind_phys), pointer :: lake_ht(:)=> null() - real (kind=kind_phys), pointer :: lake_clay3d(:,:) => null() - real (kind=kind_phys), pointer :: lake_sand3d(:,:) => null() integer, pointer :: lake_is_salty(:) => null() integer, pointer :: lake_cannot_freeze(:) => null() real (kind=kind_phys), pointer :: clm_lake_initialized(:) => null() !< lakeini was called @@ -1501,6 +1493,9 @@ module GFS_typedefs integer :: ncnvwind !< the index of surface wind enhancement due to convection for MYNN SFC and RAS CNV in phy f2d !-- nml variables for RRFS-SD + real(kind=kind_phys) :: dust_drylimit_factor !< factor for drylimit parameterization in fengsha + real(kind=kind_phys) :: dust_moist_correction !< factor to tune volumetric soil moisture + integer :: dust_moist_opt !< dust moisture option 1:fecan 2:shao real(kind=kind_phys) :: dust_alpha !< alpha parameter for fengsha dust scheme real(kind=kind_phys) :: dust_gamma !< gamma parameter for fengsha dust scheme real(kind=kind_phys) :: wetdep_ls_alpha !< alpha parameter for wet deposition @@ -2715,13 +2710,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model) allocate(Sfcprop%lake_t2m(IM)) allocate(Sfcprop%lake_q2m(IM)) allocate(Sfcprop%lake_albedo(IM)) - allocate(Sfcprop%lake_z3d(IM,Model%nlevlake_clm_lake)) - allocate(Sfcprop%lake_dz3d(IM,Model%nlevlake_clm_lake)) - allocate(Sfcprop%lake_soil_watsat3d(IM,Model%nlevlake_clm_lake)) - allocate(Sfcprop%lake_csol3d(IM,Model%nlevlake_clm_lake)) - allocate(Sfcprop%lake_soil_tkmg3d(IM,Model%nlevlake_clm_lake)) - allocate(Sfcprop%lake_soil_tkdry3d(IM,Model%nlevlake_clm_lake)) - allocate(Sfcprop%lake_soil_tksatu3d(IM,Model%nlevlake_clm_lake)) + allocate(Sfcprop%input_lakedepth(IM)) allocate(Sfcprop%lake_h2osno2d(IM)) allocate(Sfcprop%lake_sndpth2d(IM)) allocate(Sfcprop%lake_snl2d(IM)) @@ -2738,8 +2727,6 @@ subroutine sfcprop_create (Sfcprop, IM, Model) allocate(Sfcprop%lake_icefrac3d(IM,Model%nlevlake_clm_lake)) allocate(Sfcprop%lake_rho0(IM)) allocate(Sfcprop%lake_ht(IM)) - allocate(Sfcprop%lake_clay3d(IM,Model%nlevsoil_clm_lake)) - allocate(Sfcprop%lake_sand3d(IM,Model%nlevsoil_clm_lake)) allocate(Sfcprop%lake_is_salty(IM)) allocate(Sfcprop%lake_cannot_freeze(IM)) allocate(Sfcprop%clm_lake_initialized(IM)) @@ -2747,13 +2734,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model) Sfcprop%lake_t2m = clear_val Sfcprop%lake_q2m = clear_val Sfcprop%lake_albedo = clear_val - Sfcprop%lake_z3d = clear_val - Sfcprop%lake_dz3d = clear_val - Sfcprop%lake_soil_watsat3d = clear_val - Sfcprop%lake_csol3d = clear_val - Sfcprop%lake_soil_tkmg3d = clear_val - Sfcprop%lake_soil_tkdry3d = clear_val - Sfcprop%lake_soil_tksatu3d = clear_val + Sfcprop%input_lakedepth = clear_val Sfcprop%lake_h2osno2d = clear_val Sfcprop%lake_sndpth2d = clear_val Sfcprop%lake_snl2d = clear_val @@ -2770,8 +2751,6 @@ subroutine sfcprop_create (Sfcprop, IM, Model) Sfcprop%lake_icefrac3d = clear_val Sfcprop%lake_rho0 = -111 Sfcprop%lake_ht = -111 - Sfcprop%lake_clay3d = clear_val - Sfcprop%lake_sand3d = clear_val Sfcprop%lake_is_salty = zero Sfcprop%lake_cannot_freeze = zero Sfcprop%clm_lake_initialized = zero @@ -3829,9 +3808,12 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & integer :: ichoice_s = 3 !< flag for closure of C3/GF shallow convection !-- chem nml variables for RRFS-SD + real(kind=kind_phys) :: dust_drylimit_factor = 1.0 + real(kind=kind_phys) :: dust_moist_correction = 1.0 real(kind=kind_phys) :: dust_alpha = 0. real(kind=kind_phys) :: dust_gamma = 0. real(kind=kind_phys) :: wetdep_ls_alpha = 0. + integer :: dust_moist_opt = 1 ! fecan :1 else shao integer :: seas_opt = 2 integer :: dust_opt = 5 integer :: drydep_opt = 1 @@ -3995,6 +3977,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- aerosol scavenging factors ('name:value' string array) fscav_aero, & !--- RRFS-SD namelist + dust_drylimit_factor, dust_moist_correction, dust_moist_opt, & dust_alpha, dust_gamma, wetdep_ls_alpha, & seas_opt, dust_opt, drydep_opt, coarsepm_settling, & wetdep_ls_opt, smoke_forecast, aero_ind_fdb, aero_dir_fdb, & @@ -4214,6 +4197,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- RRFS-SD Model%rrfs_sd = rrfs_sd + Model%dust_drylimit_factor = dust_drylimit_factor + Model%dust_moist_correction = dust_moist_correction + Model%dust_moist_opt = dust_moist_opt Model%dust_alpha = dust_alpha Model%dust_gamma = dust_gamma Model%wetdep_ls_alpha = wetdep_ls_alpha @@ -6314,6 +6300,9 @@ subroutine control_print(Model) if(model%rrfs_sd) then print *, ' ' print *, 'smoke parameters' + print *, 'dust_drylimit_factor: ',Model%dust_drylimit_factor + print *, 'dust_moist_correction: ',Model%dust_moist_correction + print *, 'dust_moist_opt : ',Model%dust_moist_opt print *, 'dust_alpha : ',Model%dust_alpha print *, 'dust_gamma : ',Model%dust_gamma print *, 'wetdep_ls_alpha : ',Model%wetdep_ls_alpha diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index a8ce4f016..a4a941074 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -2034,59 +2034,11 @@ type = real kind = kind_phys active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_z3d] - standard_name = depth_of_lake_interface_layers - long_name = depth of lake interface layers - units = fraction - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_dz3d] - standard_name = thickness_of_lake_layers - long_name = thickness of lake layers - units = fraction - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_soil_watsat3d] - standard_name = saturated_volumetric_soil_water_in_lake_model - long_name = saturated volumetric soil water in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_csol3d] - standard_name = soil_heat_capacity_in_lake_model - long_name = soil heat capacity in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_soil_tkmg3d] - standard_name = soil_mineral_thermal_conductivity_in_lake_model - long_name = soil mineral thermal conductivity in lake model +[input_lakedepth] + standard_name = lake_depth_before_correction + long_name = lake depth_before_correction units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_soil_tkdry3d] - standard_name = dry_soil_thermal_conductivity_in_lake_model - long_name = dry soil thermal conductivity in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_soil_tksatu3d] - standard_name = saturated_soil_thermal_conductivity_in_lake_model - long_name = saturated soil thermal conductivity in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) + dimensions = (horizontal_loop_extent) type = real kind = kind_phys active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) @@ -2218,20 +2170,6 @@ type = real kind = kind_phys active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_clay3d] - standard_name = clm_lake_percent_clay - long_name = percent clay in clm lake model - units = percent - dimensions = (horizontal_loop_extent,soil_vertical_dimension_for_clm_lake_model) - type = integer - active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) -[lake_sand3d] - standard_name = clm_lake_percent_sand - long_name = percent sand in clm lake model - units = percent - dimensions = (horizontal_loop_extent,soil_vertical_dimension_for_clm_lake_model) - type = integer - active = (control_for_lake_model_selection == 2 .and. control_for_lake_model_execution_method > 0) [lake_is_salty] standard_name = clm_lake_is_salty long_name = lake at this point is salty (1) or not (0) @@ -6462,6 +6400,29 @@ type = real kind = kind_phys active = (do_smoke_coupling) +[dust_moist_correction] + standard_name = dust_moist_correction_fengsha_dust_scheme + long_name = moisture correction term for fengsha dust emission + units = none + dimensions = () + type = real + kind = kind_phys + active = (do_smoke_coupling) +[dust_drylimit_factor] + standard_name = dust_drylimit_factor_fengsha_dust_scheme + long_name = moisture correction term for drylimit in fengsha dust emission + units = none + dimensions = () + type = real + kind = kind_phys + active = (do_smoke_coupling) +[dust_moist_opt] + standard_name = control_for_dust_soil_moisture_option + long_name = smoke dust moisture parameterization 1 - fecan 2 - shao + units = index + dimensions = () + type = integer + active = (do_smoke_coupling) [dust_alpha] standard_name = alpha_fengsha_dust_scheme long_name = alpha paramter for fengsha dust scheme diff --git a/ccpp/driver/GFS_diagnostics.F90 b/ccpp/driver/GFS_diagnostics.F90 index 0974fdc8d..e3512528c 100644 --- a/ccpp/driver/GFS_diagnostics.F90 +++ b/ccpp/driver/GFS_diagnostics.F90 @@ -4061,6 +4061,50 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop ExtDiag(idx)%data(nb)%var2 => sfcprop(nb)%wetness(:) enddo + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'nirbmdi' + ExtDiag(idx)%desc = 'sfc nir beam sw downward flux' + ExtDiag(idx)%unit = 'W/m**2' + ExtDiag(idx)%mod_name = 'gfs_sfc' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%nirbmdi(:) + enddo + + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'nirdfdi' + ExtDiag(idx)%desc = 'sfc nir diff sw downward flux' + ExtDiag(idx)%unit = 'W/m**2' + ExtDiag(idx)%mod_name = 'gfs_sfc' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%nirdfdi(:) + enddo + + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'visbmdi' + ExtDiag(idx)%desc = 'sfc uv+vis beam sw downward flux' + ExtDiag(idx)%unit = 'W/m**2' + ExtDiag(idx)%mod_name = 'gfs_sfc' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%visbmdi(:) + enddo + + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'visdfdi' + ExtDiag(idx)%desc = ' sfc uv+vis diff sw downward flux' + ExtDiag(idx)%unit = 'W/m**2' + ExtDiag(idx)%mod_name = 'gfs_sfc' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%visdfdi(:) + enddo + if (Model%rdlai) then idx = idx + 1 ExtDiag(idx)%axes = 2 @@ -5086,42 +5130,6 @@ subroutine clm_lake_externaldiag_populate(ExtDiag, Model, Sfcprop, idx, cn_one, integer :: nk, idx0, iblk - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_z3d, 'lake_z3d', 'lake_depth_on_interface_levels', 'm') - enddo - - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_clay3d, 'lake_clay3d', 'percent clay on soil levels in clm lake model', '%') - enddo - - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_sand3d, 'lake_sand3d', 'percent sand on soil levels in clm lake model', '%') - enddo - - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_dz3d, 'lake_dz3d', 'lake level thickness', 'm') - enddo - - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_soil_watsat3d, 'lake_soil_watsat3d', 'saturated volumetric soil water', 'm3 m-3') - enddo - - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_csol3d, 'lake_csol3d', 'soil heat capacity', 'J m-3 K-1') - enddo - - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_soil_tkmg3d, 'lake_soil_tkmg3d', 'soil thermal conductivity, minerals', 'W m-1 K-1') - enddo - - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_soil_tkdry3d, 'lake_soil_tkdry3d', 'soil thermal conductivity, dry soil', 'W m-1 K-1') - enddo - - do iblk=1,nblks - call link_all_levels(Sfcprop(iblk)%lake_soil_tksatu3d, 'lake_soil_tksatu3d', 'soil thermal conductivity, saturated soil', 'W m-1 K-1') - enddo - do iblk=1,nblks call link_all_levels(Sfcprop(iblk)%lake_snow_z3d, 'lake_snow_z3d', 'lake snow level depth', 'm') enddo diff --git a/ccpp/physics b/ccpp/physics index 31a99de05..dd91c3af6 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 31a99de05048187b61a2ea8381417b8dbd8db7e0 +Subproject commit dd91c3af6296f69c4b3630f774374d51d928887c diff --git a/ccpp/suites/suite_FV3_GFS_v17_p8_c3.xml b/ccpp/suites/suite_FV3_GFS_v17_p8_c3.xml index a79f37f7f..d93060d5a 100644 --- a/ccpp/suites/suite_FV3_GFS_v17_p8_c3.xml +++ b/ccpp/suites/suite_FV3_GFS_v17_p8_c3.xml @@ -13,6 +13,7 @@ GFS_suite_interstitial_rad_reset + sgscloud_radpre GFS_rrtmg_pre GFS_radiation_surface rad_sw_pre @@ -20,6 +21,7 @@ rrtmg_sw_post rrtmg_lw_pre rrtmg_lw + sgscloud_radpost rrtmg_lw_post GFS_rrtmg_post diff --git a/io/fv3atm_clm_lake_io.F90 b/io/fv3atm_clm_lake_io.F90 index 10fa5a81c..37c221597 100644 --- a/io/fv3atm_clm_lake_io.F90 +++ b/io/fv3atm_clm_lake_io.F90 @@ -39,21 +39,19 @@ module fv3atm_clm_lake_io real(kind_phys), pointer, private, dimension(:,:) :: & T_snow=>null(), T_ice=>null(), & lake_snl2d=>null(), lake_h2osno2d=>null(), lake_tsfc=>null(), clm_lakedepth=>null(), & - lake_savedtke12d=>null(), lake_sndpth2d=>null(), clm_lake_initialized=>null() + lake_savedtke12d=>null(), lake_sndpth2d=>null(), clm_lake_initialized=>null(), & + input_lakedepth=>null() ! All 3D variables needed for a restart real(kind_phys), pointer, private, dimension(:,:,:) :: & - lake_z3d=>null(), lake_dz3d=>null(), lake_soil_watsat3d=>null(), & - lake_csol3d=>null(), lake_soil_tkmg3d=>null(), lake_soil_tkdry3d=>null(), & - lake_soil_tksatu3d=>null(), lake_snow_z3d=>null(), lake_snow_dz3d=>null(), & + lake_snow_z3d=>null(), lake_snow_dz3d=>null(), & lake_snow_zi3d=>null(), lake_h2osoi_vol3d=>null(), lake_h2osoi_liq3d=>null(), & lake_h2osoi_ice3d=>null(), lake_t_soisno3d=>null(), lake_t_lake3d=>null(), & - lake_icefrac3d=>null(), lake_clay3d=>null(), lake_sand3d=>null() + lake_icefrac3d=>null() ! Axis indices in 1-based array, containing non-1-based indices real(kind_phys), pointer, private, dimension(:) :: & - levlake_clm_lake, levsoil_clm_lake, levsnowsoil_clm_lake, & - levsnowsoil1_clm_lake + levlake_clm_lake, levsnowsoil_clm_lake, levsnowsoil1_clm_lake contains ! register_axes calls registers_axis on Sfc_restart for all required axes @@ -117,14 +115,8 @@ subroutine clm_lake_allocate_data(clm_lake,Model) allocate(clm_lake%lake_sndpth2d(nx,ny)) allocate(clm_lake%clm_lakedepth(nx,ny)) allocate(clm_lake%clm_lake_initialized(nx,ny)) + allocate(clm_lake%input_lakedepth(nx,ny)) - allocate(clm_lake%lake_z3d(nx,ny,Model%nlevlake_clm_lake)) - allocate(clm_lake%lake_dz3d(nx,ny,Model%nlevlake_clm_lake)) - allocate(clm_lake%lake_soil_watsat3d(nx,ny,Model%nlevlake_clm_lake)) - allocate(clm_lake%lake_csol3d(nx,ny,Model%nlevlake_clm_lake)) - allocate(clm_lake%lake_soil_tkmg3d(nx,ny,Model%nlevlake_clm_lake)) - allocate(clm_lake%lake_soil_tkdry3d(nx,ny,Model%nlevlake_clm_lake)) - allocate(clm_lake%lake_soil_tksatu3d(nx,ny,Model%nlevlake_clm_lake)) allocate(clm_lake%lake_snow_z3d(nx,ny,Model%nlevsnowsoil1_clm_lake)) allocate(clm_lake%lake_snow_dz3d(nx,ny,Model%nlevsnowsoil1_clm_lake)) allocate(clm_lake%lake_snow_zi3d(nx,ny,Model%nlevsnowsoil_clm_lake)) @@ -134,20 +126,14 @@ subroutine clm_lake_allocate_data(clm_lake,Model) allocate(clm_lake%lake_t_soisno3d(nx,ny,Model%nlevsnowsoil1_clm_lake)) allocate(clm_lake%lake_t_lake3d(nx,ny,Model%nlevlake_clm_lake)) allocate(clm_lake%lake_icefrac3d(nx,ny,Model%nlevlake_clm_lake)) - allocate(clm_lake%lake_clay3d(nx,ny,Model%nlevsoil_clm_lake)) - allocate(clm_lake%lake_sand3d(nx,ny,Model%nlevsoil_clm_lake)) allocate(clm_lake%levlake_clm_lake(Model%nlevlake_clm_lake)) - allocate(clm_lake%levsoil_clm_lake(Model%nlevsoil_clm_lake)) allocate(clm_lake%levsnowsoil_clm_lake(Model%nlevsnowsoil_clm_lake)) allocate(clm_lake%levsnowsoil1_clm_lake(Model%nlevsnowsoil1_clm_lake)) do i=1,Model%nlevlake_clm_lake clm_lake%levlake_clm_lake(i) = i enddo - do i=1,Model%nlevsoil_clm_lake - clm_lake%levsoil_clm_lake(i) = i - enddo do i=-Model%nlevsnow_clm_lake,Model%nlevsoil_clm_lake clm_lake%levsnowsoil_clm_lake(i+Model%nlevsnow_clm_lake+1) = i enddo @@ -165,7 +151,6 @@ subroutine clm_lake_register_axes(clm_lake,Model,Sfc_restart) type(FmsNetcdfDomainFile_t) :: Sfc_restart call register_axis(Sfc_restart, 'levlake_clm_lake', dimension_length=Model%nlevlake_clm_lake) - call register_axis(Sfc_restart, 'levsoil_clm_lake', dimension_length=Model%nlevsoil_clm_lake) call register_axis(Sfc_restart, 'levsnowsoil_clm_lake', dimension_length=Model%nlevsnowsoil_clm_lake) call register_axis(Sfc_restart, 'levsnowsoil1_clm_lake', dimension_length=Model%nlevsnowsoil1_clm_lake) end subroutine clm_lake_register_axes @@ -182,9 +167,6 @@ subroutine clm_lake_write_axes(clm_lake, Model, Sfc_restart) call register_field(Sfc_restart, 'levlake_clm_lake', axis_type, (/'levlake_clm_lake'/)) call register_variable_attribute(Sfc_restart, 'levlake_clm_lake', 'cartesian_axis' ,'Z', str_len=1) - call register_field(Sfc_restart, 'levsoil_clm_lake', axis_type, (/'levsoil_clm_lake'/)) - call register_variable_attribute(Sfc_restart, 'levsoil_clm_lake', 'cartesian_axis' ,'Z', str_len=1) - call register_field(Sfc_restart, 'levsnowsoil_clm_lake', axis_type, (/'levsnowsoil_clm_lake'/)) call register_variable_attribute(Sfc_restart, 'levsnowsoil_clm_lake', 'cartesian_axis' ,'Z', str_len=1) @@ -192,7 +174,6 @@ subroutine clm_lake_write_axes(clm_lake, Model, Sfc_restart) call register_variable_attribute(Sfc_restart, 'levsnowsoil1_clm_lake', 'cartesian_axis' ,'Z', str_len=1) call write_data(Sfc_restart, 'levlake_clm_lake', clm_lake%levlake_clm_lake) - call write_data(Sfc_restart, 'levsoil_clm_lake', clm_lake%levsoil_clm_lake) call write_data(Sfc_restart, 'levsnowsoil_clm_lake', clm_lake%levsnowsoil_clm_lake) call write_data(Sfc_restart, 'levsnowsoil1_clm_lake', clm_lake%levsnowsoil1_clm_lake) end subroutine clm_lake_write_axes @@ -229,14 +210,8 @@ subroutine clm_lake_fill_data(clm_lake, Model, Atm_block, Sfcprop) clm_lake%lake_sndpth2d(i,j) = zero clm_lake%clm_lakedepth(i,j) = zero clm_lake%clm_lake_initialized(i,j) = zero + clm_lake%input_lakedepth(i,j) = zero - clm_lake%lake_z3d(i,j,:) = zero - clm_lake%lake_dz3d(i,j,:) = zero - clm_lake%lake_soil_watsat3d(i,j,:) = zero - clm_lake%lake_csol3d(i,j,:) = zero - clm_lake%lake_soil_tkmg3d(i,j,:) = zero - clm_lake%lake_soil_tkdry3d(i,j,:) = zero - clm_lake%lake_soil_tksatu3d(i,j,:) = zero clm_lake%lake_snow_z3d(i,j,:) = zero clm_lake%lake_snow_dz3d(i,j,:) = zero clm_lake%lake_snow_zi3d(i,j,:) = zero @@ -246,8 +221,6 @@ subroutine clm_lake_fill_data(clm_lake, Model, Atm_block, Sfcprop) clm_lake%lake_t_soisno3d(i,j,:) = zero clm_lake%lake_t_lake3d(i,j,:) = zero clm_lake%lake_icefrac3d(i,j,:) = zero - clm_lake%lake_clay3d(i,j,:) = zero - clm_lake%lake_sand3d(i,j,:) = zero enddo enddo end subroutine clm_lake_fill_data @@ -284,14 +257,8 @@ subroutine clm_lake_copy_from_grid(clm_lake, Model, Atm_block, Sfcprop) clm_lake%lake_sndpth2d(i,j) = Sfcprop(nb)%lake_sndpth2d(ix) clm_lake%clm_lakedepth(i,j) = Sfcprop(nb)%clm_lakedepth(ix) clm_lake%clm_lake_initialized(i,j) = Sfcprop(nb)%clm_lake_initialized(ix) + clm_lake%input_lakedepth(i,j) = Sfcprop(nb)%input_lakedepth(ix) - clm_lake%lake_z3d(i,j,:) = Sfcprop(nb)%lake_z3d(ix,:) - clm_lake%lake_dz3d(i,j,:) = Sfcprop(nb)%lake_dz3d(ix,:) - clm_lake%lake_soil_watsat3d(i,j,:) = Sfcprop(nb)%lake_soil_watsat3d(ix,:) - clm_lake%lake_csol3d(i,j,:) = Sfcprop(nb)%lake_csol3d(ix,:) - clm_lake%lake_soil_tkmg3d(i,j,:) = Sfcprop(nb)%lake_soil_tkmg3d(ix,:) - clm_lake%lake_soil_tkdry3d(i,j,:) = Sfcprop(nb)%lake_soil_tkdry3d(ix,:) - clm_lake%lake_soil_tksatu3d(i,j,:) = Sfcprop(nb)%lake_soil_tksatu3d(ix,:) clm_lake%lake_snow_z3d(i,j,:) = Sfcprop(nb)%lake_snow_z3d(ix,:) clm_lake%lake_snow_dz3d(i,j,:) = Sfcprop(nb)%lake_snow_dz3d(ix,:) clm_lake%lake_snow_zi3d(i,j,:) = Sfcprop(nb)%lake_snow_zi3d(ix,:) @@ -301,8 +268,6 @@ subroutine clm_lake_copy_from_grid(clm_lake, Model, Atm_block, Sfcprop) clm_lake%lake_t_soisno3d(i,j,:) = Sfcprop(nb)%lake_t_soisno3d(ix,:) clm_lake%lake_t_lake3d(i,j,:) = Sfcprop(nb)%lake_t_lake3d(ix,:) clm_lake%lake_icefrac3d(i,j,:) = Sfcprop(nb)%lake_icefrac3d(ix,:) - clm_lake%lake_clay3d(i,j,:) = Sfcprop(nb)%lake_clay3d(ix,:) - clm_lake%lake_sand3d(i,j,:) = Sfcprop(nb)%lake_sand3d(ix,:) enddo enddo end subroutine clm_lake_copy_from_grid @@ -338,14 +303,8 @@ subroutine clm_lake_copy_to_grid(clm_lake, Model, Atm_block, Sfcprop) Sfcprop(nb)%lake_sndpth2d(ix) = clm_lake%lake_sndpth2d(i,j) Sfcprop(nb)%clm_lakedepth(ix) = clm_lake%clm_lakedepth(i,j) Sfcprop(nb)%clm_lake_initialized(ix) = clm_lake%clm_lake_initialized(i,j) + Sfcprop(nb)%input_lakedepth(ix) = clm_lake%input_lakedepth(i,j) - Sfcprop(nb)%lake_z3d(ix,:) = clm_lake%lake_z3d(i,j,:) - Sfcprop(nb)%lake_dz3d(ix,:) = clm_lake%lake_dz3d(i,j,:) - Sfcprop(nb)%lake_soil_watsat3d(ix,:) = clm_lake%lake_soil_watsat3d(i,j,:) - Sfcprop(nb)%lake_csol3d(ix,:) = clm_lake%lake_csol3d(i,j,:) - Sfcprop(nb)%lake_soil_tkmg3d(ix,:) = clm_lake%lake_soil_tkmg3d(i,j,:) - Sfcprop(nb)%lake_soil_tkdry3d(ix,:) = clm_lake%lake_soil_tkdry3d(i,j,:) - Sfcprop(nb)%lake_soil_tksatu3d(ix,:) = clm_lake%lake_soil_tksatu3d(i,j,:) Sfcprop(nb)%lake_snow_z3d(ix,:) = clm_lake%lake_snow_z3d(i,j,:) Sfcprop(nb)%lake_snow_dz3d(ix,:) = clm_lake%lake_snow_dz3d(i,j,:) Sfcprop(nb)%lake_snow_zi3d(ix,:) = clm_lake%lake_snow_zi3d(i,j,:) @@ -355,8 +314,6 @@ subroutine clm_lake_copy_to_grid(clm_lake, Model, Atm_block, Sfcprop) Sfcprop(nb)%lake_t_soisno3d(ix,:) = clm_lake%lake_t_soisno3d(i,j,:) Sfcprop(nb)%lake_t_lake3d(ix,:) = clm_lake%lake_t_lake3d(i,j,:) Sfcprop(nb)%lake_icefrac3d(ix,:) = clm_lake%lake_icefrac3d(i,j,:) - Sfcprop(nb)%lake_clay3d(ix,:) = clm_lake%lake_clay3d(i,j,:) - Sfcprop(nb)%lake_sand3d(ix,:) = clm_lake%lake_sand3d(i,j,:) enddo enddo end subroutine clm_lake_copy_to_grid @@ -397,29 +354,10 @@ subroutine clm_lake_register_fields(clm_lake, Sfc_restart) dimensions=(/'xaxis_1', 'yaxis_1', 'Time '/), chunksizes=chunksizes2d, is_optional=.true.) call register_restart_field(Sfc_restart, 'clm_lake_initialized', clm_lake%clm_lake_initialized, & dimensions=(/'xaxis_1', 'yaxis_1', 'Time '/), chunksizes=chunksizes2d, is_optional=.true.) + call register_restart_field(Sfc_restart, 'input_lakedepth', clm_lake%input_lakedepth, & + dimensions=(/'xaxis_1', 'yaxis_1', 'Time '/), chunksizes=chunksizes2d, is_optional=.true.) ! Register 3D fields - call register_restart_field(Sfc_restart, 'lake_z3d', clm_lake%lake_z3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levlake_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) - call register_restart_field(Sfc_restart, 'lake_dz3d', clm_lake%lake_dz3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levlake_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) - call register_restart_field(Sfc_restart,'lake_soil_watsat3d', clm_lake%lake_soil_watsat3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levlake_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) - call register_restart_field(Sfc_restart,'lake_csol3d', clm_lake%lake_csol3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levlake_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) - call register_restart_field(Sfc_restart,'lake_soil_tkmg3d', clm_lake%lake_soil_tkmg3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levlake_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) - call register_restart_field(Sfc_restart,'lake_soil_tkdry3d', clm_lake%lake_soil_tkdry3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levlake_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) - call register_restart_field(Sfc_restart,'lake_soil_tksatu3d', clm_lake%lake_soil_tksatu3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levlake_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) call register_restart_field(Sfc_restart,'lake_snow_z3d', clm_lake%lake_snow_z3d, & dimensions=(/'xaxis_1 ', 'yaxis_1 ', & 'levsnowsoil1_clm_lake', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) @@ -447,12 +385,6 @@ subroutine clm_lake_register_fields(clm_lake, Sfc_restart) call register_restart_field(Sfc_restart,'lake_icefrac3d', clm_lake%lake_icefrac3d, & dimensions=(/'xaxis_1 ', 'yaxis_1 ', & 'levlake_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) - call register_restart_field(Sfc_restart,'lake_clay3d', clm_lake%lake_clay3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levsoil_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) - call register_restart_field(Sfc_restart,'lake_sand3d', clm_lake%lake_sand3d, & - dimensions=(/'xaxis_1 ', 'yaxis_1 ', & - 'levsoil_clm_lake ', 'Time '/), chunksizes=chunksizes3d, is_optional=.true.) end subroutine clm_lake_register_fields !>@ This is clm_lake%bundle_fields, and it is only used in the @@ -484,22 +416,9 @@ subroutine clm_lake_bundle_fields(clm_lake, bundle, grid, Model, outputfile) call create_2d_field_and_add_to_bundle(clm_lake%lake_sndpth2d, "lake_sndpth2d", trim(outputfile), grid, bundle) call create_2d_field_and_add_to_bundle(clm_lake%clm_lakedepth, "clm_lakedepth", trim(outputfile), grid, bundle) call create_2d_field_and_add_to_bundle(clm_lake%clm_lake_initialized, "clm_lake_initialized", trim(outputfile), grid, bundle) + call create_2d_field_and_add_to_bundle(clm_lake%input_lakedepth, "input_lakedepth", trim(outputfile), grid, bundle) ! Register 3D fields - call create_3d_field_and_add_to_bundle(clm_lake%lake_z3d, 'lake_z3d', 'levlake_clm_lake', & - clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) - call create_3d_field_and_add_to_bundle(clm_lake%lake_dz3d, 'lake_dz3d', 'levlake_clm_lake', & - clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) - call create_3d_field_and_add_to_bundle(clm_lake%lake_soil_watsat3d, 'lake_soil_watsat3d', 'levlake_clm_lake', & - clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) - call create_3d_field_and_add_to_bundle(clm_lake%lake_csol3d, 'lake_csol3d', 'levlake_clm_lake', & - clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) - call create_3d_field_and_add_to_bundle(clm_lake%lake_soil_tkmg3d, 'lake_soil_tkmg3d', 'levlake_clm_lake', & - clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) - call create_3d_field_and_add_to_bundle(clm_lake%lake_soil_tkdry3d, 'lake_soil_tkdry3d', 'levlake_clm_lake', & - clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) - call create_3d_field_and_add_to_bundle(clm_lake%lake_soil_tksatu3d, 'lake_soil_tksatu3d', 'levlake_clm_lake', & - clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) call create_3d_field_and_add_to_bundle(clm_lake%lake_snow_z3d, 'lake_snow_z3d', 'levsnowsoil1_clm_lake', & clm_lake%levsnowsoil1_clm_lake, trim(outputfile), grid, bundle) call create_3d_field_and_add_to_bundle(clm_lake%lake_snow_dz3d, 'lake_snow_dz3d', 'levsnowsoil1_clm_lake', & @@ -518,10 +437,6 @@ subroutine clm_lake_bundle_fields(clm_lake, bundle, grid, Model, outputfile) clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) call create_3d_field_and_add_to_bundle(clm_lake%lake_icefrac3d, 'lake_icefrac3d', 'levlake_clm_lake', & clm_lake%levlake_clm_lake, trim(outputfile), grid, bundle) - call create_3d_field_and_add_to_bundle(clm_lake%lake_clay3d, 'lake_clay3d', 'levsoil_clm_lake', & - clm_lake%levsoil_clm_lake, trim(outputfile), grid, bundle) - call create_3d_field_and_add_to_bundle(clm_lake%lake_sand3d, 'lake_sand3d', 'levsoil_clm_lake', & - clm_lake%levsoil_clm_lake, trim(outputfile), grid, bundle) end subroutine Clm_lake_bundle_fields @@ -560,14 +475,8 @@ subroutine clm_lake_deallocate_data(clm_lake) IF_ASSOC_DEALLOC_NULL(lake_sndpth2d) IF_ASSOC_DEALLOC_NULL(clm_lakedepth) IF_ASSOC_DEALLOC_NULL(clm_lake_initialized) + IF_ASSOC_DEALLOC_NULL(input_lakedepth) - IF_ASSOC_DEALLOC_NULL(lake_z3d) - IF_ASSOC_DEALLOC_NULL(lake_dz3d) - IF_ASSOC_DEALLOC_NULL(lake_soil_watsat3d) - IF_ASSOC_DEALLOC_NULL(lake_csol3d) - IF_ASSOC_DEALLOC_NULL(lake_soil_tkmg3d) - IF_ASSOC_DEALLOC_NULL(lake_soil_tkdry3d) - IF_ASSOC_DEALLOC_NULL(lake_soil_tksatu3d) IF_ASSOC_DEALLOC_NULL(lake_snow_z3d) IF_ASSOC_DEALLOC_NULL(lake_snow_dz3d) IF_ASSOC_DEALLOC_NULL(lake_snow_zi3d) @@ -577,8 +486,6 @@ subroutine clm_lake_deallocate_data(clm_lake) IF_ASSOC_DEALLOC_NULL(lake_t_soisno3d) IF_ASSOC_DEALLOC_NULL(lake_t_lake3d) IF_ASSOC_DEALLOC_NULL(lake_icefrac3d) - IF_ASSOC_DEALLOC_NULL(lake_clay3d) - IF_ASSOC_DEALLOC_NULL(lake_sand3d) #undef IF_ASSOC_DEALLOC_NULL end subroutine clm_lake_deallocate_data diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index 162362466..781d62685 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -2040,9 +2040,11 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return endif - !recover fields from cartesian vector and sfc pressure - call recover_fields(file_bundle,rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + if (fcstItemNameList(i)(1:8) /= "restart_") then + !recover fields from cartesian vector and sfc pressure + call recover_fields(file_bundle,rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + end if enddo !