Skip to content

Commit

Permalink
Add a WAM regression test with the MULTI_GASES and MOLECULAR_DIFFUSIO…
Browse files Browse the repository at this point in the history
…N options on (NOAA-EMC#354)

Add a WAM regression test with the MULTI_GASES and MOLECULAR_DIFFUSION options on

Co-authored-by: Sajal.Kar <Sajal.Kar@noaa.gov>
  • Loading branch information
XiaqiongZhou-NOAA and SajalKar-NOAA authored Oct 27, 2021
1 parent b96f38d commit 1b6b705
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ set_target_properties(fv3atm PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT
target_include_directories(fv3atm INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)

if(MULTI_GASES)
list(APPEND _fv3atm_defs_private MULTI_GASES)
endif()

target_link_libraries(fv3atm PUBLIC fv3
fv3ccpp
stochastic_physics
Expand Down
3 changes: 3 additions & 0 deletions ccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ if(MULTI_GASES)
add_definitions(-DMULTI_GASES)
endif()

if(IDEA_PHYS)
add_definitions(-DIDEA_PHYS)
endif()
#------------------------------------------------------------------------------
# Build CCPP framework and physics

Expand Down
31 changes: 21 additions & 10 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#undef MULTI_GASES

module GFS_typedefs

Expand Down Expand Up @@ -2185,10 +2184,10 @@ module GFS_typedefs
type(ty_source_func_lw) :: sources !< RRTMGP DDT

!-- GSL drag suite
real (kind=kind_phys), pointer :: varss(:) => null() !<
real (kind=kind_phys), pointer :: ocss(:) => null() !<
real (kind=kind_phys), pointer :: oa4ss(:,:) => null() !<
real (kind=kind_phys), pointer :: clxss(:,:) => null() !<
real (kind=kind_phys), pointer :: varss(:) => null() !<
real (kind=kind_phys), pointer :: ocss(:) => null() !<
real (kind=kind_phys), pointer :: oa4ss(:,:) => null() !<
real (kind=kind_phys), pointer :: clxss(:,:) => null() !<

!-- 3D diagnostics
integer :: rtg_ozone_index, rtg_tke_index
Expand Down Expand Up @@ -3572,7 +3571,14 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!--- coupling parameters
cplflx, cplice, cplocn2atm, cplwav, cplwav2atm, cplchm, &
cpl_imp_mrg, cpl_imp_dbg, &
use_cice_alb, lsidea, &
use_cice_alb, &
#ifdef IDEA_PHYS
lsidea, weimer_model, f107_kp_size, f107_kp_interval, &
f107_kp_skip_size, f107_kp_data_size, f107_kp_read_in_start, &
ipe_to_wam_coupling, &
#else
lsidea, &
#endif
!--- radiation parameters
fhswr, fhlwr, levr, nfxr, iaerclm, iflip, isol, ico2, ialb, &
isot, iems, iaer, icliq_sw, iovr, ictm, isubc_sw, &
Expand Down Expand Up @@ -3872,6 +3878,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
print *,' LSIDEA is active but needs to be reworked for FV3 - shutting down'
stop
endif
#ifdef IDEA_PHYS
!--- integrated dynamics through earth's atmosphere
Model%weimer_model = weimer_model
#endif

!--- calendars and time parameters and activation triggers
Model%dtp = dt_phys
Expand Down Expand Up @@ -4472,11 +4482,13 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%tracer_names(:) = tracer_names(:)
Model%ntqv = 1
#ifdef MULTI_GASES
Model%nto = get_tracer_index(Model%tracer_names, 'spfo', Model%me, Model%master, Model%debug)
Model%nto2 = get_tracer_index(Model%tracer_names, 'spfo2', Model%me, Model%master, Model%debug)
Model%ntoz = get_tracer_index(Model%tracer_names, 'spfo3', Model%me, Model%master, Model%debug)
Model%nto = get_tracer_index(Model%tracer_names, 'spo', Model%me, Model%master, Model%debug)
Model%nto2 = get_tracer_index(Model%tracer_names, 'spo2', Model%me, Model%master, Model%debug)
Model%ntoz = get_tracer_index(Model%tracer_names, 'spo3', Model%me, Model%master, Model%debug)
#else
Model%ntoz = get_tracer_index(Model%tracer_names, 'o3mr', Model%me, Model%master, Model%debug)
if( Model%ntoz <= 0 ) &
Model%ntoz = get_tracer_index(Model%tracer_names, 'spo3', Model%me, Model%master, Model%debug)
#endif
Model%ntcw = get_tracer_index(Model%tracer_names, 'liq_wat', Model%me, Model%master, Model%debug)
Model%ntiw = get_tracer_index(Model%tracer_names, 'ice_wat', Model%me, Model%master, Model%debug)
Expand Down Expand Up @@ -5482,7 +5494,6 @@ subroutine control_print(Model)
print *, ' cpl_imp_mrg : ', Model%cpl_imp_mrg
print *, ' cpl_imp_dbg : ', Model%cpl_imp_dbg
print *, ' '
print *, 'integrated dynamics through earth atmosphere'
print *, ' lsidea : ', Model%lsidea
print *, ' '
print *, 'calendars and time parameters and activation triggers'
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<suite name="FV3_GFS_2017_fv3wam" version="1">
<suite name="FV3_GFS_v16_fv3wam" version="1">
<!-- <init></init> -->
<group name="time_vary">
<subcycle loop="1">
Expand Down Expand Up @@ -52,14 +52,15 @@
<scheme>sfc_diag_post</scheme>
<scheme>GFS_surface_generic_post</scheme>
<scheme>GFS_PBL_generic_pre</scheme>
<scheme>hedmf</scheme>
<scheme>satmedmfvdifq</scheme>
<scheme>GFS_PBL_generic_post</scheme>
<scheme>GFS_GWD_generic_pre</scheme>
<scheme>cires_ugwp</scheme>
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys</scheme>
<scheme>ozphys_2015</scheme>
<scheme>h2ophys</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand All @@ -71,17 +72,17 @@
<scheme>GFS_suite_interstitial_4</scheme>
<scheme>cnvc90</scheme>
<scheme>GFS_MP_generic_pre</scheme>
<scheme>zhaocarr_gscond</scheme>
<scheme>zhaocarr_precpd</scheme>
<scheme>gfdl_cloud_microphys</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
<scheme>phys_tend</scheme>
</subcycle>
</group>
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
<scheme>phys_tend</scheme>
</subcycle>
</group>

<!-- <finalize></finalize> -->
</suite>
4 changes: 4 additions & 0 deletions io/FV3GFS_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2831,7 +2831,11 @@ subroutine fv3gfs_diag_output(time, diag, atm_block, nx, ny, levs, ntcw, ntoz, &
used=send_data(Diag(idx)%id, var3, Time, is_in=is_in, js_in=js_in, ks_in=1)
endif
!--- ozone mixing ration tendency
#ifdef MULTI_GASES
if (trim(Diag(idx)%name) == 'dspo3_dt') then
#else
if (trim(Diag(idx)%name) == 'do3mr_dt') then
#endif
var3(1:nx,1:ny,1:levs) = RESHAPE(Statein%qgrs(1:ngptc,levs:1:-1,ntoz:ntoz), (/nx,ny,levs/))
var3(1:nx,1:ny,1:levs) = (RESHAPE(Stateout%gq0(1:ngptc,levs:1:-1,ntoz:ntoz), (/nx,ny,levs/)) &
- var3(1:nx,1:ny,1:levs))*rdt
Expand Down
4 changes: 4 additions & 0 deletions io/post_gfs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,11 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, &
endif

! model level ozone mixing ratio
#ifdef MULTI_GASES
if(trim(fieldname)=='spo3') then
#else
if(trim(fieldname)=='o3mr') then
#endif
!$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,o3,arrayr43d)
do l=1,lm
do j=jsta,jend
Expand Down

0 comments on commit 1b6b705

Please sign in to comment.