From d9e619ed4a5e685b3558e0b1bf6929880960864b Mon Sep 17 00:00:00 2001 From: mdtoyNOAA <73618848+mdtoyNOAA@users.noreply.github.com> Date: Wed, 22 Feb 2023 10:58:11 -0700 Subject: [PATCH 1/7] Changed UGWP diagnostic variable declaration intents from 'out' to 'inout' (#627) * Changed UGWP diagnostic variable declaration intents from 'out' to 'inout' * Updated UGWP diagnostic variable declaration intents in drag_suite.meta --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 336285206..235ef9675 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 336285206d19f06bde4b37a741ac9bc0e15f05e1 +Subproject commit 235ef9675ccc986876650afaa811111a91872bb6 From 78bfe9e7db7d9727961d76108cf52c89e67aba3c Mon Sep 17 00:00:00 2001 From: Jun Wang <37633869+junwang-noaa@users.noreply.github.com> Date: Mon, 27 Feb 2023 12:06:09 -0500 Subject: [PATCH 2/7] consistent Restart filenames (#625) * allow consisten restart file name with date * remove intrm_rst and restart_endfcst in fcst finalize * remove restart_endfcst from fcst grid comp --- atmos_model.F90 | 4 ++-- module_fcst_grid_comp.F90 | 44 +++++---------------------------------- module_fv3_config.F90 | 1 - 3 files changed, 7 insertions(+), 42 deletions(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index e6eea1b43..2a5091bd6 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -96,8 +96,7 @@ module atmos_model_mod DIAG_SIZE use fv_iau_mod, only: iau_external_data_type,getiauforcing,iau_initialize use module_fv3_config, only: output_1st_tstep_rst, first_kdt, nsout, & - restart_endfcst, output_fh, fcst_mpi_comm, & - fcst_ntasks + output_fh, fcst_mpi_comm, fcst_ntasks use module_block_data, only: block_atmos_copy, block_data_copy, & block_data_copy_or_fill, & block_data_combine_fractions @@ -178,6 +177,7 @@ module atmos_model_mod logical :: debug = .false. !logical :: debug = .true. logical :: sync = .false. +logical :: restart_endfcst = .false. real :: avg_max_length=3600. logical :: ignore_rst_cksum = .false. namelist /atmos_model_nml/ blocksize, chksum_debug, dycore_only, debug, sync, ccpp_suite, avg_max_length, & diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 0fc3fff42..c8df6acc0 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -65,7 +65,7 @@ module module_fcst_grid_comp nbdlphys, iau_offset use module_fv3_config, only: dt_atmos, fcst_mpi_comm, fcst_ntasks, & quilting, calendar, cpl_grid_id, & - cplprint_flag, restart_endfcst + cplprint_flag use get_stochy_pattern_mod, only: write_stoch_restart_atm use module_cplfields, only: nExportFields, exportFields, exportFieldsInfo, & @@ -73,7 +73,6 @@ module module_fcst_grid_comp use module_cplfields, only: realizeConnectedCplFields use atmos_model_mod, only: setup_exportdata - use CCPP_data, only: GFS_control ! !----------------------------------------------------------------------- ! @@ -90,7 +89,7 @@ module module_fcst_grid_comp type(ESMF_GridComp),dimension(:),allocatable :: fcstGridComp integer :: ngrids, mygrid - integer :: intrm_rst, n_atmsteps + integer :: n_atmsteps !----- coupled model data ----- @@ -744,20 +743,7 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc) endif endif ! if to write out restart at the end of forecast - restart_endfcst = .false. - if ( ANY(frestart(:) == total_inttime) ) restart_endfcst = .true. -! frestart only contains intermediate restart - do i=1,size(frestart) - if(frestart(i) == total_inttime) then - frestart(i) = 0 - exit - endif - enddo - if (mype == 0) print *,'frestart=',frestart(1:10)/3600, 'restart_endfcst=',restart_endfcst, & - 'total_inttime=',total_inttime -! if there is restart writing during integration - intrm_rst = 0 - if (frestart(1)>0) intrm_rst = 1 + if (mype == 0) print *,'frestart=',frestart(1:10)/3600, 'total_inttime=',total_inttime !------ initialize component models ------ @@ -1255,9 +1241,8 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return !--- intermediate restart - if (intrm_rst>0) then - call get_time(Atmos%Time - Atmos%Time_init, seconds) - if (ANY(frestart(:) == seconds)) then + call get_time(Atmos%Time - Atmos%Time_init, seconds) + if (ANY(frestart(:) == seconds)) then if (mype == 0) write(*,*)'write out restart at n_atmsteps=',n_atmsteps,' seconds=',seconds, & 'integration length=',n_atmsteps*dt_atmos/3600. @@ -1279,7 +1264,6 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc) 'Current model time: year, month, day, hour, minute, second' close( unit ) endif - endif endif if (mype == 0) write(*,'(A,I16,A,F16.6)')'PASS: fcstRUN phase 2, n_atmsteps = ', & @@ -1323,24 +1307,6 @@ subroutine fcst_finalize(fcst_comp, importState, exportState,clock,rc) call atmos_model_end (Atmos) -!*** write restart file - if( restart_endfcst ) then - call get_date (Atmos%Time, date(1), date(2), date(3), & - date(4), date(5), date(6)) - call mpp_set_current_pelist() - if (mpp_pe() == mpp_root_pe())then - open( newunit=unit, file='RESTART/coupler.res' ) - write( unit, '(i6,8x,a)' )calendar_type, & - '(Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)' - - write( unit, '(6i6,8x,a)' )date_init, & - 'Model start time: year, month, day, hour, minute, second' - write( unit, '(6i6,8x,a)' )date, & - 'Current model time: year, month, day, hour, minute, second' - close( unit ) - endif - endif - call diag_manager_end (Atmos%Time) call fms_end diff --git a/module_fv3_config.F90 b/module_fv3_config.F90 index bb3546772..a62800b34 100644 --- a/module_fv3_config.F90 +++ b/module_fv3_config.F90 @@ -20,7 +20,6 @@ module module_fv3_config integer :: cpl_grid_id logical :: cplprint_flag logical :: quilting, output_1st_tstep_rst - logical :: restart_endfcst ! real,dimension(:),allocatable :: output_fh character(esmf_maxstr),dimension(:),allocatable :: filename_base From c932926825c1729fa41d127f8e8115007047722d Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 2 Mar 2023 16:25:54 -0700 Subject: [PATCH 3/7] NCAR-main PR#956 (#623) * Merge pull request #67 from dustinswales/accumulated_cleanup: ccpp physocs --- ccpp/data/GFS_typedefs.F90 | 192 +++++++++++++++++++++++++++++------- ccpp/data/GFS_typedefs.meta | 149 +++++++++++++++++++++++++++- ccpp/physics | 2 +- 3 files changed, 303 insertions(+), 40 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 8dd562b14..0dac224ff 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -7,7 +7,9 @@ module GFS_typedefs con_epsm1, con_ttp, rlapse, con_jcal, con_rhw0, & con_sbc, con_tice, cimin, con_p0, rhowater, & con_csol, con_epsqs, con_rocp, con_rog, & - con_omega, con_rerth, con_psat, karman, rainmin + con_omega, con_rerth, con_psat, karman, rainmin,& + con_c, con_plnk, con_boltz, con_solr_2008, & + con_solr_2002, con_thgni use module_radsw_parameters, only: topfsw_type, sfcfsw_type use module_radlw_parameters, only: topflw_type, sfcflw_type @@ -718,6 +720,12 @@ module GFS_typedefs integer :: nrcm !< second dimension of random number stream for RAS integer :: iflip !< iflip - is not the same as flipv integer :: isol !< use prescribed solar constant + !< 0 => fixed value=1366.0\f$W/m^2\f$(old standard) + !< 10 => fixed value=1360.8\f$W/m^2\f$(new standard) + !< 1 => NOAA ABS-scale TSI table (yearly) w 11-yr cycle approx + !< 2 => NOAA TIM-scale TSI table (yearly) w 11-yr cycle approx + !< 3 => CMIP5 TIM-scale TSI table (yearly) w 11-yr cycle approx + !< 4 => CMIP5 TIM-scale TSI table (monthly) w 11-yr cycle approx integer :: ico2 !< prescribed global mean value (old opernl) integer :: ialb !< use climatology alb, based on sfc type !< 1 => use modis based alb @@ -725,11 +733,21 @@ module GFS_typedefs integer :: iems !< 1 => use fixed value of 1.0 !< 2 => use LSM emiss integer :: iaer !< default aerosol effect in sw only + integer :: iaermdl !< tropospheric aerosol model scheme flag + integer :: iaerflg !< aerosol effect control flag + character(len=26) :: aeros_file !< external file: aerosol data file + character(len=26) :: solar_file !< external file: solar constant data table + character(len=26) :: semis_file !< external file: surface emissivity data for radiation + character(len=26) :: co2dat_file !< external file: co2 monthly observation data table + character(len=26) :: co2gbl_file !< external file: co2 global annual mean data table + character(len=26) :: co2usr_file !< external file: co2 user defined data table + character(len=26) :: co2cyc_file !< external file: co2 climotological monthly cycle data + logical :: lalw1bd !< selects 1 band or multi bands for LW aerosol properties integer :: icliq_sw !< sw optical property for liquid clouds integer :: icice_sw !< sw optical property for ice clouds integer :: icliq_lw !< lw optical property for liquid clouds integer :: icice_lw !< lw optical property for ice clouds - integer :: iovr !< max-random overlap clouds for sw & lw (maximum of both) + integer :: iovr !< cloud-overlap used in cloud-sampling by radiation scheme(s) integer :: ictm !< ictm=0 => use data at initial cond time, if not !< available; use latest; no extrapolation. !< ictm=1 => use data at the forecast time, if not @@ -747,16 +765,25 @@ module GFS_typedefs !< =1 => sub-grid cloud with prescribed seeds !< =2 => sub-grid cloud with randomly generated !< seeds + integer :: iswmode !< SW control flag for scattering process approximation + !< =1 => two-stream delta-eddington (Joseph et al. 1976) + !< =2 => two-stream PIFM (Zdunkowski et al. 1980) + !< =3 => discrete ordinates (Liou, 1973) integer :: idcor !< Decorrelation length type for overlap assumption !< =0 => Use constant decorrelation length, decorr_con !< =1 => Use spatially varying decorrelation length (Hogan et al. 2010) !< =2 => Use spatially and temporally varyint decorrelation length (Oreopoulos et al. 2012) real(kind_phys) :: dcorr_con !< Decorrelation length constant (km) (if idcor = 0) - logical :: crick_proof !< CRICK-Proof cloud water - logical :: ccnorm !< Cloud condensate normalized by cloud cover - logical :: norad_precip !< radiation precip flag for Ferrier/Moorthi + logical :: lcrick !< CRICK-Proof cloud water + logical :: lcnorm !< Cloud condensate normalized by cloud cover + logical :: lnoprec !< radiation precip flag for Ferrier/Moorthi logical :: lwhtr !< flag to output lw heating rate (Radtend%lwhc) logical :: swhtr !< flag to output sw heating rate (Radtend%swhc) + integer :: rad_hr_units !< flag to control units of lw/sw heating rate + !< 1: K day-1 - 2: K s-1 + logical :: inc_minor_gas !< Include minor trace gases in RRTMG radiation calculation? + integer :: ipsd0 !< initial permutaion seed for mcica radiation + integer :: ipsdlim !< limit initial permutaion seed for mcica radiation logical :: lrseeds !< flag to use host-provided random seeds integer :: nrstreams !< number of random number streams in host-provided random seed array logical :: lextop !< flag for using an extra top layer for radiation @@ -809,24 +836,24 @@ module GFS_typedefs !< and if yes, perform them; hardcoded to .true. for now !--- new microphysical switch integer :: imp_physics !< choice of microphysics scheme - integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme - integer :: imp_physics_thompson = 8 !< choice of Thompson microphysics scheme - integer :: imp_physics_wsm6 = 6 !< choice of WSMG microphysics scheme - integer :: imp_physics_zhao_carr = 99 !< choice of Zhao-Carr microphysics scheme + integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme + integer :: imp_physics_thompson = 8 !< choice of Thompson microphysics scheme + integer :: imp_physics_wsm6 = 6 !< choice of WSMG microphysics scheme + integer :: imp_physics_zhao_carr = 99 !< choice of Zhao-Carr microphysics scheme integer :: imp_physics_zhao_carr_pdf = 98 !< choice of Zhao-Carr microphysics scheme with PDF clouds - integer :: imp_physics_mg = 10 !< choice of Morrison-Gettelman microphysics scheme - integer :: imp_physics_fer_hires = 15 !< choice of Ferrier-Aligo microphysics scheme - integer :: iovr_rand = 0 !< choice of cloud-overlap: random - integer :: iovr_maxrand = 1 !< choice of cloud-overlap: maximum random - integer :: iovr_max = 2 !< choice of cloud-overlap: maximum - integer :: iovr_dcorr = 3 !< choice of cloud-overlap: decorrelation length - integer :: iovr_exp = 4 !< choice of cloud-overlap: exponential - integer :: iovr_exprand = 5 !< choice of cloud-overlap: exponential random - integer :: idcor_con = 0 !< choice for decorrelation-length: Use constant value - integer :: idcor_hogan = 1 !< choice for decorrelation-length: (https://rmets.onlinelibrary.wiley.com/doi/full/10.1002/qj.647) - integer :: idcor_oreopoulos = 2 !< choice for decorrelation-length: (10.5194/acp-12-9097-2012) - integer :: imp_physics_nssl = 17 !< choice of NSSL microphysics scheme with background CCN - integer :: imp_physics_nssl2mccn = 18 !< choice of NSSL microphysics scheme with predicted CCN (compatibility) + integer :: imp_physics_mg = 10 !< choice of Morrison-Gettelman microphysics scheme + integer :: imp_physics_fer_hires = 15 !< choice of Ferrier-Aligo microphysics scheme + integer :: imp_physics_nssl = 17 !< choice of NSSL microphysics scheme with background CCN + integer :: imp_physics_nssl2mccn = 18 !< choice of NSSL microphysics scheme with predicted CCN (compatibility) + integer :: iovr_rand = 0 !< choice of cloud-overlap: random + integer :: iovr_maxrand = 1 !< choice of cloud-overlap: maximum random + integer :: iovr_max = 2 !< choice of cloud-overlap: maximum + integer :: iovr_dcorr = 3 !< choice of cloud-overlap: decorrelation length + integer :: iovr_exp = 4 !< choice of cloud-overlap: exponential + integer :: iovr_exprand = 5 !< choice of cloud-overlap: exponential random + integer :: idcor_con = 0 !< choice for decorrelation-length: Use constant value + integer :: idcor_hogan = 1 !< choice for decorrelation-length: (https://rmets.onlinelibrary.wiley.com/doi/full/10.1002/qj.647) + integer :: idcor_oreopoulos = 2 !< choice for decorrelation-length: (10.5194/acp-12-9097-2012) !--- Z-C microphysical parameters real(kind=kind_phys) :: psautco(2) !< [in] auto conversion coeff from ice to snow real(kind=kind_phys) :: prautco(2) !< [in] auto conversion coeff from cloud to rain @@ -2976,6 +3003,12 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & integer :: iccn = 0 !< logical to use IN CCN forcing for MG2/3 integer :: iflip = 1 !< iflip - is not the same as flipv integer :: isol = 0 !< use prescribed solar constant + !< 0 => fixed value=1366.0\f$W/m^2\f$(old standard) + !< 10 => fixed value=1360.8\f$W/m^2\f$(new standard) + !< 1 => NOAA ABS-scale TSI table (yearly) w 11-yr cycle approx + !< 2 => NOAA TIM-scale TSI table (yearly) w 11-yr cycle approx + !< 3 => CMIP5 TIM-scale TSI table (yearly) w 11-yr cycle approx + !< 4 => CMIP5 TIM-scale TSI table (monthly) w 11-yr cycle approx integer :: ico2 = 0 !< prescribed global mean value (old opernl) integer :: ialb = 0 !< use climatology alb, based on sfc type !< 1 => use modis based alb (RUC lsm) @@ -2983,11 +3016,32 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & integer :: iems = 0 !< 1.0 => Noah lsm !< 2.0 => Noah MP and RUC lsms integer :: iaer = 1 !< default aerosol effect in sw only + integer :: iaermdl = 0 !< default tropospheric aerosol model scheme flag + !< 0: seasonal global distributed OPAC aerosol climatology + !< 1: monthly global distributed GOCART aerosol climatology + !< 2: GOCART prognostic aerosol model + !< 5: OPAC climatoloy with new band mapping + integer :: iaerflg = 0 !< aerosol effect control flag + !< 3-digit flag 'abc': + !< a-stratospheric volcanic aerols + !< b-tropospheric aerosols for LW + !< c-tropospheric aerosols for SW + !< =0:aerosol effect is not included; =1:aerosol effect is included + logical :: lalw1bd = .false. !< selects 1 band or multi bands for LW aerosol properties + !< true.: aerosol properties calculated in 1 broad LW band + !< false.: aerosol properties calculated for each LW bands + character(len=26) :: aeros_file = 'aerosol.dat ' + character(len=26) :: solar_file = 'solarconstant_noaa_a0.txt ' + character(len=26) :: semis_file = 'sfc_emissivity_idx.txt ' + character(len=26) :: co2dat_file = 'co2historicaldata_2004.txt' + character(len=26) :: co2gbl_file = 'co2historicaldata_glob.txt' + character(len=26) :: co2usr_file = 'co2userdata.txt ' + character(len=26) :: co2cyc_file = 'co2monthlycyc.txt ' integer :: icliq_sw = 1 !< sw optical property for liquid clouds integer :: icice_sw = 3 !< sw optical property for ice clouds integer :: icliq_lw = 1 !< lw optical property for liquid clouds integer :: icice_lw = 3 !< lw optical property for ice clouds - integer :: iovr = 1 !< cloud-overlap: max-random overlap clouds + integer :: iovr = 1 !< cloud-overlap used in cloud-sampling by radiation scheme(s) integer :: ictm = 1 !< ictm=0 => use data at initial cond time, if not !< available; use latest; no extrapolation. !< ictm=1 => use data at the forecast time, if not @@ -3005,16 +3059,24 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< =1 => sub-grid cloud with prescribed seeds !< =2 => sub-grid cloud with randomly generated !< seeds + integer :: iswmode = 2 !< SW control flag for scattering process approximation + !< =1 => two-stream delta-eddington (Joseph et al. 1976) + !< =2 => two-stream PIFM (Zdunkowski et al. 1980) + !< =3 => discrete ordinates (Liou, 1973) integer :: idcor = 1 !< Decorrelation length type for overlap assumption !< =0 => Use constant decorrelation length, decorr_con !< =1 => Use spatially varying decorrelation length (Hogan et al. 2010) !< =2 => Use spatially and temporally varyint decorrelation length (Oreopoulos et al. 2012) real(kind_phys) :: dcorr_con = 2.5 !< Decorrelation length constant (km) (if idcor = 0) - logical :: crick_proof = .false. !< CRICK-Proof cloud water - logical :: ccnorm = .false. !< Cloud condensate normalized by cloud cover - logical :: norad_precip = .false. !< radiation precip flag for Ferrier/Moorthi + logical :: lcrick = .false. !< CRICK-Proof cloud water + logical :: lcnorm = .false. !< Cloud condensate normalized by cloud cover + logical :: lnoprec = .false. !< radiation precip flag for Ferrier/Moorthi logical :: lwhtr = .true. !< flag to output lw heating rate (Radtend%lwhc) logical :: swhtr = .true. !< flag to output sw heating rate (Radtend%swhc) + integer :: rad_hr_units = 2 !< heating rate units are K s-1 + logical :: inc_minor_gas = .true. !< Include minor trace gases in RRTMG radiation calculation + integer :: ipsd0 = 0 !< initial permutaion seed for mcica radiation + integer :: ipsdlim = 1e8 !< limit initial permutaion seed for mcica radiation logical :: lrseeds = .false. !< flag to use host-provided random seeds integer :: nrstreams = 2 !< number of random number streams in host-provided random seed array logical :: lextop = .false. !< flag for using an extra top layer for radiation @@ -3500,7 +3562,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- radiation parameters fhswr, fhlwr, levr, nfxr, iaerclm, iflip, isol, ico2, ialb, & isot, iems, iaer, icliq_sw, iovr, ictm, isubc_sw, & - isubc_lw, crick_proof, ccnorm, lwhtr, swhtr, & + isubc_lw, lcrick, lcnorm, lwhtr, swhtr, & nhfrad, idcor, dcorr_con, & ! --- RRTMGP do_RRTMGP, active_gases, nGases, rrtmgp_root, & @@ -3885,6 +3947,31 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & endif Model%levrp1 = Model%levr + 1 + if (isubc_sw < 0 .or. isubc_sw > 2) then + write(0,'(a,i0)') 'ERROR: shortwave cloud-sampling (isubc_sw) scheme selected not valid: ',isubc_sw + stop + endif + if (isubc_lw < 0 .or. isubc_lw > 2) then + write(0,'(a,i0)') 'ERROR: longwave cloud-sampling (isubc_lw) scheme selected not valid: ',isubc_lw + stop + endif + + + if ((iovr .ne. Model%iovr_rand) .and. (iovr .ne. Model%iovr_maxrand) .and. & + (iovr .ne. Model%iovr_max) .and. (iovr .ne. Model%iovr_dcorr) .and. & + (iovr .ne. Model%iovr_exp) .and. (iovr .ne. Model%iovr_exprand)) then + write(0,'(a,i0)') 'ERROR: cloud-overlap (iovr) scheme selected not valid: ',iovr + stop + endif + + if ((isubc_sw == 0 .or. isubc_lw == 0) .and. iovr > 2 ) then + if (me == 0) then + print *,' *** IOVR=',iovr,' is not available for ISUBC_SW(LW)=0 setting!!' + print *,' The program will use maximum/random overlap instead.' + endif + iovr = 1 + endif + Model%nfxr = nfxr Model%iccn = iccn ! further down: set Model%iccn to .false. @@ -3905,6 +3992,16 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & else ntrcaer = 1 endif + Model%lalw1bd = lalw1bd + Model%iaerflg = iaerflg + Model%iaermdl = iaermdl + Model%aeros_file = aeros_file + Model%solar_file = solar_file + Model%semis_file = semis_file + Model%co2dat_file = co2dat_file + Model%co2gbl_file = co2gbl_file + Model%co2usr_file = co2usr_file + Model%co2cyc_file = co2cyc_file Model%ntrcaer = ntrcaer Model%idcor = idcor Model%dcorr_con = dcorr_con @@ -3916,10 +4013,15 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%ictm = ictm Model%isubc_sw = isubc_sw Model%isubc_lw = isubc_lw - Model%crick_proof = crick_proof - Model%ccnorm = ccnorm + Model%iswmode = iswmode + Model%lcrick = lcrick + Model%lcnorm = lcnorm Model%lwhtr = lwhtr Model%swhtr = swhtr + Model%rad_hr_units = rad_hr_units + Model%inc_minor_gas = inc_minor_gas + Model%ipsd0 = ipsd0 + Model%ipsdlim = ipsdlim Model%lrseeds = lrseeds Model%nrstreams = nrstreams Model%lextop = (ltp > 0) @@ -4987,6 +5089,17 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%sec = 0 Model%yearlen = 365 Model%julian = -9999. + !--- Set vertical flag used by radiation schemes + Model%top_at_1 = .false. + if (Model%do_RRTMGP) then + if (Model%top_at_1) then + Model%iSFC = Model%levs + Model%iTOA = 1 + else + Model%iSFC = 1 + Model%iTOA = Model%levs + endif + endif !--- BEGIN CODE FROM GFS_PHYSICS_INITIALIZE !--- define physcons module variables @@ -5222,8 +5335,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & if (Model%do_cnvgwd) then print *,' Convective GWD parameterization used, do_cnvgwd=',Model%do_cnvgwd endif - if (Model%crick_proof) print *,' CRICK-Proof cloud water used in radiation ' - if (Model%ccnorm) print *,' Cloud condensate normalized by cloud cover for radiation' + if (Model%lcrick) print *,' CRICK-Proof cloud water used in radiation ' + if (Model%lcnorm) print *,' Cloud condensate normalized by cloud cover for radiation' if (Model%iovr == Model%iovr_rand) then print *,' random cloud overlap for Radiation IOVR=', Model%iovr elseif (Model%iovr == Model%iovr_dcorr) then @@ -5816,6 +5929,12 @@ subroutine control_print(Model) print *, ' ialb : ', Model%ialb print *, ' iems : ', Model%iems print *, ' iaer : ', Model%iaer + print *, ' iaermdl : ', Model%iaermdl + print *, ' iaerflg : ', Model%iaerflg + print *, ' lalw1bd : ', Model%lalw1bd + print *, ' aeros_file : ', Model%aeros_file + print *, ' solar_file : ', Model%solar_file + print *, ' semis_file : ', Model%semis_file print *, ' icliq_sw : ', Model%icliq_sw print *, ' icice_sw : ', Model%icice_sw print *, ' icliq_lw : ', Model%icliq_lw @@ -5826,11 +5945,16 @@ subroutine control_print(Model) print *, ' ictm : ', Model%ictm print *, ' isubc_sw : ', Model%isubc_sw print *, ' isubc_lw : ', Model%isubc_lw - print *, ' crick_proof : ', Model%crick_proof - print *, ' ccnorm : ', Model%ccnorm - print *, ' norad_precip : ', Model%norad_precip + print *, ' iswmode : ', Model%iswmode + print *, ' lcrick : ', Model%lcrick + print *, ' lcnorm : ', Model%lcnorm + print *, ' lnoprec : ', Model%lnoprec print *, ' lwhtr : ', Model%lwhtr print *, ' swhtr : ', Model%swhtr + print *, ' rad_hr_units : ', Model%rad_hr_units + print *, ' inc_minor_gas : ', Model%inc_minor_gas + print *, ' ipsd0 : ', Model%ipsd0 + print *, ' ipsdlim : ', Model%ipsdlim print *, ' lrseeds : ', Model%lrseeds print *, ' nrstreams : ', Model%nrstreams print *, ' lextop : ', Model%lextop diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index c41afa9fb..edbb1dbaa 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -3193,6 +3193,73 @@ units = flag dimensions = () type = integer +[iaermdl] + standard_name = control_for_aerosol_radiation_scheme + long_name = control of aerosol scheme in radiation + units = 1 + dimensions = () + type = integer +[iaerflg] + standard_name = control_for_aerosol_effects_in_radiation + long_name = control of aerosol effects in radiation + units = 1 + dimensions = () + type = integer +[lalw1bd] + standard_name = do_longwave_aerosol_band_properties + long_name = control of band or multiband longwave aerosol properties + units = 1 + dimensions = () + type = logical +[aeros_file] + standard_name = aerosol_data_file + long_name = aerosol data file + units = none + dimensions = () + type = character + kind = len=26 +[solar_file] + standard_name = solar_constant_file + long_name = external solar constant data table file + units = none + dimensions = () + type = character + kind = len=26 +[semis_file] + standard_name = surface_emissivity_data_file + long_name = surface emissivity data file for radiation + units = none + dimensions = () + type = character + kind = len=26 +[co2dat_file] + standard_name = co2_monthly_obs_data_table_file + long_name = co2 monthly observation data table + units = none + dimensions = () + type = character + kind = len=26 +[co2gbl_file] + standard_name = co2_global_annual_mean_data_table_file + long_name = co2 global annual mean data file + units = none + dimensions = () + type = character + kind = len=26 +[co2usr_file] + standard_name = co2_user_data_table_file + long_name = co2 user defined data table file + units = none + dimensions = () + type = character + kind = len=26 +[co2cyc_file] + standard_name = co2_clim_monthly_cycle_data_table_file + long_name = co2 climotological monthly cycle data table file + units = none + dimensions = () + type = character + kind = len=26 [icliq_sw] standard_name = control_for_shortwave_radiation_liquid_clouds long_name = sw optical property for liquid clouds @@ -3247,24 +3314,54 @@ units = flag dimensions = () type = integer -[crick_proof] +[iswmode] + standard_name = control_for_sw_scattering_choice + long_name = control of rrtmg shortwave scattering choice + units = 1 + dimensions = () + type = integer +[lcrick] standard_name = flag_for_CRICK_proof_cloud_water long_name = flag for CRICK-Proof cloud water units = flag dimensions = () type = logical -[ccnorm] +[lcnorm] standard_name = flag_for_in_cloud_condensate long_name = flag for cloud condensate normalized by cloud cover units = flag dimensions = () type = logical -[norad_precip] +[lnoprec] standard_name = flag_for_turning_off_precipitation_radiative_effect long_name = radiation precip flag for Ferrier/Moorthi units = flag dimensions = () type = logical +[rad_hr_units] + standard_name = control_for_radiation_heating_rate_units + long_name = control of heating rate units + units = 1 + dimensions = () + type = integer +[inc_minor_gas] + standard_name = flag_to_include_minor_gases_in_rrtmg + long_name = flag to include minor trace gases in rrtmg + units = flag + dimensions = () + type = logical +[ipsd0] + standard_name = initial_seed_for_mcica + long_name = initial permutaion seed for mcica radiation + units = 1 + dimensions = () + type = integer +[ipsdlim] + standard_name = limit_for_initial_seed_for_mcica + long_name = limit for initial permutaion seed for mcica radiation + units = 1 + dimensions = () + type = integer [lwhtr] standard_name = flag_for_output_of_tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep_assuming_clear_sky long_name = flag to output lw heating rate (Radtend%lwhc) @@ -3514,8 +3611,8 @@ type = real kind = kind_phys [top_at_1] - standard_name = flag_for_vertical_ordering_in_RRTMGP - long_name = flag for vertical ordering in RRTMGP + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation units = flag dimensions = () type = logical @@ -9131,3 +9228,45 @@ dimensions = () type = real kind = kind_phys +[con_c] + standard_name = speed_of_light_in_vacuum + long_name = speed of light in vacuum + units = m s-1 + dimensions = () + type = real + kind = kind_phys +[con_plnk] + standard_name = planck_constant + long_name = Planck constant + units = J s-1 + dimensions = () + type = real + kind = kind_phys +[con_boltz] + standard_name = boltzmann_constant + long_name = Boltzmann constant + units = J K-1 + dimensions = () + type = real + kind = kind_phys +[con_solr_2008] + standard_name = solar_constant_2008 + long_name = solar constant Tim 2008 + units = W m-2 + dimensions = () + type = real + kind = kind_phys +[con_solr_2002] + standard_name = solar_constant_2002 + long_name= solar constant Liu 2002 + units = W m-2 + dimensions = () + type = real + kind = kind_phys +[con_thgni] + standard_name = temperature_ice_nucleation_starts + long_name = temperature the H.G.Nuc. ice starts + units = K + dimensions = () + type = real + kind = kind_phys diff --git a/ccpp/physics b/ccpp/physics index 235ef9675..4a7560672 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 235ef9675ccc986876650afaa811111a91872bb6 +Subproject commit 4a7560672ec5011a1d41a3e165b8ef5033ff2346 From 841842846333801890cd3166c36581a6e9c2267b Mon Sep 17 00:00:00 2001 From: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com> Date: Tue, 7 Mar 2023 13:40:00 -0500 Subject: [PATCH 4/7] Allow HAFS app to be compiled with 64bit FMS (#626) --- moving_nest/fv_moving_nest.F90 | 4 ++++ moving_nest/fv_moving_nest_main.F90 | 4 ++++ moving_nest/fv_moving_nest_physics.F90 | 4 ++++ moving_nest/fv_moving_nest_utils.F90 | 4 ++++ moving_nest/fv_tracker.F90 | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/moving_nest/fv_moving_nest.F90 b/moving_nest/fv_moving_nest.F90 index 009f04b87..6ef5ab384 100644 --- a/moving_nest/fv_moving_nest.F90 +++ b/moving_nest/fv_moving_nest.F90 @@ -72,7 +72,11 @@ module fv_moving_nest_mod use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp use bounding_box_mod, only: bbox, bbox_get_C2F_index, fill_bbox +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: cp_air, omega, rdgas, grav, rvgas, kappa, pstd_mks, hlv +#else use constants_mod, only: cp_air, omega, rdgas, grav, rvgas, kappa, pstd_mks, hlv +#endif use field_manager_mod, only: MODEL_ATMOS use fv_arrays_mod, only: fv_atmos_type, fv_nest_type, fv_grid_type, R_GRID use fv_arrays_mod, only: allocate_fv_nest_bc_type, deallocate_fv_nest_bc_type diff --git a/moving_nest/fv_moving_nest_main.F90 b/moving_nest/fv_moving_nest_main.F90 index 4f1ce7aeb..34af608c2 100644 --- a/moving_nest/fv_moving_nest_main.F90 +++ b/moving_nest/fv_moving_nest_main.F90 @@ -33,7 +33,11 @@ module fv_moving_nest_main_mod ! FMS modules: !----------------- use block_control_mod, only: block_control_type +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks +#else use constants_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks +#endif use time_manager_mod, only: time_type, get_time, get_date, set_time, operator(+), & operator(-), operator(/), time_type_to_real use fms_mod, only: file_exist, open_namelist_file, & diff --git a/moving_nest/fv_moving_nest_physics.F90 b/moving_nest/fv_moving_nest_physics.F90 index 873964fa5..2dc6bce5b 100644 --- a/moving_nest/fv_moving_nest_physics.F90 +++ b/moving_nest/fv_moving_nest_physics.F90 @@ -68,7 +68,11 @@ module fv_moving_nest_physics_mod use GFS_init, only: GFS_grid_populate use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks, hlv +#else use constants_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks, hlv +#endif use field_manager_mod, only: MODEL_ATMOS use fv_arrays_mod, only: fv_atmos_type, fv_nest_type, fv_grid_type, R_GRID use fv_moving_nest_types_mod, only: fv_moving_nest_prog_type, fv_moving_nest_physics_type, mn_surface_grids, fv_moving_nest_type diff --git a/moving_nest/fv_moving_nest_utils.F90 b/moving_nest/fv_moving_nest_utils.F90 index 11485aa88..06136a2b1 100644 --- a/moving_nest/fv_moving_nest_utils.F90 +++ b/moving_nest/fv_moving_nest_utils.F90 @@ -67,7 +67,11 @@ module fv_moving_nest_utils_mod use IPD_typedefs, only: kind_phys => IPD_kind_phys #endif +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: grav +#else use constants_mod, only: grav +#endif use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp use bounding_box_mod, only: bbox, bbox_get_C2F_index, fill_bbox diff --git a/moving_nest/fv_tracker.F90 b/moving_nest/fv_tracker.F90 index 75c38217b..5cda9083f 100644 --- a/moving_nest/fv_tracker.F90 +++ b/moving_nest/fv_tracker.F90 @@ -26,7 +26,11 @@ module fv_tracker_mod #include +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: pi=>pi_8, rad_to_deg, deg_to_rad, RVGAS, RDGAS +#else use constants_mod, only: pi=>pi_8, rad_to_deg, deg_to_rad, RVGAS, RDGAS +#endif use fms_mod, only: mpp_clock_id, CLOCK_SUBCOMPONENT, clock_flag_default, & mpp_clock_begin, mpp_clock_end use time_manager_mod, only: time_type, get_time, set_time, operator(+), & From da1e9b81bba79466917d5c4a151225be227892ef Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 15 Mar 2023 15:40:43 -0400 Subject: [PATCH 5/7] Combo for ccpp/physics #41 and #45 and ccpp/framework submodule pointer update for #462 (#634) * add nssl_alphar, nssl_ehw0_in, nssl_ehlw0_in to namelist entries for ensemble perturbationsons * update the standard name for hail/graupel collection efficiency * update the long names for parameters related to NSSL microphysics * update ccpp/physics and ccpp/framework submodule pointers --------- Co-authored-by: Jili Dong --- ccpp/data/GFS_typedefs.F90 | 13 +++++++++++++ ccpp/data/GFS_typedefs.meta | 31 ++++++++++++++++++++++++++----- ccpp/framework | 2 +- ccpp/physics | 2 +- 4 files changed, 41 insertions(+), 7 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 0dac224ff..d950e39e6 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -911,6 +911,9 @@ module GFS_typedefs real(kind=kind_phys) :: nssl_cccn !< CCN concentration (m-3) real(kind=kind_phys) :: nssl_alphah !< graupel shape parameter real(kind=kind_phys) :: nssl_alphahl !< hail shape parameter + real(kind=kind_phys) :: nssl_alphar ! shape parameter for rain (imurain=1 only) + real(kind=kind_phys) :: nssl_ehw0_in ! constant or max assumed graupel-droplet collection efficiency + real(kind=kind_phys) :: nssl_ehlw0_in! constant or max assumed hail-droplet collection efficiency logical :: nssl_hail_on !< NSSL flag to activate the hail category logical :: nssl_ccn_on !< NSSL flag to activate the CCN category logical :: nssl_invertccn !< NSSL flag to treat CCN as activated (true) or unactivated (false) @@ -3162,6 +3165,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: nssl_cccn = 0.6e9 !< CCN concentration (m-3) real(kind=kind_phys) :: nssl_alphah = 0.0 !< graupel shape parameter real(kind=kind_phys) :: nssl_alphahl = 1.0 !< hail shape parameter + real(kind=kind_phys) :: nssl_alphar = 0.0 ! shape parameter for rain (imurain=1 only) + real(kind=kind_phys) :: nssl_ehw0_in = 0.9 ! constant or max assumed graupel-droplet collection efficiency + real(kind=kind_phys) :: nssl_ehlw0_in = 0.9 ! constant or max assumed hail-droplet collection efficiency logical :: nssl_hail_on = .false. !< NSSL flag to activate the hail category logical :: nssl_ccn_on = .true. !< NSSL flag to activate the CCN category logical :: nssl_invertccn = .true. !< NSSL flag to treat CCN as activated (true) or unactivated (false) @@ -3587,6 +3593,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ext_diag_thompson, dt_inner, lgfdlmprad, & sedi_semi, decfl, & nssl_cccn, nssl_alphah, nssl_alphahl, & + nssl_alphar, nssl_ehw0_in, nssl_ehlw0_in, & nssl_invertccn, nssl_hail_on, nssl_ccn_on, & !--- max hourly avg_max_length, & @@ -4161,6 +4168,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%nssl_cccn = nssl_cccn Model%nssl_alphah = nssl_alphah Model%nssl_alphahl = nssl_alphahl + Model%nssl_alphar = nssl_alphar + Model%nssl_ehw0_in = nssl_ehw0_in + Model%nssl_ehlw0_in = nssl_ehlw0_in Model%nssl_hail_on = nssl_hail_on Model%nssl_ccn_on = nssl_ccn_on Model%nssl_invertccn = nssl_invertccn @@ -6019,6 +6029,9 @@ subroutine control_print(Model) print *, ' nssl_cccn - CCCN background CCN conc. : ', Model%nssl_cccn print *, ' nssl_alphah - graupel shape parameter : ', Model%nssl_alphah print *, ' nssl_alphahl - hail shape parameter : ', Model%nssl_alphahl + print *, ' nssl_alphar - rain shape parameter : ', Model%nssl_alphar + print *, ' nssl_ehw0_in - graupel-droplet collection effiency : ', Model%nssl_ehw0_in + print *, ' nssl_ehlw0_in - hail-droplet collection effiency : ', Model%nssl_ehlw0_in print *, ' nssl_hail_on - hail activation flag : ', Model%nssl_hail_on print *, ' lradar - radar refl. flag : ', Model%lradar print *, ' lrefres : ', Model%lrefres diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index edbb1dbaa..f6a426c43 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -3935,33 +3935,54 @@ kind = kind_phys [nssl_alphah] standard_name = nssl_alpha_graupel - long_name = graupel PSD shape parameter in NSSL micro + long_name = graupel particle size distribution(PSD) shape parameter in NSSL microphysics scheme units = none dimensions = () type = real kind = kind_phys [nssl_alphahl] standard_name = nssl_alpha_hail - long_name = hail PSD shape parameter in NSSL micro + long_name = hail particle size distribution(PSD) shape parameter in NSSL microphysics scheme + units = none + dimensions = () + type = real + kind = kind_phys +[nssl_alphar] + standard_name = nssl_alpha_rain + long_name = rain particle size distribution(PSD) shape parameter in NSSL microphysics scheme + units = none + dimensions = () + type = real + kind = kind_phys +[nssl_ehw0_in] + standard_name = nssl_graupel_collection_efficiency + long_name = graupel droplet collection efficiency in NSSL microphysics scheme + units = none + dimensions = () + type = real + kind = kind_phys +[nssl_ehlw0_in] + standard_name = nssl_hail_collection_efficiency + long_name = hail droplet collection efficiency in NSSL microphysics scheme units = none dimensions = () type = real kind = kind_phys [nssl_ccn_on] standard_name = nssl_ccn_on - long_name = CCN activation flag in NSSL micro + long_name = CCN activation flag in NSSL microphysics scheme units = flag dimensions = () type = logical [nssl_hail_on] standard_name = nssl_hail_on - long_name = hail activation flag in NSSL micro + long_name = hail activation flag in NSSL microphysics scheme units = flag dimensions = () type = logical [nssl_invertccn] standard_name = nssl_invertccn - long_name = flag to invert CCN in NSSL micro + long_name = flag to invert CCN in NSSL microphysics scheme units = flag dimensions = () type = logical diff --git a/ccpp/framework b/ccpp/framework index 1b6352fb2..60295ad35 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 1b6352fb24f053b738bde72eed0ddf0b60ec7c0f +Subproject commit 60295ad3578ca01b5ca4214b91dd13bb790fbdfe diff --git a/ccpp/physics b/ccpp/physics index 4a7560672..630d37494 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 4a7560672ec5011a1d41a3e165b8ef5033ff2346 +Subproject commit 630d37494a9e32690131b0af0ea367886581ecba From 9247c903ddf908e05dc26d926233c4b69dc3dcac Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 31 Mar 2023 17:24:27 -0400 Subject: [PATCH 6/7] update .gitmodules --- .gitmodules | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6bb663df1..2327c3fae 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,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 = ufs-dev-PR53 [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP From a82ff9aef5b44b2d0e791d4e1686259f61bb91ad Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 6 Apr 2023 16:39:19 -0400 Subject: [PATCH 7/7] update .gitmodules and ccpp/physics pointer --- .gitmodules | 6 ++---- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 2327c3fae..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-PR53 + 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 9701e2d6f..1003d151d 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 9701e2d6f756d6746399094a07072bdec6a4b97e +Subproject commit 1003d151dcaf33698c6cbf5bad7e6d8ac4d9566a