Skip to content

Commit

Permalink
Merge singhbalwinder/atm/nlist-params-for-av1c-05 (PR #1035)
Browse files Browse the repository at this point in the history
    The PR adds support for next atmospheric compset (FC5AV1C-05) which is in works at
    this point. clubb_intr.F90 is modified so that changes remain BFB. Wind gustiness
    parameterization is implemented.  A few namelist parameters are added
    which will assist in the tuning of FC5AV1C-05 compset.

    Following is the list of namelist parameters:
    1. cld_sed : scale factor for cloud sedimentation velocity
    2. clubb_tk1 and clubb_tk2 : temperature thresholds determining the
       fraction of condensate detrained from ZM as ice
    3. clubb_wpxp_L_thresh : Lscale threshold: damp C6 & C7 [m]
    4. gust_fac : wind gustiness factor

    All these changes are BFB except for clubb_tk1 and clubb_tk2 change.
    This changes answers but it should be at the round-off level

    [non-BFB]
    [NML]
  • Loading branch information
wlin7 committed Sep 6, 2016
2 parents f9c23f4 + 2c9fa44 commit 9bbfad5
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 10 deletions.
1 change: 1 addition & 0 deletions driver_cpl/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ add_default($nl, 'bfbflag', 'BFBFLAG'=>"$xmlvars{'BFBFLAG'}");
add_default($nl, 'do_budgets','BUDGETS'=>"$xmlvars{'BUDGETS'}");

add_default($nl, 'flux_diurnal');
add_default($nl, 'gust_fac');
add_default($nl, 'flux_albav');
add_default($nl, 'flux_epbal');
add_default($nl, 'info_debug');
Expand Down
1 change: 1 addition & 0 deletions driver_cpl/bld/namelist_files/namelist_defaults_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
<wall_time_limit>-1.0</wall_time_limit>
<force_stop_at>month</force_stop_at>
<flux_diurnal>.false.</flux_diurnal>
<gust_fac>0.0D0</gust_fac>

<run_barriers COMP_RUN_BARRIERS="TRUE">.true.</run_barriers>
<run_barriers COMP_RUN_BARRIERS="FALSE">.false.</run_barriers>
Expand Down
10 changes: 10 additions & 0 deletions driver_cpl/bld/namelist_files/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,16 @@ If true, turn on diurnal cycle in computing atm/ocn fluxes
default: false
</entry>

<entry
id="gust_fac"
type="real"
category="control"
group="seq_infodata_inparm">
wind gustiness factor
default: 0.0D0
</entry>


<entry
id="atm_gnam"
type="char*64"
Expand Down
22 changes: 17 additions & 5 deletions driver_cpl/driver/seq_flux_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ module seq_flux_mct
real(r8), allocatable :: swdn (:) ! short wave, downward
real(r8), allocatable :: swup (:) ! short wave, upward
real(r8), allocatable :: prec (:) ! precip
real(r8), allocatable :: prec_gust (:) ! atm precip for convective gustiness (kg/m^3)


! Diurnal cycle variables wrt flux

Expand Down Expand Up @@ -285,6 +287,10 @@ subroutine seq_flux_init_mct(comp, fractions)
allocate(prec(nloc),stat=ier)
if(ier/=0) call mct_die(subName,'allocate prec',ier)
prec = 0.0_r8
allocate(prec_gust(nloc),stat=ier)
if(ier/=0) call mct_die(subName,'allocate prec_gust',ier)
prec_gust = 0.0_r8

allocate(fswpen(nloc),stat=ier)
if(ier/=0) call mct_die(subName,'allocate fswpen',ier)
fswpen = 0.0_r8
Expand Down Expand Up @@ -843,6 +849,7 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o
integer(in) :: index_sumwt
integer(in) :: atm_nx,atm_ny,ocn_nx,ocn_ny
real(r8) :: wt
real(r8) :: gust_fac = huge(1.0_r8) !wind gust factor
integer(in) :: tod, dt
logical :: ocn_prognostic ! .true. => ocn is prognostic
logical :: flux_diurnal ! .true. => turn on diurnal cycle in atm/ocn fluxes
Expand All @@ -868,8 +875,9 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o
dead_comps=dead_comps, &
atm_nx=atm_nx, atm_ny=atm_ny, &
ocn_nx=ocn_nx, ocn_ny=ocn_ny, &
ocn_prognostic=ocn_prognostic, &
flux_diurnal=flux_diurnal)
ocn_prognostic=ocn_prognostic, &
flux_diurnal=flux_diurnal, &
gust_fac = gust_fac )

if (dead_comps) then
do n = 1,nloc_a2o
Expand Down Expand Up @@ -934,7 +942,7 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o
cskin, cskin_night, tod, dt, &
duu10n,ustar, re , ssq , missval = 0.0_r8 )
else
call shr_flux_atmocn (nloc_a2o , zbot , ubot, vbot, thbot, &
call shr_flux_atmocn (nloc_a2o , zbot , ubot, vbot, thbot, prec_gust, gust_fac, &
shum , dens , tbot, uocn, vocn , &
tocn , emask, sen , lat , lwup , &
evap , taux , tauy, tref, qref , &
Expand Down Expand Up @@ -1103,6 +1111,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao)
real(r8) :: avsdr ! albedo: visible , direct
real(r8) :: anidf ! albedo: near infrared, diffuse
real(r8) :: avsdf ! albedo: visible , diffuse
real(r8) :: gust_fac = huge(1.0_r8) !wind gust factor
integer(in) :: nloc, nloca, nloco ! number of gridcells
integer(in) :: ID ! comm ID
logical :: first_call = .true.
Expand All @@ -1119,7 +1128,8 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao)
flux_albav=flux_albav, &
dead_comps=dead_comps, &
ocn_prognostic=ocn_prognostic, &
flux_diurnal=flux_diurnal)
flux_diurnal=flux_diurnal, &
gust_fac = gust_fac )

if (first_call) then
index_xao_So_tref = mct_aVect_indexRA(xao,'So_tref')
Expand Down Expand Up @@ -1211,6 +1221,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao)
uGust(n)= 0.0_r8
lwdn(n) = 0.0_r8
prec(n) = 0.0_r8
prec_gust(n) = 0.0_r8
fswpen(n)= 0.0_r8
ocnsal(n)= 0.0_r8

Expand Down Expand Up @@ -1262,6 +1273,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao)
& + a2x%rAttr(index_a2x_Faxa_rainl,n) &
& + a2x%rAttr(index_a2x_Faxa_snowc,n) &
& + a2x%rAttr(index_a2x_Faxa_snowl,n)
prec_gust (n) = a2x%rAttr(index_a2x_Faxa_rainc,n)
fswpen(n)= o2x%rAttr(index_o2x_So_fswpen ,n)
ocnsal(n)= o2x%rAttr(index_o2x_So_s ,n)

Expand Down Expand Up @@ -1308,7 +1320,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao)
!consistent with mrgx2a fraction
!duu10n,ustar, re , ssq, missval = 0.0_r8 )
else
call shr_flux_atmocn (nloc , zbot , ubot, vbot, thbot, &
call shr_flux_atmocn (nloc , zbot , ubot, vbot, thbot, prec_gust, gust_fac, &
shum , dens , tbot, uocn, vocn , &
tocn , emask, sen , lat , lwup , &
evap , taux , tauy, tref, qref , &
Expand Down
16 changes: 13 additions & 3 deletions driver_cpl/shr/seq_infodata_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ MODULE seq_infodata_mod
character(SHR_KIND_CL) :: flux_epbal ! selects E,P,R adjustment technique
logical :: flux_albav ! T => no diurnal cycle in ocn albedos
logical :: flux_diurnal ! T => diurnal cycle in atm/ocn fluxes
real(SHR_KIND_R8) :: gust_fac ! wind gustiness factor
real(SHR_KIND_R8) :: wall_time_limit ! force stop time limit (hours)
character(SHR_KIND_CS) :: force_stop_at ! when to force a stop (month, day, etc)
character(SHR_KIND_CL) :: atm_gnam ! atm grid
Expand Down Expand Up @@ -312,6 +313,7 @@ SUBROUTINE seq_infodata_Init( infodata, nmlfile, ID, pioid)
character(SHR_KIND_CL) :: flux_epbal ! selects E,P,R adjustment technique
logical :: flux_albav ! T => no diurnal cycle in ocn albedos
logical :: flux_diurnal ! T => diurnal cycle in atm/ocn fluxes
real(SHR_KIND_R8) :: gust_fac ! wind gustiness factor
real(SHR_KIND_R8) :: wall_time_limit ! force stop time limit (hours)
character(SHR_KIND_CS) :: force_stop_at ! when to force a stop (month, day, etc)
character(SHR_KIND_CL) :: atm_gnam ! atm grid
Expand Down Expand Up @@ -373,7 +375,7 @@ SUBROUTINE seq_infodata_Init( infodata, nmlfile, ID, pioid)
brnch_retain_casename, info_debug, bfbflag, &
restart_pfile, restart_file, run_barriers, &
single_column, scmlat, force_stop_at, &
scmlon, logFilePostFix, outPathRoot, flux_diurnal,&
scmlon, logFilePostFix, outPathRoot, flux_diurnal, gust_fac, &
perpetual, perpetual_ymd, flux_epbal, flux_albav, &
orb_iyear_align, orb_mode, wall_time_limit, &
orb_iyear, orb_obliq, orb_eccen, orb_mvelp, &
Expand Down Expand Up @@ -447,6 +449,7 @@ SUBROUTINE seq_infodata_Init( infodata, nmlfile, ID, pioid)
flux_epbal = 'off'
flux_albav = .false.
flux_diurnal = .false.
gust_fac = huge(1.0_SHR_KIND_R8)
wall_time_limit = -1.0
force_stop_at = 'month'
atm_gnam = 'undefined'
Expand Down Expand Up @@ -549,6 +552,7 @@ SUBROUTINE seq_infodata_Init( infodata, nmlfile, ID, pioid)
infodata%flux_epbal = flux_epbal
infodata%flux_albav = flux_albav
infodata%flux_diurnal = flux_diurnal
infodata%gust_fac = gust_fac
infodata%wall_time_limit = wall_time_limit
infodata%force_stop_at = force_stop_at
infodata%atm_gnam = atm_gnam
Expand Down Expand Up @@ -832,7 +836,7 @@ SUBROUTINE seq_infodata_GetData( infodata, case_name, case_desc, timing_dir, &
shr_map_dopole, vect_map, aoflux_grid, flux_epbalfact, &
nextsw_cday, precip_fact, flux_epbal, flux_albav, glcrun_alarm, &
glc_g2lupdate, atm_aero, run_barriers, esmf_map_flag, &
do_budgets, do_histinit, drv_threading, flux_diurnal, &
do_budgets, do_histinit, drv_threading, flux_diurnal, gust_fac, &
budget_inst, budget_daily, budget_month, wall_time_limit, &
budget_ann, budget_ltann, budget_ltend , force_stop_at, &
histaux_a2x , histaux_a2x3hr, histaux_a2x3hrp , histaux_l2x1yr, &
Expand Down Expand Up @@ -897,6 +901,7 @@ SUBROUTINE seq_infodata_GetData( infodata, case_name, case_desc, timing_dir, &
character(len=*) ,optional, intent(OUT) :: flux_epbal ! selects E,P,R adjustment technique
logical ,optional, intent(OUT) :: flux_albav ! T => no diurnal cycle in ocn albedos
logical ,optional, intent(OUT) :: flux_diurnal ! T => diurnal cycle in atm/ocn flux
real(SHR_KIND_R8) ,optional, intent(OUT) :: gust_fac ! wind gustiness factor
real(SHR_KIND_R8) ,optional, intent(OUT) :: wall_time_limit ! force stop wall time (hours)
character(len=*) ,optional, intent(OUT) :: force_stop_at ! force stop at next (month, day, etc)
character(len=*) ,optional, intent(OUT) :: atm_gnam ! atm grid
Expand Down Expand Up @@ -1054,6 +1059,7 @@ SUBROUTINE seq_infodata_GetData( infodata, case_name, case_desc, timing_dir, &
if ( present(flux_epbal) ) flux_epbal = infodata%flux_epbal
if ( present(flux_albav) ) flux_albav = infodata%flux_albav
if ( present(flux_diurnal) ) flux_diurnal = infodata%flux_diurnal
if ( present(gust_fac) ) gust_fac = infodata%gust_fac
if ( present(wall_time_limit)) wall_time_limit= infodata%wall_time_limit
if ( present(force_stop_at) ) force_stop_at = infodata%force_stop_at
if ( present(atm_gnam) ) atm_gnam = infodata%atm_gnam
Expand Down Expand Up @@ -1201,7 +1207,7 @@ SUBROUTINE seq_infodata_PutData( infodata, case_name, case_desc, timing_dir, &
shr_map_dopole, vect_map, aoflux_grid, run_barriers, &
nextsw_cday, precip_fact, flux_epbal, flux_albav, glcrun_alarm, &
glc_g2lupdate, atm_aero, esmf_map_flag, wall_time_limit, &
do_budgets, do_histinit, drv_threading, flux_diurnal, &
do_budgets, do_histinit, drv_threading, flux_diurnal, gust_fac, &
budget_inst, budget_daily, budget_month, force_stop_at, &
budget_ann, budget_ltann, budget_ltend , &
histaux_a2x , histaux_a2x3hr, histaux_a2x3hrp , histaux_l2x1yr, &
Expand Down Expand Up @@ -1266,6 +1272,7 @@ SUBROUTINE seq_infodata_PutData( infodata, case_name, case_desc, timing_dir, &
character(len=*) ,optional, intent(IN) :: flux_epbal ! selects E,P,R adjustment technique
logical ,optional, intent(IN) :: flux_albav ! T => no diurnal cycle in ocn albedos
logical ,optional, intent(IN) :: flux_diurnal ! T => diurnal cycle in atm/ocn flux
real(SHR_KIND_R8) ,optional, intent(IN) :: gust_fac ! wind gustiness factor
real(SHR_KIND_R8) ,optional, intent(IN) :: wall_time_limit ! force stop wall time (hours)
character(len=*) ,optional, intent(IN) :: force_stop_at ! force a stop at next (month, day, etc)
character(len=*) ,optional, intent(IN) :: atm_gnam ! atm grid
Expand Down Expand Up @@ -1421,6 +1428,7 @@ SUBROUTINE seq_infodata_PutData( infodata, case_name, case_desc, timing_dir, &
if ( present(flux_epbal) ) infodata%flux_epbal = flux_epbal
if ( present(flux_albav) ) infodata%flux_albav = flux_albav
if ( present(flux_diurnal) ) infodata%flux_diurnal = flux_diurnal
if ( present(gust_fac) ) infodata%gust_fac = gust_fac
if ( present(wall_time_limit)) infodata%wall_time_limit= wall_time_limit
if ( present(force_stop_at) ) infodata%force_stop_at = force_stop_at
if ( present(atm_gnam) ) infodata%atm_gnam = atm_gnam
Expand Down Expand Up @@ -1599,6 +1607,7 @@ subroutine seq_infodata_bcast(infodata,mpicom)
call shr_mpi_bcast(infodata%flux_epbal, mpicom)
call shr_mpi_bcast(infodata%flux_albav, mpicom)
call shr_mpi_bcast(infodata%flux_diurnal, mpicom)
call shr_mpi_bcast(infodata%gust_fac, mpicom)
call shr_mpi_bcast(infodata%wall_time_limit, mpicom)
call shr_mpi_bcast(infodata%force_stop_at, mpicom)
call shr_mpi_bcast(infodata%atm_gnam, mpicom)
Expand Down Expand Up @@ -2231,6 +2240,7 @@ SUBROUTINE seq_infodata_print( infodata )
write(logunit,F0A) subname,'flux_epbal = ', trim(infodata%flux_epbal)
write(logunit,F0L) subname,'flux_albav = ', infodata%flux_albav
write(logunit,F0L) subname,'flux_diurnal = ', infodata%flux_diurnal
write(logunit,F0R) subname,'gust_fac = ', infodata%gust_fac
write(logunit,F0R) subname,'wall_time_limit = ', infodata%wall_time_limit
write(logunit,F0A) subname,'force_stop_at = ', trim(infodata%force_stop_at)
write(logunit,F0A) subname,'atm_gridname = ', trim(infodata%atm_gnam)
Expand Down
17 changes: 15 additions & 2 deletions share/csm_share/shr/shr_flux_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ end subroutine shr_flux_adjust_constants
!
! !INTERFACE: ------------------------------------------------------------------

SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , &
SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot ,prec_gust, gust_fac, &
& qbot ,rbot ,tbot ,us ,vs , &
& ts ,mask ,sen ,lat ,lwup , &
& evap ,taux ,tauy ,tref ,qref , &
Expand All @@ -143,6 +143,8 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , &
real(R8) ,intent(in) :: us (nMax) ! ocn u-velocity (m/s)
real(R8) ,intent(in) :: vs (nMax) ! ocn v-velocity (m/s)
real(R8) ,intent(in) :: ts (nMax) ! ocn temperature (K)
real(R8) ,intent(in) :: prec_gust (nMax) ! atm precip for convective gustiness (kg/m^3)
real(R8) ,intent(in) :: gust_fac ! wind gustiness factor

!--- output arguments -------------------------------
real(R8),intent(out) :: sen (nMax) ! heat flux: sensible (W/m^2)
Expand Down Expand Up @@ -206,14 +208,23 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , &
real(R8) :: cdn ! function: neutral drag coeff at 10m
real(R8) :: psimhu ! function: unstable part of psimh
real(R8) :: psixhu ! function: unstable part of psimx
real(R8) :: ugust ! function: gustiness as a function of convective rainfall
real(R8) :: Umps ! dummy arg ~ wind velocity (m/s)
real(R8) :: Tk ! dummy arg ~ temperature (K)
real(R8) :: xd ! dummy arg ~ ?
real(R8) :: gprec ! dummy arg ~ ?

qsat(Tk) = 640380.0_R8 / exp(5107.4_R8/Tk)
cdn(Umps) = 0.0027_R8 / Umps + 0.000142_R8 + 0.0000764_R8 * Umps
psimhu(xd) = log((1.0_R8+xd*(2.0_R8+xd))*(1.0_R8+xd*xd)/8.0_R8) - 2.0_R8*atan(xd) + 1.571_R8
psixhu(xd) = 2.0_R8 * log((1.0_R8 + xd*xd)/2.0_R8)

! Convective gustiness appropriate for input precipitation.
! Following Redelsperger et al. (2000, J. Clim)
! Ug = log(1.0+6.69R-0.476R^2)
! Coefficients X by 8640 for mm/s (from cam) -> cm/day (for above forumla)
ugust(gprec) = gust_fac*log(1._R8+57801.6_R8*gprec-3.55332096e7_R8*(gprec**2.0_R8))


!--- formats ----------------------------------------
character(*),parameter :: subName = '(shr_flux_atmOcn) '
Expand Down Expand Up @@ -251,7 +262,9 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , &
if (mask(n) /= 0) then

!--- compute some needed quantities ---
vmag = max(umin, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2) )
!--- vmag+ugust (convective gustiness) Limit to a max precip 6 cm/day = 0.00069444 mm/s.
vmag = max(umin, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2) + ugust(min(prec_gust(n),6.94444e-4_R8)))

thvbot = thbot(n) * (1.0_R8 + loc_zvir * qbot(n)) ! virtual temp (K)
ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg)
delt = thbot(n) - ts(n) ! pot temp diff (K)
Expand Down

0 comments on commit 9bbfad5

Please sign in to comment.