From 58066ea37da600bb22557edd3a318365e4f672e4 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 8 Aug 2024 21:02:11 -0400 Subject: [PATCH 01/13] add vegtype_frac and soiltype_frac --- scm/etc/scripts/UFS_case_gen.py | 19 +- scm/src/scm_input.F90 | 432 +++++++++++++++++++------------- scm/src/scm_type_defs.F90 | 39 +-- 3 files changed, 298 insertions(+), 192 deletions(-) diff --git a/scm/etc/scripts/UFS_case_gen.py b/scm/etc/scripts/UFS_case_gen.py index 54802d3a..c6f1dfab 100755 --- a/scm/etc/scripts/UFS_case_gen.py +++ b/scm/etc/scripts/UFS_case_gen.py @@ -56,6 +56,8 @@ missing_variable_snow_layers = 3 missing_variable_soil_layers = 4 missing_variable_ice_layers = 2 +missing_variable_vegetation_categories = 20 +missing_variable_soil_categories = 16 # Path to the directory containing processed case input files PROCESSED_CASE_DIR = '../../data/processed_case_input' @@ -1686,7 +1688,7 @@ def get_UFS_surface_data(dir, tile, i, j, old_chgres, lam): ######################################################################################## # ######################################################################################## -def get_UFS_oro_data(dir, tile, i, j, lam): +def get_UFS_oro_data(dir, tile, i, j, lam, old_chgres): """Get the orographic data for the given tile and indices""" if lam: @@ -1721,6 +1723,9 @@ def get_UFS_oro_data(dir, tile, i, j, lam): #lake variables (optional) lake_frac_in = read_NetCDF_var(nc_file, "lake_frac", i, j) lake_depth_in = read_NetCDF_var(nc_file, "lake_depth", i, j) + + vegtype_frac_in = read_NetCDF_surface_var(nc_file, "vegetation_type_pct", i, j, old_chgres, missing_variable_vegetation_categories) + soiltype_frac_in = read_NetCDF_surface_var(nc_file, "soil_type_pct", i, j, old_chgres, missing_variable_soil_categories) # nc_file.close() @@ -1744,7 +1749,9 @@ def get_UFS_oro_data(dir, tile, i, j, lam): "oro_uf": orog_raw_in, "landfrac": land_frac_in, "lakefrac": lake_frac_in, - "lakedepth": lake_depth_in} + "lakedepth": lake_depth_in, + "vegtype_frac": vegtype_frac_in, + "soiltype_frac": soiltype_frac_in} return oro @@ -3208,6 +3215,8 @@ def write_SCM_case_file(state, surface, oro, forcing, init, case, date, forcing_ snow_dim = nc_file.createDimension('nsnow', len(surface["snicexy"])) nslsnw_dim = nc_file.createDimension('nsoil_plus_nsnow',len(surface["snicexy"]) + len(surface["stc"])) ice_dim = nc_file.createDimension('nice', len(surface["tiice"])) + vegcat_dim = nc_file.createDimension('nvegcat', len(oro["vegtype_frac"])) + soilcat_dim =nc_file.createDimension('nsoilcat', len(oro["soiltype_frac"])) # timei_var = nc_file.createVariable('t0', wp, ('t0')) @@ -3388,7 +3397,9 @@ def write_SCM_case_file(state, surface, oro, forcing, init, case, date, forcing_ {"name": "oro_uf", "type":wp, "dimd": ('t0'), "units": "m", "desc": "unfiltered orography"}, \ {"name": "landfrac", "type":wp, "dimd": ('t0'), "units": "none", "desc": "fraction of horizontal grid area occupied by land"}, \ {"name": "lakefrac", "type":wp, "dimd": ('t0'), "units": "none", "desc": "fraction of horizontal grid area occupied by lake", "default_value":0}, \ - {"name": "lakedepth", "type":wp, "dimd": ('t0'), "units": "none", "desc": "lake depth", "default_value":0}] + {"name": "lakedepth", "type":wp, "dimd": ('t0'), "units": "none", "desc": "lake depth", "default_value":0}, + {"name": "vegtype_frac", "type":wp, "dimd": ('t0', 'nvegcat'), "units": "none", "desc": "fraction of horizontal grid area occupied by given vegetation category"}, + {"name": "soiltype_frac","type":wp, "dimd": ('t0', 'nsoilcat'), "units": "none", "desc": "fraction of horizontal grid area occupied by given soil category"}] # var_nsst = [{"name": "tref", "type":wp, "dimd": ('t0'), "units": "K", "desc": "sea surface reference temperature for NSST"}, \ {"name": "z_c", "type":wp, "dimd": ('t0'), "units": "m", "desc": "sub-layer cooling thickness for NSST"}, \ @@ -3682,7 +3693,7 @@ def main(): check_IC_hist_surface_compatibility(forcing_dir, hist_i, hist_j, surface_data, lam, old_chgres, tile) #read in orographic data for the initial conditions at the IC point - oro_data = get_UFS_oro_data(in_dir, tile, IC_i, IC_j, lam) + oro_data = get_UFS_oro_data(in_dir, tile, IC_i, IC_j, lam, old_chgres) #read in the initial condition profiles diff --git a/scm/src/scm_input.F90 b/scm/src/scm_input.F90 index cc3effcd..13ca8d9b 100644 --- a/scm/src/scm_input.F90 +++ b/scm/src/scm_input.F90 @@ -13,6 +13,8 @@ module scm_input integer :: missing_snow_layers = 3 integer :: missing_soil_layers = 4 integer :: missing_ice_layers = 2 +integer :: missing_nvegcat = 20 +integer :: missing_nsoilcat = 16 contains @@ -219,6 +221,7 @@ subroutine get_case_init(scm_state, scm_input) integer :: input_nice !< number of sea ice levels in the input file integer :: input_ntimes !< number of times represented in the input file integer :: input_nsoil_plus_nsnow !< number of combined snow and soil levels in the input file + integer :: input_nvegcat, input_nsoilcat real(kind=dp) :: input_lat !< column latitude (deg) real(kind=dp) :: input_lon !< column longitude (deg) real(kind=dp) :: input_area !< surface area [m^2] @@ -458,7 +461,19 @@ subroutine get_case_init(scm_state, scm_input) input_nice = missing_ice_layers else call check(NF90_INQUIRE_DIMENSION(ncid, varID, tmpName, input_nice),"nf90_inq_dim(nice)") - end if + end if + ierr = NF90_INQ_DIMID(ncid,"nvegcat",varID) + if(ierr /= NF90_NOERR) then + input_nvegcat = missing_nvegcat + else + call check(NF90_INQUIRE_DIMENSION(ncid, varID, tmpName, input_nvegcat),"nf90_inq_dim(nvegcat)") + end if + ierr = NF90_INQ_DIMID(ncid,"nsoilcat",varID) + if(ierr /= NF90_NOERR) then + input_nsoilcat = missing_nsoilcat + else + call check(NF90_INQUIRE_DIMENSION(ncid, varID, tmpName, input_nsoilcat),"nf90_inq_dim(nsoilcat)") + end if !> - Allocate the dimension variables. allocate(input_pres(input_nlev),input_time(input_ntimes), stat=allocate_status) @@ -714,7 +729,7 @@ subroutine get_case_init(scm_state, scm_input) call check(NF90_CLOSE(NCID=ncid),"nf90_close()") - call scm_input%create(input_ntimes, input_nlev, input_nsoil, input_nsnow, input_nice) + call scm_input%create(input_ntimes, input_nlev, input_nsoil, input_nsnow, input_nice, input_nvegcat, input_nsoilcat) ! GJF already done in scm_input%create routine !scm_input%input_nlev = input_nlev @@ -1050,6 +1065,8 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) real(kind=dp), allocatable :: input_landfrac(:) !< fraction of horizontal grid area occupied by land real(kind=dp), allocatable :: input_lakefrac(:) !< fraction of horizontal grid area occupied by lake real(kind=dp), allocatable :: input_lakedepth(:) !< lake depth (m) + real(kind=dp), allocatable :: input_vegtype_frac(:,:) !< fraction of horizontal grid area occupied by given vegetation category + real(kind=dp), allocatable :: input_soiltype_frac(:,:) !< fraction of horizontal grid area occupied by given soil category real(kind=dp), allocatable :: input_tvxy(:) !< vegetation temperature (K) real(kind=dp), allocatable :: input_tgxy(:) !< ground temperature for Noahmp (K) @@ -1158,12 +1175,14 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) integer :: ncid, varID, allocate_status, ierr, i, k integer :: active_lon, active_lat, active_init_time CHARACTER(LEN=nf90_max_name) :: tmpName + CHARACTER(LEN=nf90_max_name) :: tmpUnits real(kind=sp), parameter :: p0 = 100000.0 real(kind=sp) :: exner, exner_inv, rho, elapsed_sec, missing_value_eps real(kind=dp) :: rinc(5) integer :: jdat(1:8), idat(1:8) !(yr, mon, day, t-zone, hr, min, sec, mil-sec) + logical :: needed_for_lsm_ics, needed_for_model_ics, lev_in_altitude - integer :: input_n_init_times, input_n_forcing_times, input_n_lev, input_n_snow, input_n_ice, input_n_soil + integer :: input_n_init_times, input_n_forcing_times, input_n_lev, input_n_snow, input_n_ice, input_n_soil, input_nvegcat, input_nsoilcat missing_value_eps = missing_value + 0.01 @@ -1181,7 +1200,17 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) call check(NF90_INQUIRE_DIMENSION(ncid, varID, tmpName, input_n_lev),"nf90_inq_dim(lev)") !Check whether long_name = 'altitude', units='m' OR long_name = 'pressure', units='Pa'? !It may not matter, because 'lev' may not be needed when the IC pressure and height are BOTH already provided - + call check(NF90_INQ_VARID(ncid,"lev",varID),"nf90_inq_varid(lev)") + call check(NF90_GET_ATT(ncid, varID, "units", tmpUnits),"nf90_get_att(units)") + if (adjustl(trim(tmpUnits)) == 'pa' .or. adjustl(trim(tmpUnits)) == 'Pa') then + lev_in_altitude = .false. + else if (adjustl(trim(tmpUnits)) == 'm') then + lev_in_altitude = .true. + else + write(0,'(a,i0,a)') "The variable 'lev' in the case data file had units different than 'm', 'pa', or 'Pa', but it is expected to be altitude in m or pressure in Pa. Stopping..." + STOP + end if + !### TO BE USED IF DEPHY-SCM can be extended to include model ICs ### !possible dimensions (if using model ICs) ierr = NF90_INQ_DIMID(ncid,"nsoil",varID) @@ -1201,6 +1230,18 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) input_n_ice = missing_ice_layers else call check(NF90_INQUIRE_DIMENSION(ncid, varID, tmpName, input_n_ice),"nf90_inq_dim(nice)") + end if + ierr = NF90_INQ_DIMID(ncid,"nvegcat",varID) + if(ierr /= NF90_NOERR) then + input_nvegcat = missing_nvegcat + else + call check(NF90_INQUIRE_DIMENSION(ncid, varID, tmpName, input_nvegcat),"nf90_inq_dim(nvegcat)") + end if + ierr = NF90_INQ_DIMID(ncid,"nsoilcat",varID) + if(ierr /= NF90_NOERR) then + input_nsoilcat = missing_nsoilcat + else + call check(NF90_INQUIRE_DIMENSION(ncid, varID, tmpName, input_nsoilcat),"nf90_inq_dim(nsoilcat)") end if !> - Allocate the dimension variables. @@ -1302,15 +1343,16 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) input_ri (input_n_lev, input_n_init_times), & input_rh (input_n_lev, input_n_init_times), & input_tke (input_n_lev, input_n_init_times), & + input_ozone (input_n_lev, input_n_init_times), & stat=allocate_status) if (trim(input_surfaceForcingLSM) == "lsm") then !if model ICs are included in the file scm_state%lsm_ics = .true. + endif !variables with vertical extent - allocate(input_ozone (input_n_lev, input_n_init_times), & - input_stc (input_n_soil, input_n_init_times), & + allocate(input_stc (input_n_soil, input_n_init_times), & input_smc (input_n_soil, input_n_init_times), & input_slc (input_n_soil, input_n_init_times), & input_snicexy (input_n_snow, input_n_init_times), & @@ -1386,6 +1428,8 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) input_landfrac ( input_n_init_times), & input_lakefrac ( input_n_init_times), & input_lakedepth ( input_n_init_times), & + input_vegtype_frac (input_nvegcat, input_n_init_times), & + input_soiltype_frac (input_nsoilcat, input_n_init_times),& stat=allocate_status) allocate(input_tvxy ( input_n_init_times), & input_tgxy ( input_n_init_times), & @@ -1452,11 +1496,38 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) input_sfalb_ice ( input_n_init_times), & input_emis_ice ( input_n_init_times), & stat=allocate_status) - end if - + + needed_for_lsm_ics = .False. + needed_for_model_ics = .False. + if (scm_state%lsm_ics .or. trim(input_surfaceForcingLSM) == "lsm") needed_for_lsm_ics = .True. + if (scm_state%model_ics) needed_for_model_ics = .True. + !> - Read in the initial profiles. - call NetCDF_read_var(ncid, "pa", .True., input_pres) - call NetCDF_read_var(ncid, "zh", .True., input_height) + + if (lev_in_altitude) then + call NetCDF_read_var(ncid, "pa", .True., input_pres) + !zh could be defined in addition to lev, use if so + call NetCDF_read_var(ncid, "zh", .False., input_height) + if (input_height(1,1) == missing_value) then + do i=1, input_n_init_times + do k=1, input_n_lev + input_height(k,i) = input_lev(k) + end do + end do + end if + else + call NetCDF_read_var(ncid, "zh", .True., input_height) + !pa could be defined in addition to lev, use if so + call NetCDF_read_var(ncid, "pa", .False., input_pres) + if (input_pres(1,1) == missing_value) then + do i=1, input_n_init_times + do k=1, input_n_lev + input_pres(k,i) = input_lev(k) + end do + end do + end if + end if + call NetCDF_read_var(ncid, "ps", .True., input_pres_surf) call NetCDF_read_var(ncid, "ua", .True., input_u) call NetCDF_read_var(ncid, "va", .True., input_v) @@ -1477,53 +1548,55 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) call NetCDF_read_var(ncid, "ri", .False., input_ri) call NetCDF_read_var(ncid, "hur", .False., input_rh) - call NetCDF_read_var(ncid, "tke", .True., input_tke) + call NetCDF_read_var(ncid, "tke", .False., input_tke) - if (trim(input_surfaceForcingLSM) == "lsm") then - call NetCDF_read_var(ncid, "o3", .True., input_ozone) - call NetCDF_read_var(ncid, "area", .True., input_area) + + call NetCDF_read_var(ncid, "o3", .False., input_ozone) + call NetCDF_read_var(ncid, "area", .False., input_area) - !orographic parameters - call NetCDF_read_var(ncid, "stddev", .True., input_stddev) - call NetCDF_read_var(ncid, "convexity", .True., input_convexity) - call NetCDF_read_var(ncid, "oa1", .True., input_oa1) - call NetCDF_read_var(ncid, "oa2", .True., input_oa2) - call NetCDF_read_var(ncid, "oa3", .True., input_oa3) - call NetCDF_read_var(ncid, "oa4", .True., input_oa4) - call NetCDF_read_var(ncid, "ol1", .True., input_ol1) - call NetCDF_read_var(ncid, "ol2", .True., input_ol2) - call NetCDF_read_var(ncid, "ol3", .True., input_ol3) - call NetCDF_read_var(ncid, "ol4", .True., input_ol4) - call NetCDF_read_var(ncid, "theta_oro", .True., input_theta_oro) - call NetCDF_read_var(ncid, "gamma", .True., input_gamma) - call NetCDF_read_var(ncid, "sigma", .True., input_sigma) - call NetCDF_read_var(ncid, "elvmax", .True., input_elvmax) - call NetCDF_read_var(ncid, "oro", .True., input_oro) - call NetCDF_read_var(ncid, "oro_uf", .True., input_oro_uf) - call NetCDF_read_var(ncid, "landfrac", .True., input_landfrac) - call NetCDF_read_var(ncid, "lakefrac", .True., input_lakefrac) - call NetCDF_read_var(ncid, "lakedepth", .True., input_lakedepth) + !orographic parameters + call NetCDF_read_var(ncid, "stddev", needed_for_model_ics, input_stddev) + call NetCDF_read_var(ncid, "convexity", needed_for_model_ics, input_convexity) + call NetCDF_read_var(ncid, "oa1", needed_for_model_ics, input_oa1) + call NetCDF_read_var(ncid, "oa2", needed_for_model_ics, input_oa2) + call NetCDF_read_var(ncid, "oa3", needed_for_model_ics, input_oa3) + call NetCDF_read_var(ncid, "oa4", needed_for_model_ics, input_oa4) + call NetCDF_read_var(ncid, "ol1", needed_for_model_ics, input_ol1) + call NetCDF_read_var(ncid, "ol2", needed_for_model_ics, input_ol2) + call NetCDF_read_var(ncid, "ol3", needed_for_model_ics, input_ol3) + call NetCDF_read_var(ncid, "ol4", needed_for_model_ics, input_ol4) + call NetCDF_read_var(ncid, "theta_oro", needed_for_model_ics, input_theta_oro) + call NetCDF_read_var(ncid, "gamma", needed_for_model_ics, input_gamma) + call NetCDF_read_var(ncid, "sigma", needed_for_model_ics, input_sigma) + call NetCDF_read_var(ncid, "elvmax", needed_for_model_ics, input_elvmax) + call NetCDF_read_var(ncid, "oro", needed_for_model_ics, input_oro) + call NetCDF_read_var(ncid, "oro_uf", needed_for_model_ics, input_oro_uf) + call NetCDF_read_var(ncid, "landfrac", needed_for_model_ics, input_landfrac) + call NetCDF_read_var(ncid, "lakefrac", needed_for_model_ics, input_lakefrac) + call NetCDF_read_var(ncid, "lakedepth", needed_for_model_ics, input_lakedepth) + call NetCDF_read_var(ncid, "vegtype_frac", needed_for_model_ics, input_vegtype_frac) + call NetCDF_read_var(ncid, "soiltype_frac", needed_for_model_ics, input_soiltype_frac) - !NSST variables - call NetCDF_read_var(ncid, "tref", .True., input_tref) - call NetCDF_read_var(ncid, "z_c", .True., input_z_c) - call NetCDF_read_var(ncid, "c_0", .True., input_c_0) - call NetCDF_read_var(ncid, "c_d", .True., input_c_d) - call NetCDF_read_var(ncid, "w_0", .True., input_w_0) - call NetCDF_read_var(ncid, "w_d", .True., input_w_d) - call NetCDF_read_var(ncid, "xt", .True., input_xt) - call NetCDF_read_var(ncid, "xs", .True., input_xs) - call NetCDF_read_var(ncid, "xu", .True., input_xu) - call NetCDF_read_var(ncid, "xv", .True., input_xv) - call NetCDF_read_var(ncid, "xz", .True., input_xz) - call NetCDF_read_var(ncid, "zm", .True., input_zm) - call NetCDF_read_var(ncid, "xtts", .True., input_xtts) - call NetCDF_read_var(ncid, "xzts", .True., input_xzts) - call NetCDF_read_var(ncid, "d_conv", .True., input_d_conv) - call NetCDF_read_var(ncid, "ifd", .True., input_ifd) - call NetCDF_read_var(ncid, "dt_cool", .True., input_dt_cool) - call NetCDF_read_var(ncid, "qrain", .True., input_qrain) - end if + !NSST variables + call NetCDF_read_var(ncid, "tref", needed_for_model_ics, input_tref) + call NetCDF_read_var(ncid, "z_c", needed_for_model_ics, input_z_c) + call NetCDF_read_var(ncid, "c_0", needed_for_model_ics, input_c_0) + call NetCDF_read_var(ncid, "c_d", needed_for_model_ics, input_c_d) + call NetCDF_read_var(ncid, "w_0", needed_for_model_ics, input_w_0) + call NetCDF_read_var(ncid, "w_d", needed_for_model_ics, input_w_d) + call NetCDF_read_var(ncid, "xt", needed_for_model_ics, input_xt) + call NetCDF_read_var(ncid, "xs", needed_for_model_ics, input_xs) + call NetCDF_read_var(ncid, "xu", needed_for_model_ics, input_xu) + call NetCDF_read_var(ncid, "xv", needed_for_model_ics, input_xv) + call NetCDF_read_var(ncid, "xz", needed_for_model_ics, input_xz) + call NetCDF_read_var(ncid, "zm", needed_for_model_ics, input_zm) + call NetCDF_read_var(ncid, "xtts", needed_for_model_ics, input_xtts) + call NetCDF_read_var(ncid, "xzts", needed_for_model_ics, input_xzts) + call NetCDF_read_var(ncid, "d_conv", needed_for_model_ics, input_d_conv) + call NetCDF_read_var(ncid, "ifd", needed_for_model_ics, input_ifd) + call NetCDF_read_var(ncid, "dt_cool", needed_for_model_ics, input_dt_cool) + call NetCDF_read_var(ncid, "qrain", needed_for_model_ics, input_qrain) + !> - Allocate the forcing variables. @@ -1574,8 +1647,23 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) call NetCDF_read_var(ncid, "lat", .True., input_lat) call NetCDF_read_var(ncid, "lon", .True., input_lon) call NetCDF_read_var(ncid, "ps_forc", .True., input_force_pres_surf) - call NetCDF_read_var(ncid, "zh_forc", .True., input_force_height) - call NetCDF_read_var(ncid, "pa_forc", .True., input_force_pres) + !zh_forc and pa_forc should be present according to the DEPHY standard; if not, assume that zh_forc = input_height and pa_forc = input_pres + call NetCDF_read_var(ncid, "zh_forc", .False., input_force_height) + if (input_force_height(1,1) == missing_value) then + do i=1, input_n_forcing_times + do k=1, input_n_lev + input_force_height(k,i) = input_height(k,1) + end do + end do + end if + call NetCDF_read_var(ncid, "pa_forc", .False., input_force_pres) + if (input_force_pres(1,1) == missing_value) then + do i=1, input_n_forcing_times + do k=1, input_n_lev + input_force_pres(k,i) = input_pres(k,1) + end do + end do + end if !conditionally read forcing vars (or set to missing); if the global attribute is set to expect a variable and it doesn't exist, stop the model call NetCDF_conditionally_read_var(adv_u, "adv_ua", "tnua_adv", trim(adjustl(scm_state%case_name))//'.nc', ncid, input_force_u_adv) @@ -1645,110 +1733,112 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) ! ! Surface forcing Model LSM ICs ! - if (trim(input_surfaceForcingLSM) == "lsm") then - call NetCDF_read_var(ncid, "stc", .True., input_stc) - call NetCDF_read_var(ncid, "smc", .True., input_smc) - call NetCDF_read_var(ncid, "slc", .True., input_slc) - call NetCDF_read_var(ncid, "snicexy", .True., input_snicexy) - call NetCDF_read_var(ncid, "snliqxy", .True., input_snliqxy) - call NetCDF_read_var(ncid, "tsnoxy", .True., input_tsnoxy ) - call NetCDF_read_var(ncid, "smoiseq", .True., input_smoiseq) - call NetCDF_read_var(ncid, "zsnsoxy", .True., input_zsnsoxy) - call NetCDF_read_var(ncid, "tiice", .True., input_tiice) - call NetCDF_read_var(ncid, "tslb", .True., input_tslb ) - call NetCDF_read_var(ncid, "smois", .True., input_smois) - call NetCDF_read_var(ncid, "sh2o", .True., input_sh2o ) - call NetCDF_read_var(ncid, "smfr", .True., input_smfr ) - call NetCDF_read_var(ncid, "flfr", .True., input_flfr ) + + call NetCDF_read_var(ncid, "stc", .False., input_stc) + call NetCDF_read_var(ncid, "smc", .False., input_smc) + call NetCDF_read_var(ncid, "slc", .False., input_slc) + + call NetCDF_read_var(ncid, "tiice", .False., input_tiice) - call NetCDF_read_var(ncid, "vegsrc", .True., input_vegsrc ) - call NetCDF_read_var(ncid, "vegtyp", .True., input_vegtyp ) - call NetCDF_read_var(ncid, "soiltyp", .True., input_soiltyp ) - call NetCDF_read_var(ncid, "scolor", .True., input_scolor) - call NetCDF_read_var(ncid, "slopetyp", .True., input_slopetype) - call NetCDF_read_var(ncid, "tsfco", .True., input_tsfco) - call NetCDF_read_var(ncid, "vegfrac", .True., input_vegfrac) - call NetCDF_read_var(ncid, "shdmin", .True., input_shdmin) - call NetCDF_read_var(ncid, "shdmax", .True., input_shdmax) - call NetCDF_read_var(ncid, "slmsk", .True., input_slmsk) - call NetCDF_read_var(ncid, "canopy", .True., input_canopy) - call NetCDF_read_var(ncid, "hice", .True., input_hice) - call NetCDF_read_var(ncid, "fice", .True., input_fice) - call NetCDF_read_var(ncid, "tisfc", .True., input_tisfc) - call NetCDF_read_var(ncid, "snowd", .True., input_snwdph) - call NetCDF_read_var(ncid, "snoalb", .True., input_snoalb) - call NetCDF_read_var(ncid, "tg3", .True., input_tg3) - call NetCDF_read_var(ncid, "uustar", .True., input_uustar) - call NetCDF_read_var(ncid, "alvsf", .True., input_alvsf) - call NetCDF_read_var(ncid, "alnsf", .True., input_alnsf) - call NetCDF_read_var(ncid, "alvwf", .True., input_alvwf) - call NetCDF_read_var(ncid, "alnwf", .True., input_alnwf) - call NetCDF_read_var(ncid, "facsf", .True., input_facsf) - call NetCDF_read_var(ncid, "facwf", .True., input_facwf) - call NetCDF_read_var(ncid, "weasd", .True., input_weasd) - call NetCDF_read_var(ncid, "f10m", .True., input_f10m) - call NetCDF_read_var(ncid, "t2m", .True., input_t2m) - call NetCDF_read_var(ncid, "q2m", .True., input_q2m) - call NetCDF_read_var(ncid, "ffmm", .True., input_ffmm) - call NetCDF_read_var(ncid, "ffhh", .True., input_ffhh) - call NetCDF_read_var(ncid, "tprcp", .True., input_tprcp) - call NetCDF_read_var(ncid, "srflag", .True., input_srflag) - call NetCDF_read_var(ncid, "sncovr", .True., input_sncovr) - call NetCDF_read_var(ncid, "tsfcl", .True., input_tsfcl) - call NetCDF_read_var(ncid, "zorll", .True., input_zorll) - call NetCDF_read_var(ncid, "zorli", .True., input_zorli) - call NetCDF_read_var(ncid, "zorlw", .True., input_zorlw) + call NetCDF_read_var(ncid, "vegsrc", .False., input_vegsrc ) + call NetCDF_read_var(ncid, "vegtyp", .False., input_vegtyp ) + call NetCDF_read_var(ncid, "soiltyp", .False., input_soiltyp ) + call NetCDF_read_var(ncid, "scolor", .False., input_scolor) + call NetCDF_read_var(ncid, "slopetyp", .False., input_slopetype) + call NetCDF_read_var(ncid, "tsfco", .False., input_tsfco) + call NetCDF_read_var(ncid, "vegfrac", .False., input_vegfrac) + call NetCDF_read_var(ncid, "shdmin", .False., input_shdmin) + call NetCDF_read_var(ncid, "shdmax", .False., input_shdmax) + call NetCDF_read_var(ncid, "slmsk", .False., input_slmsk) + call NetCDF_read_var(ncid, "canopy", .False., input_canopy) + call NetCDF_read_var(ncid, "hice", .False., input_hice) + call NetCDF_read_var(ncid, "fice", .False., input_fice) + call NetCDF_read_var(ncid, "tisfc", .False., input_tisfc) + call NetCDF_read_var(ncid, "snowd", .False., input_snwdph) + call NetCDF_read_var(ncid, "snoalb", .False., input_snoalb) + call NetCDF_read_var(ncid, "tg3", .False., input_tg3) + call NetCDF_read_var(ncid, "uustar", .False., input_uustar) + call NetCDF_read_var(ncid, "alvsf", .False., input_alvsf) + call NetCDF_read_var(ncid, "alnsf", .False., input_alnsf) + call NetCDF_read_var(ncid, "alvwf", .False., input_alvwf) + call NetCDF_read_var(ncid, "alnwf", .False., input_alnwf) + call NetCDF_read_var(ncid, "facsf", .False., input_facsf) + call NetCDF_read_var(ncid, "facwf", .False., input_facwf) + call NetCDF_read_var(ncid, "weasd", .False., input_weasd) + call NetCDF_read_var(ncid, "f10m", .False., input_f10m) + call NetCDF_read_var(ncid, "t2m", .False., input_t2m) + call NetCDF_read_var(ncid, "q2m", .False., input_q2m) + call NetCDF_read_var(ncid, "ffmm", .False., input_ffmm) + call NetCDF_read_var(ncid, "ffhh", .False., input_ffhh) + call NetCDF_read_var(ncid, "tprcp", .False., input_tprcp) + call NetCDF_read_var(ncid, "srflag", .False., input_srflag) + call NetCDF_read_var(ncid, "sncovr", .False., input_sncovr) + call NetCDF_read_var(ncid, "tsfcl", .False., input_tsfcl) + call NetCDF_read_var(ncid, "zorll", .False., input_zorll) + call NetCDF_read_var(ncid, "zorli", .False., input_zorli) + call NetCDF_read_var(ncid, "zorlw", .False., input_zorlw) - !NoahMP parameters - call NetCDF_read_var(ncid, "tvxy", .False., input_tvxy) - call NetCDF_read_var(ncid, "tgxy", .False., input_tgxy) - call NetCDF_read_var(ncid, "tahxy", .False., input_tahxy) - call NetCDF_read_var(ncid, "canicexy", .False., input_canicexy) - call NetCDF_read_var(ncid, "canliqxy", .False., input_canliqxy) - call NetCDF_read_var(ncid, "eahxy", .False., input_eahxy) - call NetCDF_read_var(ncid, "cmxy", .False., input_cmxy) - call NetCDF_read_var(ncid, "chxy", .False., input_chxy) - call NetCDF_read_var(ncid, "fwetxy", .False., input_fwetxy) - call NetCDF_read_var(ncid, "sneqvoxy", .False., input_sneqvoxy) - call NetCDF_read_var(ncid, "alboldxy", .False., input_alboldxy) - call NetCDF_read_var(ncid, "qsnowxy", .False., input_qsnowxy) - call NetCDF_read_var(ncid, "wslakexy", .False., input_wslakexy) - call NetCDF_read_var(ncid, "taussxy", .False., input_taussxy) - call NetCDF_read_var(ncid, "waxy", .False., input_waxy) - call NetCDF_read_var(ncid, "wtxy", .False., input_wtxy) - call NetCDF_read_var(ncid, "zwtxy", .False., input_zwtxy) - call NetCDF_read_var(ncid, "xlaixy", .False., input_xlaixy) - call NetCDF_read_var(ncid, "xsaixy", .False., input_xsaixy) - call NetCDF_read_var(ncid, "lfmassxy", .False., input_lfmassxy) - call NetCDF_read_var(ncid, "stmassxy", .False., input_stmassxy) - call NetCDF_read_var(ncid, "rtmassxy", .False., input_rtmassxy) - call NetCDF_read_var(ncid, "woodxy", .False., input_woodxy) - call NetCDF_read_var(ncid, "stblcpxy", .False., input_stblcpxy) - call NetCDF_read_var(ncid, "fastcpxy", .False., input_fastcpxy) - call NetCDF_read_var(ncid, "smcwtdxy", .False., input_smcwtdxy) - call NetCDF_read_var(ncid, "deeprechxy",.False., input_deeprechxy) - call NetCDF_read_var(ncid, "rechxy", .False., input_rechxy) - call NetCDF_read_var(ncid, "snowxy", .False., input_snowxy) - !RUC LSM variables - call NetCDF_read_var(ncid, "wetness", .False., input_wetness) - call NetCDF_read_var(ncid, "clw_surf_land", .False., input_clw_surf_land) - call NetCDF_read_var(ncid, "clw_surf_ice", .False., input_clw_surf_ice) - call NetCDF_read_var(ncid, "qwv_surf_land", .False., input_qwv_surf_land) - call NetCDF_read_var(ncid, "qwv_surf_ice", .False., input_qwv_surf_ice) - call NetCDF_read_var(ncid, "tsnow_land", .False., input_tsnow_land) - call NetCDF_read_var(ncid, "tsnow_ice", .False., input_tsnow_ice) - call NetCDF_read_var(ncid, "snowfallac_land", .False., input_snowfallac_land) - call NetCDF_read_var(ncid, "snowfallac_ice", .False., input_snowfallac_ice) - call NetCDF_read_var(ncid, "sncovr_ice", .False., input_sncovr_ice) - call NetCDF_read_var(ncid, "sfalb_lnd", .False., input_sfalb_lnd) - call NetCDF_read_var(ncid, "sfalb_lnd_bck", .False., input_sfalb_lnd_bck) - call NetCDF_read_var(ncid, "emis_ice", .False., input_emis_ice) - call NetCDF_read_var(ncid, "lai", .False., input_lai) - end if + !NoahMP parameters + call NetCDF_read_var(ncid, "snicexy", .False., input_snicexy) + call NetCDF_read_var(ncid, "snliqxy", .False., input_snliqxy) + call NetCDF_read_var(ncid, "tsnoxy", .False., input_tsnoxy ) + call NetCDF_read_var(ncid, "smoiseq", .False., input_smoiseq) + call NetCDF_read_var(ncid, "zsnsoxy", .False., input_zsnsoxy) + + call NetCDF_read_var(ncid, "tvxy", .False., input_tvxy) + call NetCDF_read_var(ncid, "tgxy", .False., input_tgxy) + call NetCDF_read_var(ncid, "tahxy", .False., input_tahxy) + call NetCDF_read_var(ncid, "canicexy", .False., input_canicexy) + call NetCDF_read_var(ncid, "canliqxy", .False., input_canliqxy) + call NetCDF_read_var(ncid, "eahxy", .False., input_eahxy) + call NetCDF_read_var(ncid, "cmxy", .False., input_cmxy) + call NetCDF_read_var(ncid, "chxy", .False., input_chxy) + call NetCDF_read_var(ncid, "fwetxy", .False., input_fwetxy) + call NetCDF_read_var(ncid, "sneqvoxy", .False., input_sneqvoxy) + call NetCDF_read_var(ncid, "alboldxy", .False., input_alboldxy) + call NetCDF_read_var(ncid, "qsnowxy", .False., input_qsnowxy) + call NetCDF_read_var(ncid, "wslakexy", .False., input_wslakexy) + call NetCDF_read_var(ncid, "taussxy", .False., input_taussxy) + call NetCDF_read_var(ncid, "waxy", .False., input_waxy) + call NetCDF_read_var(ncid, "wtxy", .False., input_wtxy) + call NetCDF_read_var(ncid, "zwtxy", .False., input_zwtxy) + call NetCDF_read_var(ncid, "xlaixy", .False., input_xlaixy) + call NetCDF_read_var(ncid, "xsaixy", .False., input_xsaixy) + call NetCDF_read_var(ncid, "lfmassxy", .False., input_lfmassxy) + call NetCDF_read_var(ncid, "stmassxy", .False., input_stmassxy) + call NetCDF_read_var(ncid, "rtmassxy", .False., input_rtmassxy) + call NetCDF_read_var(ncid, "woodxy", .False., input_woodxy) + call NetCDF_read_var(ncid, "stblcpxy", .False., input_stblcpxy) + call NetCDF_read_var(ncid, "fastcpxy", .False., input_fastcpxy) + call NetCDF_read_var(ncid, "smcwtdxy", .False., input_smcwtdxy) + call NetCDF_read_var(ncid, "deeprechxy",.False., input_deeprechxy) + call NetCDF_read_var(ncid, "rechxy", .False., input_rechxy) + call NetCDF_read_var(ncid, "snowxy", .False., input_snowxy) + !RUC LSM variables + call NetCDF_read_var(ncid, "tslb", .False., input_tslb ) + call NetCDF_read_var(ncid, "smois", .False., input_smois) + call NetCDF_read_var(ncid, "sh2o", .False., input_sh2o ) + call NetCDF_read_var(ncid, "smfr", .False., input_smfr ) + call NetCDF_read_var(ncid, "flfr", .False., input_flfr ) + call NetCDF_read_var(ncid, "wetness", .False., input_wetness) + call NetCDF_read_var(ncid, "clw_surf_land", .False., input_clw_surf_land) + call NetCDF_read_var(ncid, "clw_surf_ice", .False., input_clw_surf_ice) + call NetCDF_read_var(ncid, "qwv_surf_land", .False., input_qwv_surf_land) + call NetCDF_read_var(ncid, "qwv_surf_ice", .False., input_qwv_surf_ice) + call NetCDF_read_var(ncid, "tsnow_land", .False., input_tsnow_land) + call NetCDF_read_var(ncid, "tsnow_ice", .False., input_tsnow_ice) + call NetCDF_read_var(ncid, "snowfallac_land", .False., input_snowfallac_land) + call NetCDF_read_var(ncid, "snowfallac_ice", .False., input_snowfallac_ice) + call NetCDF_read_var(ncid, "sncovr_ice", .False., input_sncovr_ice) + call NetCDF_read_var(ncid, "sfalb_lnd", .False., input_sfalb_lnd) + call NetCDF_read_var(ncid, "sfalb_lnd_bck", .False., input_sfalb_lnd_bck) + call NetCDF_read_var(ncid, "emis_ice", .False., input_emis_ice) + call NetCDF_read_var(ncid, "lai", .False., input_lai) + call check(NF90_CLOSE(NCID=ncid),"nf90_close()") - call scm_input%create(input_n_forcing_times, input_n_lev, input_n_soil, input_n_snow, input_n_ice) + call scm_input%create(input_n_forcing_times, input_n_lev, input_n_soil, input_n_snow, input_n_ice, input_nvegcat, input_nsoilcat) !fill the scm_input DDT @@ -1989,6 +2079,8 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) scm_input%input_landfrac = input_landfrac(active_init_time) scm_input%input_lakefrac = input_lakefrac(active_init_time) scm_input%input_lakedepth= input_lakedepth(active_init_time) + scm_input%input_vegtype_frac = input_vegtype_frac(:,active_init_time) + scm_input%input_soiltype_frac = input_soiltype_frac(:,active_init_time) scm_input%input_tref = input_tref(active_init_time) scm_input%input_z_c = input_z_c(active_init_time) @@ -2138,7 +2230,9 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) else scm_input%input_lh_flux_sfc = input_force_sfc_lat_flx(:) end if - else if (trim(input_surfaceForcingLSM) == 'lsm') then + end if + + if (trim(input_surfaceForcingLSM) == 'lsm') then !these were considered required variables above, so they should not need to be checked for missing scm_input%input_stc = input_stc(:,active_init_time) scm_input%input_smc = input_smc(:,active_init_time) @@ -2259,8 +2353,8 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) !set all individual w forcing controls to .true. until finer control is available from the input file scm_state%force_sub_for_T = .true. scm_state%force_sub_for_qv = .true. - scm_state%force_sub_for_u = .true. - scm_state%force_sub_for_v = .true. + !scm_state%force_sub_for_u = .true. + !scm_state%force_sub_for_v = .true. else if (forc_w > 0) then do i=1, input_n_forcing_times scm_input%input_w_ls(i,:) = input_force_w(:,i) @@ -2270,8 +2364,8 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) !set all individual w forcing controls to .true. until finer control is available from the input file scm_state%force_sub_for_T = .true. scm_state%force_sub_for_qv = .true. - scm_state%force_sub_for_u = .true. - scm_state%force_sub_for_v = .true. + ! scm_state%force_sub_for_u = .true. + ! scm_state%force_sub_for_v = .true. end if if (forc_geo > 0) then @@ -2399,7 +2493,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_T_nudge = 1 + scm_input%input_k_T_nudge(:) = 1 end if else if (nudging_theta > 0) then !assume no cloud water since there is no associate [ql,qi]_nudge in the input? @@ -2425,7 +2519,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_thil_nudge = 1 + scm_input%input_k_thil_nudge(:) = 1 end if else if (nudging_thetal > 0) then !assume no cloud water since there is no associate [ql,qi]_nudge in the input? @@ -2451,7 +2545,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_thil_nudge = 1 + scm_input%input_k_thil_nudge(:) = 1 end if end if @@ -2478,7 +2572,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_qt_nudge = 1 + scm_input%input_k_qt_nudge(:) = 1 end if else if (nudging_qt > 0) then do i=1, input_n_forcing_times @@ -2503,7 +2597,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_qt_nudge = 1 + scm_input%input_k_qt_nudge(:) = 1 end if else if (nudging_rv > 0) then do i=1, input_n_forcing_times @@ -2531,7 +2625,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_qt_nudge = 1 + scm_input%input_k_qt_nudge(:) = 1 end if else if (nudging_rt > 0) then do i=1, input_n_forcing_times @@ -2559,7 +2653,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_qt_nudge = 1 + scm_input%input_k_qt_nudge(:) = 1 end if end if @@ -2586,7 +2680,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_u_nudge = 1 + scm_input%input_k_u_nudge(:) = 1 end if end if @@ -2613,7 +2707,7 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) end if end do else - scm_input%input_k_v_nudge = 1 + scm_input%input_k_v_nudge(:) = 1 end if end if diff --git a/scm/src/scm_type_defs.F90 b/scm/src/scm_type_defs.F90 index 64c4289c..5302b750 100644 --- a/scm/src/scm_type_defs.F90 +++ b/scm/src/scm_type_defs.F90 @@ -180,6 +180,8 @@ module scm_type_defs integer :: input_nsoil !< number of soil levels in the input file integer :: input_nsnow !< number of snow layers in the input file integer :: input_nice !< number of sea ice layers in the input file + integer :: input_nvegcat !< number of vegetation type categories + integer :: input_nsoilcat !< number of soil type categories integer :: input_ntimes !< number of times in the input file where forcing is available real(kind=dp) :: input_lat !< latitude of column center real(kind=dp) :: input_lon !< longitude of column center @@ -262,6 +264,8 @@ module scm_type_defs real(kind=dp) :: input_landfrac !< fraction of horizontal grid area occupied by land real(kind=dp) :: input_lakefrac !< fraction of horizontal grid area occupied by lake real(kind=dp) :: input_lakedepth !< lake depth (m) + real(kind=dp), allocatable :: input_vegtype_frac(:) !< fraction of horizontal grid area occupied by given vegetation category + real(kind=dp), allocatable :: input_soiltype_frac(:) !< fraction of horizontal grid area occupied by given soil category real(kind=dp) :: input_tvxy !< vegetation temperature (K) real(kind=dp) :: input_tgxy !< ground temperature for Noahmp (K) @@ -668,14 +672,16 @@ subroutine scm_state_create(scm_state, n_columns, n_levels, n_soil, n_snow, n_ti end subroutine scm_state_create - subroutine scm_input_create(scm_input, ntimes, nlev, nsoil, nsnow, nice) + subroutine scm_input_create(scm_input, ntimes, nlev, nsoil, nsnow, nice, nvegcat, nsoilcat) class(scm_input_type) :: scm_input - integer, intent(in) :: ntimes, nlev, nsoil, nsnow, nice + integer, intent(in) :: ntimes, nlev, nsoil, nsnow, nice, nvegcat, nsoilcat scm_input%input_nlev = nlev scm_input%input_nsoil = nsoil scm_input%input_nsnow = nsnow scm_input%input_nice = nice + scm_input%input_nvegcat = nvegcat + scm_input%input_nsoilcat = nsoilcat scm_input%input_ntimes = ntimes scm_input%input_lat = real_zero @@ -762,6 +768,10 @@ subroutine scm_input_create(scm_input, ntimes, nlev, nsoil, nsnow, nice) scm_input%input_landfrac = real_zero scm_input%input_lakefrac = real_zero scm_input%input_lakedepth = real_zero + allocate(scm_input%input_vegtype_frac(nvegcat)) + scm_input%input_vegtype_frac = real_zero + allocate(scm_input%input_soiltype_frac(nsoilcat)) + scm_input%input_soiltype_frac = real_zero scm_input%input_tvxy = real_zero scm_input%input_tgxy = real_zero @@ -1082,8 +1092,13 @@ subroutine physics_set(physics, scm_input, scm_state) call conditionally_set_var(scm_input%input_elvmax, physics%Sfcprop%hprime(i,14), "elvmax", .true., missing_var(14)) call conditionally_set_var(scm_input%input_oro, physics%Sfcprop%oro(i), "oro", .true., missing_var(15)) call conditionally_set_var(scm_input%input_oro_uf, physics%Sfcprop%oro_uf(i), "oro_uf", (physics%Model%do_ugwp .and. physics%Model%nmtvr == 14), missing_var(16)) - - n = 19 + call conditionally_set_var(scm_input%input_landfrac, physics%Sfcprop%landfrac(i), "landfrac", physics%Model%frac_grid, missing_var(17)) + call conditionally_set_var(scm_input%input_lakefrac, physics%Sfcprop%lakefrac(i), "lakefrac", (physics%Model%lkm == 1), missing_var(18)) + call conditionally_set_var(scm_input%input_lakedepth, physics%Sfcprop%lakedepth(i), "lakedepth", (physics%Model%lkm == 1), missing_var(19)) + call conditionally_set_var(scm_input%input_vegtype_frac(:), physics%Sfcprop%vegtype_frac(i,:), "vegtype_frac", .true., missing_var(20)) + call conditionally_set_var(scm_input%input_soiltype_frac(:), physics%Sfcprop%soiltype_frac(i,:), "soiltype_frac", .true., missing_var(21)) + + n = 21 if ( i==1 .and. ANY( missing_var(1:n) ) ) then write(0,'(a)') "INPUT CHECK: Some missing input data was found related to (potentially non-required) orography and gravity wave drag parameters. This may lead to crashes or other strange behavior." write(0,'(a)') "Check scm_type_defs.F90/physics_set to see the names of variables that are missing, corresponding to the following indices:" @@ -1094,20 +1109,6 @@ subroutine physics_set(physics, scm_input, scm_state) missing_var = .false. end if - ! Variables found in orographic dataset but needed for non-orographic reasons (e.g. lake model, fractional grid) - call conditionally_set_var(scm_input%input_landfrac, physics%Sfcprop%landfrac(i), "landfrac", physics%Model%frac_grid, missing_var(1)) - call conditionally_set_var(scm_input%input_lakefrac, physics%Sfcprop%lakefrac(i), "lakefrac", (physics%Model%lkm == 1), missing_var(2)) - call conditionally_set_var(scm_input%input_lakedepth, physics%Sfcprop%lakedepth(i), "lakedepth", (physics%Model%lkm == 1), missing_var(3)) - n = 3 - if ( i==1 .and. ANY( missing_var(1:n) ) ) then - write(0,'(a)') "INPUT CHECK: Some missing input data was found related to (potentially non-required) lake-related or fractional grid-related variables. This may lead to crashes or other strange behavior." - write(0,'(a)') "Check scm_type_defs.F90/physics_set to see the names of variables that are missing, corresponding to the following indices:" - do j=1, n - if (missing_var(j)) write(0,'(a,i0)') "variable index ",j - end do - end if - missing_var = .false. - ! ! Surface data (2D) ! @@ -1214,7 +1215,7 @@ subroutine physics_set(physics, scm_input, scm_state) ! Derive physics quantities using surface model ICs. ! if(scm_state%model_ics .or. scm_state%lsm_ics) then - if (physics%Sfcprop%stype(i) == 14 .or. physics%Sfcprop%stype(i) <= 0) then + if (physics%Sfcprop%stype(i) == 14 .or. physics%Sfcprop%stype(i)+0.5 <= 0) then physics%Sfcprop%landfrac(i) = real_zero physics%Sfcprop%stype(i) = 0 if (physics%Sfcprop%lakefrac(i) > real_zero) then From e47081bf847905385c70b512753bfdf553a7ee19 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 8 Aug 2024 21:37:19 -0400 Subject: [PATCH 02/13] add _ps version of RRTMGP suite --- .../input_GFS_v16_RRTMGP_ps.nml | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml diff --git a/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml b/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml new file mode 100644 index 00000000..d8f59a74 --- /dev/null +++ b/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml @@ -0,0 +1,158 @@ + +&gfs_physics_nml + cal_pre = .false. + cdmbgwd = 4.0, 0.15, 1.0, 1.0 + cnvcld = .true. + cnvgwd = .true. + debug = .false. + do_shum = .false. + do_skeb = .false. + do_spp = .false. + do_sppt = .false. + do_tofd = .true. + do_ugwp = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_inc_files = '' + icliq_sw = 2 + ico2 = 2 + iems = 1 + imfdeepcnv = 2 + imfshalcnv = 2 + imp_physics = 11 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 1 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iovr = 3 + isatmedmf = 1 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .true. + ldiag_ugwp = .false. + lgfdlmprad = .true. + lheatstrg = .false. + lndp_type = 0 + lsm = 1 + lsoil = 4 + lwhtr = .true. + n_var_lndp = 0 + n_var_spp = 0 + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + prautco = 0.00015, 0.00015 + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + psautco = 0.0008, 0.0005 + qdiag3d = .true. + random_clds = .false. + redrag = .true. + satmedmf = .true. + shal_cnv = .true. + swhtr = .true. + trans_trac = .true. + use_ufo = .true. + do_RRTMGP = .true. + doGP_cldoptics_LUT = .true. + doGP_lwscat = .true. + active_gases = 'h2o_co2_o3_n2o_ch4_o2' + ngases = 6 + rrtmgp_root = '../../ccpp/physics/physics/rte-rrtmgp/' + lw_file_gas = 'rrtmgp/data/rrtmgp-data-lw-g128-210809.nc' + lw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-lw.nc' + sw_file_gas = 'rrtmgp/data/rrtmgp-data-sw-g112-210809.nc' + sw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-sw.nc' + rrtmgp_nGptsSW = 112 + rrtmgp_nGptsLW = 128 + rrtmgp_nBandsLW = 16 + rrtmgp_nBandsSW = 14 +/ + +&gfdl_cloud_microphysics_nml + c_cracw = 0.8 + c_paut = 0.5 + c_pgacs = 0.01 + c_psaci = 0.05 + ccn_l = 300.0 + ccn_o = 100.0 + const_vg = .false. + const_vi = .false. + const_vr = .false. + const_vs = .false. + de_ice = .false. + do_qa = .false. + do_sedi_heat = .false. + dw_land = 0.16 + dw_ocean = 0.1 + fast_sat_adj = .false. + fix_negative = .true. + icloud_f = 1 + mono_prof = .true. + mp_time = 150.0 + prog_ccn = .false. + qi0_crt = 8e-05 + qi_lim = 1.0 + ql_gen = 0.001 + ql_mlt = 0.001 + qs0_crt = 0.001 + rad_graupel = .true. + rad_rain = .true. + rad_snow = .true. + reiflag = 2 + rh_inc = 0.3 + rh_inr = 0.3 + rh_ins = 0.3 + rthresh = 1e-05 + sedi_transport = .true. + tau_g2v = 900.0 + tau_i2s = 1000.0 + tau_l2v = 225.0 + tau_v2l = 150.0 + use_ccn = .true. + use_ppm = .false. + vg_max = 12.0 + vi_max = 1.0 + vr_max = 12.0 + vs_max = 2.0 + z_slope_ice = .true. + z_slope_liq = .true. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 27 +/ From 2601bae4c1daa5a07d3efc39313406e7953391c7 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 8 Aug 2024 22:30:24 -0400 Subject: [PATCH 03/13] update nmls --- ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1.nml | 4 +++- ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1_ps.nml | 6 ++++-- ccpp/physics_namelists/input_HRRR_gf.nml | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1.nml b/ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1.nml index 8d859e58..a2852c3a 100644 --- a/ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1.nml +++ b/ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1.nml @@ -32,9 +32,11 @@ do_ugwp_v0_orog_only = .false. do_ugwp_v0_nst_only = .false. do_gsl_drag_ls_bl = .true. - do_gsl_drag_ss = .true. + do_gsl_drag_ss = .false. do_gsl_drag_tofd = .true. do_ugwp_v1_orog_only = .false. + do_gwd_opt_psl = .true. + psl_gwd_dx_factor = 6.0 min_lakeice = 0.15 min_seaice = 1.0e-6 use_cice_alb = .true. diff --git a/ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1_ps.nml b/ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1_ps.nml index b2f93c79..dfbd4af1 100644 --- a/ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1_ps.nml +++ b/ccpp/physics_namelists/input_GFS_v17_p8_ugwpv1_ps.nml @@ -9,7 +9,7 @@ pre_rad = .false. imp_physics = 8 iovr = 3 - ltaerosol = .False. + ltaerosol = .false. lradar = .true. ttendlim = -999 dt_inner = 150 @@ -32,9 +32,11 @@ do_ugwp_v0_orog_only = .false. do_ugwp_v0_nst_only = .false. do_gsl_drag_ls_bl = .true. - do_gsl_drag_ss = .true. + do_gsl_drag_ss = .false. do_gsl_drag_tofd = .true. do_ugwp_v1_orog_only = .false. + do_gwd_opt_psl = .true. + psl_gwd_dx_factor = 6.0 min_lakeice = 0.15 min_seaice = 1.0e-6 use_cice_alb = .true. diff --git a/ccpp/physics_namelists/input_HRRR_gf.nml b/ccpp/physics_namelists/input_HRRR_gf.nml index 60de83a4..427c1c96 100644 --- a/ccpp/physics_namelists/input_HRRR_gf.nml +++ b/ccpp/physics_namelists/input_HRRR_gf.nml @@ -91,15 +91,13 @@ lradar = .true. lrefres = .true. lsm = 3 - lsoil = 9 + lsoil = 4 lsoil_lsm = 9 ltaerosol = .true. lwhtr = .true. min_lakeice = 0.15 min_seaice = 0.15 mix_chem = .true. - mosaic_lu = 1 - mosaic_soil = 1 nsfullradar_diag = 3600 oz_phys = .false. oz_phys_2015 = .true. From dee39dbf26b94f3758acda582f08e1d4a9e5075c Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 9 Aug 2024 18:01:52 -0400 Subject: [PATCH 04/13] fix tracer file for GFS_v17_p8_ugwpv1 suite and messed up manual merge in scm_input --- scm/src/scm_input.F90 | 3 --- scm/src/suite_info.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/scm/src/scm_input.F90 b/scm/src/scm_input.F90 index a3b56a40..68705f7d 100644 --- a/scm/src/scm_input.F90 +++ b/scm/src/scm_input.F90 @@ -1573,11 +1573,8 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) call NetCDF_read_var(ncid, "landfrac", needed_for_model_ics, input_landfrac) call NetCDF_read_var(ncid, "lakefrac", needed_for_model_ics, input_lakefrac) call NetCDF_read_var(ncid, "lakedepth", needed_for_model_ics, input_lakedepth) -<<<<<<< HEAD call NetCDF_read_var(ncid, "vegtype_frac", needed_for_model_ics, input_vegtype_frac) call NetCDF_read_var(ncid, "soiltype_frac", needed_for_model_ics, input_soiltype_frac) -======= ->>>>>>> dephy_conversion !NSST variables call NetCDF_read_var(ncid, "tref", needed_for_model_ics, input_tref) diff --git a/scm/src/suite_info.py b/scm/src/suite_info.py index 97aebaf5..299ca4d6 100755 --- a/scm/src/suite_info.py +++ b/scm/src/suite_info.py @@ -43,7 +43,7 @@ def timestep(self, value): suite_list = [] suite_list.append(suite('SCM_GFS_v16', 'tracers_GFS_v16.txt', 'input_GFS_v16.nml', 600.0, 1800.0, True )) -suite_list.append(suite('SCM_GFS_v17_p8_ugwpv1', 'tracers_GFS_v17_p8.txt', 'input_GFS_v17_p8_ugwpv1.nml', 600.0, 600.0, True )) +suite_list.append(suite('SCM_GFS_v17_p8_ugwpv1', 'tracers_GFS_v17_p8_ugwpv1.txt', 'input_GFS_v17_p8_ugwpv1.nml', 600.0, 600.0, True )) suite_list.append(suite('SCM_RAP', 'tracers_RAP.txt', 'input_RAP.nml', 600.0, 600.0 , True )) suite_list.append(suite('SCM_HRRR_gf', 'tracers_HRRR_gf.txt', 'input_HRRR_gf.nml', 600.0, 600.0 , True )) suite_list.append(suite('SCM_WoFS_v0', 'tracers_WoFS_v0.txt', 'input_WoFS_v0.nml', 600.0, 600.0 , True )) From de3cab122756c3326ef6ec5b4d6b4cd5e4a0b0f1 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 9 Aug 2024 18:53:18 -0400 Subject: [PATCH 05/13] don't require NSST variables to be read in if lsm_ics but not model_ics --- scm/src/scm_type_defs.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm/src/scm_type_defs.F90 b/scm/src/scm_type_defs.F90 index 5302b750..664b91de 100644 --- a/scm/src/scm_type_defs.F90 +++ b/scm/src/scm_type_defs.F90 @@ -1317,7 +1317,7 @@ subroutine physics_set(physics, scm_input, scm_state) ! NSSTM variables ! if (physics%Model%nstf_name(1) > 0) then - if (physics%Model%nstf_name(2) == 1 .or. .not. (scm_state%model_ics .or. scm_state%lsm_ics)) then + if (physics%Model%nstf_name(2) == 1 .or. .not. (scm_state%model_ics)) then physics%Sfcprop%tref(i) = physics%Sfcprop%tsfco(i) physics%Sfcprop%z_c(i) = real_zero physics%Sfcprop%c_0(i) = real_zero From fe846e5589b6b15fdb108a2ebba57141c43f6963 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 9 Aug 2024 20:36:04 -0400 Subject: [PATCH 06/13] add GFS_v17_p8_ugwpv1.txt tracer file --- scm/etc/tracer_config/tracers_GFS_v17_p8_ugwpv1.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scm/etc/tracer_config/tracers_GFS_v17_p8_ugwpv1.txt diff --git a/scm/etc/tracer_config/tracers_GFS_v17_p8_ugwpv1.txt b/scm/etc/tracer_config/tracers_GFS_v17_p8_ugwpv1.txt new file mode 100644 index 00000000..eeba3d9e --- /dev/null +++ b/scm/etc/tracer_config/tracers_GFS_v17_p8_ugwpv1.txt @@ -0,0 +1,11 @@ +"sphum","water_vapor_specific_humidity","kg kg-1" +"liq_wat","cloud_condensed_water_mixing_ratio","kg kg-1" +"ice_wat","ice_water_mixing_ratio","kg kg-1" +"rainwat","rain_water_mixing_ratio","kg kg-1" +"snowwat","snow_water_mixing_ratio","kg kg-1" +"graupel","graupel_mixing_ratio","kg kg-1" +"ice_nc","ice_number_concentration","kg-1" +"rain_nc","rain_number_concentration","kg-1" +"o3mr","ozone_mixing_ratio","kg kg-1" +"sgs_tke","turbulent_kinetic_energy","m2 s-2" +"sigmab"," prognostic_updraft_area_fraction_in_convection","frac" From f008ae0c71a05d8d1b7d2536fb5428abcc87376c Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Mon, 12 Aug 2024 11:37:44 -0400 Subject: [PATCH 07/13] update rrtmgp root in physics namelists --- ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml | 2 +- ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml | 2 +- ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml b/ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml index 08c6af0d..9db49ed4 100644 --- a/ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml +++ b/ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml @@ -49,7 +49,7 @@ do_RRTMGP = .true. active_gases = 'h2o_co2_o3_n2o_ch4_o2' ngases = 6 - rrtmgp_root = '../../ccpp/physics/physics/rte-rrtmgp/' + rrtmgp_root = '../../ccpp/physics/physics/Radiation/RRTMGP/rte-rrtmgp/' lw_file_gas = 'rrtmgp/data/rrtmgp-data-lw-g256-2018-12-04.nc' lw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-lw.nc' sw_file_gas = 'rrtmgp/data/rrtmgp-data-sw-g224-2018-12-04.nc' diff --git a/ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml b/ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml index e9ad918c..375a937a 100644 --- a/ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml +++ b/ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml @@ -81,7 +81,7 @@ doGP_lwscat = .true. active_gases = 'h2o_co2_o3_n2o_ch4_o2' ngases = 6 - rrtmgp_root = '../../ccpp/physics/physics/rte-rrtmgp/' + rrtmgp_root = '../../ccpp/physics/physics/Radiation/RRTMGP/rte-rrtmgp/' lw_file_gas = 'rrtmgp/data/rrtmgp-data-lw-g128-210809.nc' lw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-lw.nc' sw_file_gas = 'rrtmgp/data/rrtmgp-data-sw-g112-210809.nc' diff --git a/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml b/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml index d8f59a74..43dcb8ee 100644 --- a/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml +++ b/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml @@ -81,7 +81,7 @@ doGP_lwscat = .true. active_gases = 'h2o_co2_o3_n2o_ch4_o2' ngases = 6 - rrtmgp_root = '../../ccpp/physics/physics/rte-rrtmgp/' + rrtmgp_root = '../../ccpp/physics/physics/Radiation/RRTMGP/rte-rrtmgp/' lw_file_gas = 'rrtmgp/data/rrtmgp-data-lw-g128-210809.nc' lw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-lw.nc' sw_file_gas = 'rrtmgp/data/rrtmgp-data-sw-g112-210809.nc' From 2f76060f3d81e688ce766ff2be7a3e7437bcbf65 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Mon, 12 Aug 2024 17:09:14 -0400 Subject: [PATCH 08/13] update another RRTMGP file path to avoid runtime errors --- ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml | 2 +- ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml | 2 +- ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml b/ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml index 9db49ed4..011d3b5f 100644 --- a/ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml +++ b/ccpp/physics_namelists/input_GFS_v15p2_RRTMGP.nml @@ -53,7 +53,7 @@ lw_file_gas = 'rrtmgp/data/rrtmgp-data-lw-g256-2018-12-04.nc' lw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-lw.nc' sw_file_gas = 'rrtmgp/data/rrtmgp-data-sw-g224-2018-12-04.nc' - sw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-sw.nc' + sw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-reordered-sw.nc' doG_cldoptics = .true. rrtmgp_ngauss_ang = 3 rrtmgp_nrghice = 3 diff --git a/ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml b/ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml index 375a937a..238d8f36 100644 --- a/ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml +++ b/ccpp/physics_namelists/input_GFS_v16_RRTMGP.nml @@ -85,7 +85,7 @@ lw_file_gas = 'rrtmgp/data/rrtmgp-data-lw-g128-210809.nc' lw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-lw.nc' sw_file_gas = 'rrtmgp/data/rrtmgp-data-sw-g112-210809.nc' - sw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-sw.nc' + sw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-reordered-sw.nc' rrtmgp_nGptsSW = 112 rrtmgp_nGptsLW = 128 rrtmgp_nBandsLW = 16 diff --git a/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml b/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml index 43dcb8ee..8b6da35a 100644 --- a/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml +++ b/ccpp/physics_namelists/input_GFS_v16_RRTMGP_ps.nml @@ -85,7 +85,7 @@ lw_file_gas = 'rrtmgp/data/rrtmgp-data-lw-g128-210809.nc' lw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-lw.nc' sw_file_gas = 'rrtmgp/data/rrtmgp-data-sw-g112-210809.nc' - sw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-sw.nc' + sw_file_clouds = 'extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-reordered-sw.nc' rrtmgp_nGptsSW = 112 rrtmgp_nGptsLW = 128 rrtmgp_nBandsLW = 16 From 6181de95eee40626b8ca39928fee80dda61b0b24 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Mon, 12 Aug 2024 21:10:05 -0400 Subject: [PATCH 09/13] fix bug in scm_vgrid.F90 related to sing-prec changes --- scm/src/scm_vgrid.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm/src/scm_vgrid.F90 b/scm/src/scm_vgrid.F90 index e492824f..ca7a4ca6 100644 --- a/scm/src/scm_vgrid.F90 +++ b/scm/src/scm_vgrid.F90 @@ -553,7 +553,7 @@ subroutine get_FV3_vgrid(scm_input, scm_state) do k=1, km+1 pres_i(:,k) = scm_state%a_k(k) + scm_state%b_k(k)*p_ref scm_state%si(:,k) = scm_state%a_k(k)*pres_sfc_inv + scm_state%b_k(k) - scm_state%exner_i(:,k) = (scm_state%pres_i(:,k)/1.0E5)**con_rocp + scm_state%exner_i(:,k) = (pres_i(:,k)/1.0E5)**con_rocp end do scm_state%pres_i = pres_i From f0fc5dd83b97cde3812841b7bcd3ce3241305a3e Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 13 Aug 2024 11:01:33 -0400 Subject: [PATCH 10/13] fix bug in GFS_phys_time_vary.scm.F90 --- .gitmodules | 6 ++++-- ccpp/physics | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index dc0798c3..63cd7b3b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,8 +4,10 @@ branch = main [submodule "ccpp-physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = main + #url = https://github.com/NCAR/ccpp-physics + #branch = main + url = https://github.com/grantfirl/ccpp-physics + branch = CI_testing [submodule "CMakeModules"] path = CMakeModules url = https://github.com/noaa-emc/CMakeModules diff --git a/ccpp/physics b/ccpp/physics index 7506fd11..76541b67 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 7506fd110dbeefca83ecc6ecd7f50c0b4989694a +Subproject commit 76541b6782944fc2def4070a3b2c6bbff453d559 From d922f0bdfd571dae0343d900b50b6718ca1484df Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 13 Aug 2024 17:34:13 -0400 Subject: [PATCH 11/13] allow root for mpirun in Docker --- .github/workflows/ci_test_docker.yml | 2 +- docker/Dockerfile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_test_docker.yml b/.github/workflows/ci_test_docker.yml index b1dd5e74..55ab78b2 100644 --- a/.github/workflows/ci_test_docker.yml +++ b/.github/workflows/ci_test_docker.yml @@ -28,4 +28,4 @@ jobs: run: | mkdir $HOME/output chmod a+rw $HOME/output - docker run --rm -v $HOME/output:/home ${{ env.TEST_TAG }} ./run_scm.py -f ../../test/rt_test_cases.py --runtime_mult 0.1 -d + docker run --rm -v $HOME/output:/home ${{ env.TEST_TAG }} ./run_scm.py -f ../../test/rt_test_cases.py --runtime_mult 0.1 --mpi_command "mpirun -np 1 --allow-run-as-root" -d diff --git a/docker/Dockerfile b/docker/Dockerfile index f269fff5..97ced6d1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -102,9 +102,11 @@ RUN cd /comsoftware/ccpp-scm/ \ #USER comuser # Set working directory -WORKDIR /comsoftware/ccpp-scm/scm/bin +WORKDIR /comsoftware/ccpp-scm/ ENV SCM_WORK=/comsoftware ENV SCM_ROOT=/comsoftware/ccpp-scm/ # For interactive use, vim mouse settings are infuriating RUN echo "set mouse=" > ~/.vimrc + +ENTRYPOINT ["sh", "-c", "./contrib/get_aerosol_climo.sh && cd /comsoftware/ccpp-scm/scm/bin"] From b7b6b9f613d6c8b129da70e93a0406179c92bdc0 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 14 Aug 2024 10:04:38 -0400 Subject: [PATCH 12/13] download aerosol data before running nvidia RTs --- .github/workflows/ci_build_scm_ubuntu_22.04_nvidia.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci_build_scm_ubuntu_22.04_nvidia.yml b/.github/workflows/ci_build_scm_ubuntu_22.04_nvidia.yml index 6c1bb116..602263f0 100644 --- a/.github/workflows/ci_build_scm_ubuntu_22.04_nvidia.yml +++ b/.github/workflows/ci_build_scm_ubuntu_22.04_nvidia.yml @@ -291,10 +291,12 @@ jobs: make -j - name: Download data for SCM + if: contains(matrix.enable-gpu-acc, 'False') run: | cd ${SCM_ROOT} ./contrib/get_all_static_data.sh ./contrib/get_thompson_tables.sh + ./contrib/get_aerosol_climo.sh - name: Run SCM RTs (w/o GPU) if: contains(matrix.enable-gpu-acc, 'False') From 49bcc86cf4658206dc0a5b696ff3ba00d941f481 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 14 Aug 2024 13:40:05 -0400 Subject: [PATCH 13/13] update ccpp/physics after PR merge --- .gitmodules | 6 ++---- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 63cd7b3b..dc0798c3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,10 +4,8 @@ branch = main [submodule "ccpp-physics"] path = ccpp/physics - #url = https://github.com/NCAR/ccpp-physics - #branch = main - url = https://github.com/grantfirl/ccpp-physics - branch = CI_testing + url = https://github.com/NCAR/ccpp-physics + branch = main [submodule "CMakeModules"] path = CMakeModules url = https://github.com/noaa-emc/CMakeModules diff --git a/ccpp/physics b/ccpp/physics index 76541b67..f0fbb34a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 76541b6782944fc2def4070a3b2c6bbff453d559 +Subproject commit f0fbb34a350acac90e71de6e51351f78174eb8de