From ba6e8ea442b2d0d5992a8550db6d0c720ff338d2 Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Mon, 4 Dec 2023 11:36:30 -0500 Subject: [PATCH 1/5] add 5 ccpp SDFs in support of RRFS multiphysics ensemble (#721) * add 5 ccpp SDFs in support of RRFS ensemble * add one more ccpp SDF for RRFS fire weather application by removing GWD in FV3_HRRR_gf --- ccpp/suites/suite_FV3_HRRR_gf_nogwd.xml | 84 ++++++++++++++++++++++++ ccpp/suites/suite_RRFSens_phy1.xml | 86 +++++++++++++++++++++++++ ccpp/suites/suite_RRFSens_phy2.xml | 83 ++++++++++++++++++++++++ ccpp/suites/suite_RRFSens_phy3.xml | 83 ++++++++++++++++++++++++ ccpp/suites/suite_RRFSens_phy4.xml | 84 ++++++++++++++++++++++++ ccpp/suites/suite_RRFSens_phy5.xml | 81 +++++++++++++++++++++++ 6 files changed, 501 insertions(+) create mode 100644 ccpp/suites/suite_FV3_HRRR_gf_nogwd.xml create mode 100644 ccpp/suites/suite_RRFSens_phy1.xml create mode 100644 ccpp/suites/suite_RRFSens_phy2.xml create mode 100644 ccpp/suites/suite_RRFSens_phy3.xml create mode 100644 ccpp/suites/suite_RRFSens_phy4.xml create mode 100644 ccpp/suites/suite_RRFSens_phy5.xml diff --git a/ccpp/suites/suite_FV3_HRRR_gf_nogwd.xml b/ccpp/suites/suite_FV3_HRRR_gf_nogwd.xml new file mode 100644 index 000000000..3e4b862c9 --- /dev/null +++ b/ccpp/suites/suite_FV3_HRRR_gf_nogwd.xml @@ -0,0 +1,84 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + rrfs_smoke_wrapper + mynnedmf_wrapper + rrfs_smoke_postpbl + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + cu_gf_driver_pre + cu_gf_driver + GFS_DCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + cu_gf_driver_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_RRFSens_phy1.xml b/ccpp/suites/suite_RRFSens_phy1.xml new file mode 100644 index 000000000..0cd4c47b8 --- /dev/null +++ b/ccpp/suites/suite_RRFSens_phy1.xml @@ -0,0 +1,86 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_ocean + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + drag_suite + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + cu_gf_driver_pre + cu_gf_driver + GFS_DCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + cu_gf_driver_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_RRFSens_phy2.xml b/ccpp/suites/suite_RRFSens_phy2.xml new file mode 100644 index 000000000..e1ecc7149 --- /dev/null +++ b/ccpp/suites/suite_RRFSens_phy2.xml @@ -0,0 +1,83 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + mynnedmf_wrapper + GFS_GWD_generic_pre + drag_suite + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_RRFSens_phy3.xml b/ccpp/suites/suite_RRFSens_phy3.xml new file mode 100644 index 000000000..85e7189bd --- /dev/null +++ b/ccpp/suites/suite_RRFSens_phy3.xml @@ -0,0 +1,83 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + mynnedmf_wrapper + GFS_GWD_generic_pre + drag_suite + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + cu_gf_driver_pre + cu_gf_driver + GFS_DCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_nssl + GFS_MP_generic_post + cu_gf_driver_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_RRFSens_phy4.xml b/ccpp/suites/suite_RRFSens_phy4.xml new file mode 100644 index 000000000..35c7b052f --- /dev/null +++ b/ccpp/suites/suite_RRFSens_phy4.xml @@ -0,0 +1,84 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_ocean + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + drag_suite + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + cu_gf_driver_pre + cu_gf_driver + GFS_DCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_nssl + GFS_MP_generic_post + cu_gf_driver_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_RRFSens_phy5.xml b/ccpp/suites/suite_RRFSens_phy5.xml new file mode 100644 index 000000000..26bb32584 --- /dev/null +++ b/ccpp/suites/suite_RRFSens_phy5.xml @@ -0,0 +1,81 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + mynnedmf_wrapper + GFS_GWD_generic_pre + drag_suite + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_nssl + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + From a82381c0b751a15e5343de5078ef836b2c444c89 Mon Sep 17 00:00:00 2001 From: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com> Date: Tue, 5 Dec 2023 15:13:13 -0500 Subject: [PATCH 2/5] Create 'coupler.res' log file in write grid comp. Explicitly specify chunk sizes in restart files (#726) * Write coupler.res log files from the write grid comp if quilting_restart is .true. * Explicitly specify chunk sizes in write_restart_netcdf --- io/module_write_restart_netcdf.F90 | 9 +++++- io/module_wrt_grid_comp.F90 | 50 ++++++++++++++++++++++++++---- module_fcst_grid_comp.F90 | 14 ++++----- 3 files changed, 59 insertions(+), 14 deletions(-) diff --git a/io/module_write_restart_netcdf.F90 b/io/module_write_restart_netcdf.F90 index ec46d6f23..2fd4c7732 100644 --- a/io/module_write_restart_netcdf.F90 +++ b/io/module_write_restart_netcdf.F90 @@ -79,7 +79,7 @@ subroutine write_restart_netcdf(wrtfb, filename, & integer :: dimid, dimtype integer :: im_dimid, im_p1_dimid, jm_dimid, jm_p1_dimid, time_dimid integer :: im_varid, im_p1_varid, jm_varid, jm_p1_varid, time_varid - integer, dimension(:), allocatable :: dimids_2d, dimids_3d + integer, dimension(:), allocatable :: dimids_2d, dimids_3d, chunksizes integer, dimension(:), allocatable :: varids, zaxis_dimids logical shuffle @@ -335,6 +335,7 @@ subroutine write_restart_netcdf(wrtfb, filename, & ! define variables if (rank == 2) then dimids_2d = [im_dimid,jm_dimid, time_dimid] + chunksizes = [im, jm, 1] if (typekind == ESMF_TYPEKIND_R4) then ncerr = nf90_def_var(ncid, trim(fldName), NF90_FLOAT, dimids_2d, varids(i)); NC_ERR_STOP(ncerr) else if (typekind == ESMF_TYPEKIND_R8) then @@ -346,13 +347,17 @@ subroutine write_restart_netcdf(wrtfb, filename, & else if (rank == 3) then if ( .not.is_restart_core ) then dimids_3d = [im_dimid,jm_dimid,zaxis_dimids(i),time_dimid] + chunksizes = [im, jm, 1, 1] else if (staggerloc == ESMF_STAGGERLOC_CENTER) then dimids_3d = [im_dimid,jm_dimid,zaxis_dimids(i),time_dimid] + chunksizes = [im, jm, 1, 1] else if (staggerloc == ESMF_STAGGERLOC_EDGE1) then ! east dimids_3d = [im_p1_dimid,jm_dimid,zaxis_dimids(i),time_dimid] + chunksizes = [im+1, jm, 1, 1] else if (staggerloc == ESMF_STAGGERLOC_EDGE2) then ! south dimids_3d = [im_dimid,jm_p1_dimid,zaxis_dimids(i),time_dimid] + chunksizes = [im, jm+1, 1, 1] else if (mype==0) write(0,*)'Unsupported staggerloc ', staggerloc call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -374,6 +379,8 @@ subroutine write_restart_netcdf(wrtfb, filename, & ncerr = nf90_var_par_access(ncid, varids(i), par_access); NC_ERR_STOP(ncerr) end if + ncerr = nf90_def_var_chunking(ncid, varids(i), NF90_CHUNKED, chunksizes) ; NC_ERR_STOP(ncerr) + if (zstandard_level(1) > 0) then ncerr = nf90_def_var_zstandard(ncid, varids(i), zstandard_level(1)) if (ncerr /= nf90_noerr) then diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index bcca85ab4..b59fe5e45 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -44,7 +44,7 @@ module module_wrt_grid_comp stdlat1, stdlat2, dx, dy, iau_offset, & ideflate, zstandard_level, lflname_fulltime use module_write_netcdf, only : write_netcdf - use module_write_restart_netcdf + use module_write_restart_netcdf, only : write_restart_netcdf use physcons, only : pi => con_pi #ifdef INLINE_POST use post_fv3, only : post_run_fv3 @@ -68,10 +68,11 @@ module module_wrt_grid_comp integer,save :: ngrids integer,save :: wrt_mpi_comm !<-- the mpi communicator in the write comp - integer,save :: idate(7) + integer,save :: idate(7), start_time(7) logical,save :: write_nsflip logical,save :: change_wrtidate=.false. integer,save :: frestart(999) = -1 + integer,save :: calendar_type = 3 logical :: lprnt ! !----------------------------------------------------------------------- @@ -840,6 +841,7 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock, h=idate(4), m=idate(5), s=idate(6),rc=rc) ! if (lprnt) write(0,*) 'in wrt initial, io_baseline time=',idate,'rc=',rc idate(7) = 1 + start_time = idate wrt_int_state%idate = idate wrt_int_state%fdate = idate ! update IO-BASETIME and idate on write grid comp when IAU is enabled @@ -1333,8 +1335,27 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock, if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return +! save calendar_type (as integer) for use in 'coupler.res' + if (index(trim(attNameList(i)),'time:calendar') > 0) then + select case( uppercase(trim(valueS)) ) + case( 'JULIAN' ) + calendar_type = JULIAN + case( 'GREGORIAN' ) + calendar_type = GREGORIAN + case( 'NOLEAP' ) + calendar_type = NOLEAP + case( 'THIRTY_DAY' ) + calendar_type = THIRTY_DAY_MONTHS + case( 'NO_CALENDAR' ) + calendar_type = NO_CALENDAR + case default + call mpp_error ( FATAL, 'fcst_initialize: calendar must be one of '// & + 'JULIAN|GREGORIAN|NOLEAP|THIRTY_DAY|NO_CALENDAR.' ) + end select + endif + ! update the time:units when idate on write grid component is changed - if ( index(trim(attNameList(i)),'time:units')>0) then + if (index(trim(attNameList(i)),'time:units') > 0) then if ( change_wrtidate ) then idx = index(trim(valueS),' since ') if(lprnt) print *,'in write grid comp, time:unit=',trim(valueS) @@ -1795,7 +1816,7 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) logical :: use_parallel_netcdf real, allocatable :: output_fh(:) - logical :: is_restart_bundle + logical :: is_restart_bundle, restart_written integer :: tileCount ! !----------------------------------------------------------------------- @@ -2151,6 +2172,8 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) ! if (lprnt) write(0,*)'wrt_run: loop over wrt_int_state%FBCount ',wrt_int_state%FBCount, ' nfhour ', nfhour, ' cdate ', cdate(1:6) two_phase_loop: do out_phase = 1, 2 + + restart_written = .false. file_loop_all: do nbdl=1, wrt_int_state%FBCount call ESMF_FieldBundleGet(wrt_int_state%wrtFB(nbdl), name=wrtFBName, rc=rc) @@ -2349,6 +2372,8 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) rc) endif ! cubed sphere vs. regional/nest write grid + restart_written = .true. + else ! history bundle if (trim(output_grid(grid_id)) == 'cubed_sphere_grid') then @@ -2413,13 +2438,26 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) enddo file_loop_all if (out_phase == 1 .and. mype == lead_write_task) then - !** write out log file - open(newunit=nolog,file='log.atm.f'//trim(cfhour),form='FORMATTED') + !** write history log file + open(newunit=nolog, file='log.atm.f'//trim(cfhour)) write(nolog,"('completed: fv3atm')") write(nolog,"('forecast hour: ',f10.3)") nfhour write(nolog,"('valid time: ',6(i4,2x))") wrt_int_state%fdate(1:6) close(nolog) endif + + if (out_phase == 2 .and. restart_written .and. mype == lead_write_task) then + !** write coupler.res log file + open(newunit=nolog, file='RESTART/'//trim(time_restart)//'.coupler.res', status='new') + write(nolog,"(i6,8x,a)") calendar_type , & + '(Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)' + write(nolog,"(6i6,8x,a)") start_time(1:6), & + 'Model start time: year, month, day, hour, minute, second' + write(nolog,"(6i6,8x,a)") wrt_int_state%fdate(1:6), & + 'Current model time: year, month, day, hour, minute, second' + close(nolog) + endif + enddo two_phase_loop endif ! if ( wrt_int_state%output_history ) diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 4bc7bfe52..ea622369c 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -921,11 +921,11 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc) ! Add time Attribute to the exportState call ESMF_AttributeAdd(exportState, convention="NetCDF", purpose="FV3", & attrList=(/ "time ", & - "time:long_name ", & - "time:units ", & - "time:cartesian_axis", & - "time:calendar_type ", & - "time:calendar " /), rc=rc) + "time:long_name ", & + "time:units ", & + "time:cartesian_axis", & + "time:calendar_type ", & + "time:calendar " /), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return call ESMF_AttributeSet(exportState, convention="NetCDF", purpose="FV3", & @@ -1366,8 +1366,8 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc) call atmos_model_restart(Atmos, timestamp) call write_stoch_restart_atm('RESTART/'//trim(timestamp)//'.atm_stoch.res.nc') - !----- write restart file ------ - if (mpp_pe() == mpp_root_pe())then + !----- write coupler.res file ------ + if (.not. quilting_restart .and. mpp_pe() == mpp_root_pe()) then call get_date (Atmos%Time, date(1), date(2), date(3), date(4), date(5), date(6)) open( newunit=unit, file='RESTART/'//trim(timestamp)//'.coupler.res' ) write( unit, '(i6,8x,a)' )calendar_type, & From f221fc5ce66cee86160efa4bc4deb9c861959e19 Mon Sep 17 00:00:00 2001 From: "Samuel Trahan (NOAA contractor)" <39415369+SamuelTrahanNOAA@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:39:28 -0500 Subject: [PATCH 3/5] bug fix: disable concurrency in GFS_phys_time_vary_init NetCDF calls (#735) * Remove nfhout, nfhout_hf, nsout * Do not open 'coupler.res' file with status 'new' * bug fix: no concurrent NetCDF calls in GFS_phys_time_vary_init --------- Co-authored-by: Dusan Jovic --- atmos_model.F90 | 4 +- ccpp/physics | 2 +- fv3_cap.F90 | 73 ++----------------------------------- io/module_fv3_io_def.F90 | 2 +- io/module_wrt_grid_comp.F90 | 5 +-- module_fv3_config.F90 | 2 +- 6 files changed, 10 insertions(+), 78 deletions(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index 25cc61a88..7105f6997 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -101,7 +101,7 @@ module atmos_model_mod use fv_ufs_restart_io_mod, only: fv_dyn_restart_register, & fv_dyn_restart_output use fv_iau_mod, only: iau_external_data_type,getiauforcing,iau_initialize -use module_fv3_config, only: first_kdt, nsout, output_fh, & +use module_fv3_config, only: first_kdt, output_fh, & fcst_mpi_comm, fcst_ntasks, & quilting_restart use module_block_data, only: block_atmos_copy, block_data_copy, & @@ -976,7 +976,7 @@ subroutine update_atmos_model_state (Atmos, rc) call get_time (Atmos%Time - diag_time, isec) call get_time (Atmos%Time - Atmos%Time_init, seconds) call atmosphere_nggps_diag(Atmos%Time,ltavg=.true.,avg_max_length=avg_max_length) - if (ANY(nint(output_fh(:)*3600.0) == seconds) .or. (GFS_control%kdt == first_kdt) .or. nsout > 0) then + if (ANY(nint(output_fh(:)*3600.0) == seconds) .or. (GFS_control%kdt == first_kdt)) then if (mpp_pe() == mpp_root_pe()) write(6,*) "---isec,seconds",isec,seconds time_int = real(isec) if(Atmos%iau_offset > zero) then diff --git a/ccpp/physics b/ccpp/physics index c0aa212db..ed7e015b4 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c0aa212dbc255ac5d77934c3cd6283c994bbfd99 +Subproject commit ed7e015b483a14fc7ae9bf9d0f0cc3d26c517f7e diff --git a/fv3_cap.F90 b/fv3_cap.F90 index ada73a861..5401e66a5 100644 --- a/fv3_cap.F90 +++ b/fv3_cap.F90 @@ -28,7 +28,7 @@ module fv3atm_cap_mod NUOPC_ModelGet ! use module_fv3_config, only: quilting, quilting_restart, output_fh, & - nfhout, nfhout_hf, nsout, dt_atmos, & + dt_atmos, & calendar, cpl_grid_id, & cplprint_flag, first_kdt @@ -36,7 +36,7 @@ module fv3atm_cap_mod num_files, filename_base, & wrttasks_per_group, n_group, & lead_wrttask, last_wrttask, & - nsout_io, iau_offset, lflname_fulltime, & + iau_offset, lflname_fulltime, & time_unlimited ! use module_fcst_grid_comp, only: fcstSS => SetServices @@ -301,7 +301,6 @@ subroutine InitializeAdvertise(gcomp, rc) if(mype == 0) print *,'af ufs config,quilting=',quilting,' calendar=', trim(calendar),' iau_offset=',iau_offset, & ' noutput_fh=',noutput_fh ! - nfhout = 0 ; nfhmax_hf = 0 ; nfhout_hf = 0 ; nsout = 0 if ( quilting ) then call ESMF_ConfigGetAttribute(config=CF,value=use_saved_routehandles, & label ='use_saved_routehandles:', & @@ -334,15 +333,6 @@ subroutine InitializeAdvertise(gcomp, rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return enddo -! variables for output - call ESMF_ConfigGetAttribute(config=CF, value=nfhout, label ='nfhout:', default=-1,rc=rc) - call ESMF_ConfigGetAttribute(config=CF, value=nfhmax_hf,label ='nfhmax_hf:',default=-1,rc=rc) - call ESMF_ConfigGetAttribute(config=CF, value=nfhout_hf,label ='nfhout_hf:',default=-1,rc=rc) - call ESMF_ConfigGetAttribute(config=CF, value=nsout, label ='nsout:', default=-1,rc=rc) - nsout_io = nsout -! - if(mype==0) print *,'af ufs config,nfhout,nsout=',nfhout,nfhmax_hf,nfhout_hf, nsout,noutput_fh - call ESMF_ConfigGetAttribute(config=CF, value=time_unlimited, label ='time_unlimited:', default=.false., rc=rc) endif ! quilting @@ -819,64 +809,7 @@ subroutine InitializeAdvertise(gcomp, rc) if(iau_offset > 0) then output_startfh = iau_offset endif - if(mype==0) print *,'in fv3 cap init, output_startfh=',output_startfh,'nsout=',nsout, & - 'iau_offset=',iau_offset,'nfhmax_hf=',nfhmax_hf,'nfhout_hf=',nfhout_hf, & - 'nfhout=',nfhout -! -!--- set up output_fh with output forecast hours -! if the run does not have iau, it will have output after first step integration as fh00 -! if the run has iau, it will start output at fh=00 at the cycle time (usually StartTime+IAU_offsetTI) - if(nsout > 0) then -!--- use nsout for output frequency nsout*dt_atmos - nfh = 0 - if( nfhmax > output_startfh ) nfh = nint((nfhmax-output_startfh)/(nsout*dt_atmos/3600.))+1 - if(nfh >0) then - allocate(output_fh(nfh)) - if( output_startfh == 0) then - output_fh(1) = dt_atmos/3600. - else - output_fh(1) = output_startfh - endif - do i=2,nfh - output_fh(i) = (i-1)*nsout*dt_atmos/3600. + output_startfh - enddo - endif - elseif (nfhmax_hf > 0 ) then -!--- use high frequency output and low frequency for output forecast time - nfh = 0 - if( nfhout_hf>0 .and. nfhmax_hf>output_startfh) nfh = nint((nfhmax_hf-output_startfh)/nfhout_hf)+1 - nfh2 = 0 - if( nfhout>0 .and. nfhmax>nfhmax_hf) nfh2 = nint((nfhmax-nfhmax_hf)/nfhout) - if( nfh+nfh2 > 0) then - allocate(output_fh(nfh+nfh2)) - if( output_startfh == 0) then - output_fh(1) = dt_atmos/3600. - else - output_fh(1) = output_startfh - endif - do i=2,nfh - output_fh(i) = (i-1)*nfhout_hf + output_startfh - enddo - do i=1,nfh2 - output_fh(nfh+i) = nfhmax_hf + i*nfhout - enddo - endif - elseif (nfhout > 0 ) then -!--- use one output freqency - nfh = 0 - if( nfhout > 0 .and. nfhmax>output_startfh) nfh = nint((nfhmax-output_startfh)/nfhout) + 1 - if( nfh > 0 ) then - allocate(output_fh(nfh)) - if( output_startfh == 0) then - output_fh(1) = dt_atmos/3600. - else - output_fh(1) = output_startfh - endif - do i=2,nfh - output_fh(i) = (i-1)*nfhout + output_startfh - enddo - endif - endif + if(mype==0) print *,'in fv3 cap init, output_startfh=',output_startfh,' iau_offset=',iau_offset ! !----------------------------------------------------------------------- !*** SET THE FIRST WRITE GROUP AS THE FIRST ONE TO ACT. diff --git a/io/module_fv3_io_def.F90 b/io/module_fv3_io_def.F90 index 2689ef1c2..dfef37500 100644 --- a/io/module_fv3_io_def.F90 +++ b/io/module_fv3_io_def.F90 @@ -15,7 +15,7 @@ module module_fv3_io_def integer :: n_group integer :: num_files integer :: nbdlphys - integer :: nsout_io, iau_offset + integer :: iau_offset logical :: lflname_fulltime logical :: time_unlimited diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index b59fe5e45..e409788ab 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -38,7 +38,6 @@ module module_wrt_grid_comp imo,jmo,ichunk2d,jchunk2d, & ichunk3d,jchunk3d,kchunk3d, & quantize_mode,quantize_nsd, & - nsout => nsout_io, & cen_lon, cen_lat, & lon1, lat1, lon2, lat2, dlon, dlat, & stdlat1, stdlat2, dx, dy, iau_offset, & @@ -1876,7 +1875,7 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) if (nf_hours < 0) return - if (nsout > 0 .or. lflname_fulltime) then + if (lflname_fulltime) then ndig = max(log10(nf_hours+0.5)+1., 3.) write(cform, '("(I",I1,".",I1,",A1,I2.2,A1,I2.2)")') ndig, ndig write(cfhour, cform) nf_hours,'-',nf_minutes,'-',nf_seconds @@ -2448,7 +2447,7 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) if (out_phase == 2 .and. restart_written .and. mype == lead_write_task) then !** write coupler.res log file - open(newunit=nolog, file='RESTART/'//trim(time_restart)//'.coupler.res', status='new') + open(newunit=nolog, file='RESTART/'//trim(time_restart)//'.coupler.res') write(nolog,"(i6,8x,a)") calendar_type , & '(Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)' write(nolog,"(6i6,8x,a)") start_time(1:6), & diff --git a/module_fv3_config.F90 b/module_fv3_config.F90 index aac606a5e..7e82c8e24 100644 --- a/module_fv3_config.F90 +++ b/module_fv3_config.F90 @@ -13,7 +13,7 @@ module module_fv3_config implicit none ! - integer :: nfhout, nfhout_hf, nsout, dt_atmos + integer :: dt_atmos integer :: first_kdt integer :: fcst_mpi_comm, fcst_ntasks ! From 87a0ccae64b180d6b45d6f50fa55718d8ff26ede Mon Sep 17 00:00:00 2001 From: "Samuel Trahan (NOAA contractor)" <39415369+SamuelTrahanNOAA@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:46:46 -0500 Subject: [PATCH 4/5] pressure is not density and weasdi is not snodi + #739 and #742 (#736) * pressure is not density * wrong variable sent for snodi * explain lakedepth corruption safeguards * module_sf_ruclsm.f90: explain the snow_mosaic=0 line * add flag to track new freezing lake ice grids * change name of lake_freeze to flag_lakefreeze --------- Co-authored-by: Jili Dong --- ccpp/data/CCPP_typedefs.F90 | 3 +++ ccpp/data/CCPP_typedefs.meta | 6 ++++++ ccpp/driver/GFS_diagnostics.F90 | 4 ++-- ccpp/physics | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ccpp/data/CCPP_typedefs.F90 b/ccpp/data/CCPP_typedefs.F90 index a7da2eca9..7d9351337 100644 --- a/ccpp/data/CCPP_typedefs.F90 +++ b/ccpp/data/CCPP_typedefs.F90 @@ -140,6 +140,7 @@ module CCPP_typedefs logical, pointer :: flag_cice(:) => null() !< logical, pointer :: flag_guess(:) => null() !< logical, pointer :: flag_iter(:) => null() !< + logical, pointer :: flag_lakefreeze(:) => null() !< real (kind=kind_phys), pointer :: ffmm_ice(:) => null() !< real (kind=kind_phys), pointer :: ffmm_land(:) => null() !< real (kind=kind_phys), pointer :: ffmm_water(:) => null() !< @@ -607,6 +608,7 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model) allocate (Interstitial%flag_cice (IM)) allocate (Interstitial%flag_guess (IM)) allocate (Interstitial%flag_iter (IM)) + allocate (Interstitial%flag_lakefreeze (IM)) allocate (Interstitial%ffmm_ice (IM)) allocate (Interstitial%ffmm_land (IM)) allocate (Interstitial%ffmm_water (IM)) @@ -1297,6 +1299,7 @@ subroutine gfs_interstitial_phys_reset (Interstitial, Model) Interstitial%flag_cice = .false. Interstitial%flag_guess = .false. Interstitial%flag_iter = .true. + Interstitial%flag_lakefreeze = .false. Interstitial%ffmm_ice = Model%huge Interstitial%ffmm_land = Model%huge Interstitial%ffmm_water = Model%huge diff --git a/ccpp/data/CCPP_typedefs.meta b/ccpp/data/CCPP_typedefs.meta index 3ecb69be7..428970f2d 100644 --- a/ccpp/data/CCPP_typedefs.meta +++ b/ccpp/data/CCPP_typedefs.meta @@ -890,6 +890,12 @@ units = flag dimensions = (horizontal_loop_extent) type = logical +[flag_lakefreeze] + standard_name = flag_for_lake_water_freeze + long_name = flag for lake water freeze + units = flag + dimensions = (horizontal_loop_extent) + type = logical [ffmm_water] standard_name = Monin_Obukhov_similarity_function_for_momentum_over_water long_name = Monin-Obukhov similarity function for momentum over water diff --git a/ccpp/driver/GFS_diagnostics.F90 b/ccpp/driver/GFS_diagnostics.F90 index 42b1d1d66..f7f6d0caf 100644 --- a/ccpp/driver/GFS_diagnostics.F90 +++ b/ccpp/driver/GFS_diagnostics.F90 @@ -4005,12 +4005,12 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop idx = idx + 1 ExtDiag(idx)%axes = 2 ExtDiag(idx)%name = 'snodi' - ExtDiag(idx)%desc = 'water equivalent snow depth over ice' + ExtDiag(idx)%desc = 'snow depth over ice' ExtDiag(idx)%unit = 'mm' ExtDiag(idx)%mod_name = 'gfs_sfc' allocate (ExtDiag(idx)%data(nblks)) do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => sfcprop(nb)%weasdi(:) + ExtDiag(idx)%data(nb)%var2 => sfcprop(nb)%snodi(:) enddo idx = idx + 1 diff --git a/ccpp/physics b/ccpp/physics index ed7e015b4..0cdfc9d74 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ed7e015b483a14fc7ae9bf9d0f0cc3d26c517f7e +Subproject commit 0cdfc9d7465358debb4de292861fef970b44874a From a597eaa6a03af8702197414f5f9dac2faacc11dc Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 12 Mar 2024 10:31:46 -0400 Subject: [PATCH 5/5] update ccpp/physics and .gitmodules --- .gitmodules | 6 ++---- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 1fb2cd1bd..6bb663df1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,10 +8,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 = ufs-dev-PR139 + url = https://github.com/NCAR/ccpp-physics + branch = main [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index d6498f6eb..5c2d490b8 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d6498f6eb0b8a969bfe17e138f98c6c3400b68a4 +Subproject commit 5c2d490b888aecb7b6ac0021007d0ce58a4d1c20