Skip to content

CIRES UGWP (unified gravity wave physics scheme) to be added#226

Closed
bluefinweiwei wants to merge 3 commits into
NCAR:masterfrom
bluefinweiwei:cires_ugwp
Closed

CIRES UGWP (unified gravity wave physics scheme) to be added#226
bluefinweiwei wants to merge 3 commits into
NCAR:masterfrom
bluefinweiwei:cires_ugwp

Conversation

@bluefinweiwei
Copy link
Copy Markdown
Collaborator

@bluefinweiwei bluefinweiwei commented Mar 27, 2019

No description provided.

 with '' will be ignored, and an empty message aborts the commit.
 On branch cires_ugwp
 Changes to be committed:
	modified:   physics/GFDL_parse_tracers.F90
	modified:   physics/GFS_DCNV_generic.F90
	modified:   physics/GFS_MP_generic.F90
	modified:   physics/GFS_PBL_generic.F90
	modified:   physics/GFS_SCNV_generic.F90
	modified:   physics/GFS_debug.F90
	modified:   physics/GFS_phys_time_vary.fv3.F90
	modified:   physics/GFS_phys_time_vary.scm.F90
	modified:   physics/GFS_rad_time_vary.fv3.F90
	modified:   physics/GFS_rad_time_vary.scm.F90
	modified:   physics/GFS_rrtmg_post.F90
	modified:   physics/GFS_rrtmg_pre.F90
	modified:   physics/GFS_rrtmg_setup.F90
	modified:   physics/GFS_stochastics.F90
	modified:   physics/GFS_suite_init_finalize_test.F90
	modified:   physics/GFS_suite_interstitial.F90
	modified:   physics/GFS_surface_generic.F90
	modified:   physics/GFS_surface_loop_control.F90
	modified:   physics/GFS_time_vary_pre.fv3.F90
	modified:   physics/GFS_time_vary_pre.scm.F90
	modified:   physics/aer_cloud.F
	modified:   physics/aerclm_def.F
	modified:   physics/aerinterp.F90
	modified:   physics/calpreciptype.f90
	modified:   physics/cldmacro.F
	modified:   physics/cldwat2m_micro.F
	modified:   physics/cnvc90.f
	modified:   physics/cs_conv.F90
	modified:   physics/cs_conv_aw_adj.F90
	modified:   physics/cu_gf_deep.F90
	modified:   physics/cu_gf_driver.F90
	modified:   physics/cu_gf_driver_post.F90
	modified:   physics/cu_gf_driver_pre.F90
    modified:   physics/cu_gf_sh.F90
	modified:   physics/date_def.f
	modified:   physics/dcyc2.f
	modified:   physics/funcphys.f90
	modified:   physics/gcm_shoc.F90
	modified:   physics/gcycle.F90
	modified:   physics/get_prs_fv3.F90
	modified:   physics/gfdl_cloud_microphys.F90
	modified:   physics/gfdl_fv_sat_adj.F90
	modified:   physics/gfs_phy_tracer_config.f
	modified:   physics/gmtb_scm_sfc_flux_spec.F90
	modified:   physics/gocart_tracer_config_stub.f
	modified:   physics/gscond.f
	modified:   physics/gwdc.f
	modified:   physics/gwdps.f
	modified:   physics/h2o_def.f
	modified:   physics/h2ointerp.f90
	modified:   physics/iccn_def.F
	modified:   physics/iccninterp.F90
	modified:   physics/iounitdef.f
	modified:   physics/m_micro.F90
	modified:   physics/m_micro_interstitial.F90
	modified:   physics/machine.F
	modified:   physics/memcheck.F90
	modified:   physics/mersenne_twister.f
	modified:   physics/mfpbl.f
	modified:   physics/module_MYNNPBL_wrapper.F90
	modified:   physics/module_MYNNSFC_wrapper.F90
	modified:   physics/module_MYNNrad_post.F90
	modified:   physics/module_MYNNrad_pre.F90
	modified:   physics/module_bfmicrophysics.f
	modified:   physics/module_bl_mynn.F90
	modified:   physics/module_gfdl_cloud_microphys.F90
	modified:   physics/module_mp_thompson_hrrr.F90
	modified:   physics/module_mp_thompson_hrrr_radar.F90
	modified:   physics/module_nst_model.f90
	modified:   physics/module_nst_parameters.f90
	modified:   physics/module_nst_water_prop.f90
	modified:   physics/module_sf_mynn.F90
	modified:   physics/module_sf_ruclsm.F90
	modified:   physics/module_soil_pre.F90
	modified:   physics/moninedmf.f
	modified:   physics/moninshoc.f
	modified:   physics/mp_thompson_hrrr.F90
	modified:   physics/mp_thompson_hrrr_post.F90
	modified:   physics/mp_thompson_hrrr_pre.F90
	modified:   physics/namelist_soilveg.f
	modified:   physics/namelist_soilveg_ruc.F90
	modified:   physics/num_parthds.F
	modified:   physics/ozinterp.f90
	modified:   physics/ozne_def.f
	modified:   physics/ozphys.f
	modified:   physics/physcons.F90
	modified:   physics/physparam.f
	modified:   physics/precpd.f
	modified:   physics/radcons.f90
	modified:   physics/radiation_aerosols.f
	modified:   physics/radiation_astronomy.f
	modified:   physics/radiation_clouds.f
	modified:   physics/radiation_gases.f
	modified:   physics/radiation_surface.f
	modified:   physics/radlw_datatb.f
	modified:   physics/radlw_main.f
	modified:   physics/radlw_param.f
	modified:   physics/radsw_datatb.f
	modified:   physics/radsw_main.f
	modified:   physics/radsw_param.f
	modified:   physics/rascnvv2.f
	modified:   physics/rayleigh_damp.f
	modified:   physics/rrtmg_lw_post.F90
	modified:   physics/rrtmg_lw_pre.F90
	modified:   physics/rrtmg_sw_post.F90
	modified:   physics/rrtmg_sw_pre.F90
	modified:   physics/satmedmfvdif.F
	modified:   physics/set_soilveg.f
	modified:   physics/set_soilveg_ruc.F90
	modified:   physics/sfc_diag.f
	modified:   physics/sfc_diag_post.F90
	modified:   physics/sfc_diff.f
	modified:   physics/sfc_drv.f
	modified:   physics/sfc_drv_ruc.F90
	modified:   physics/sfc_nst.f
	modified:   physics/sfc_ocean.F
	modified:   physics/sfc_sice.f
	modified:   physics/sfcsub.F
	modified:   physics/sflx.f
	modified:   physics/surface_perturbation.F90
	modified:   physics/tridi.f
	modified:   physics/tridi2t3.f
	modified:   physics/wam_f107_kp_mod.f90
	modified:   physics/wv_saturation.F

 Untracked files:
	CCPP_CAPS.cmake
	CCPP_CAPS.mk
	CCPP_SCHEMES.cmake
	CCPP_SCHEMES.mk
	CCPP_VARIABLES_FV3.html
	physics/GFS_DCNV_generic_post_cap.F90
	physics/GFS_DCNV_generic_pre_cap.F90
	physics/GFS_MP_generic_post_cap.F90
	physics/GFS_MP_generic_pre_cap.F90
	physics/GFS_PBL_generic_post_cap.F90
	physics/GFS_PBL_generic_pre_cap.F90
	physics/GFS_SCNV_generic_post_cap.F90
	physics/GFS_SCNV_generic_pre_cap.F90
	physics/GFS_abort_cap.F90
	physics/GFS_diagtoscreen_cap.F90
	physics/GFS_interstitialtoscreen_cap.F90
	physics/GFS_phys_time_vary_cap.F90
	physics/GFS_rad_time_vary_cap.F90
	physics/GFS_rrtmg_post_cap.F90
	physics/GFS_rrtmg_pre_cap.F90
	physics/GFS_rrtmg_setup_cap.F90
	physics/GFS_stochastics_cap.F90
	physics/GFS_suite_ini_fini_test_cap.F90
	physics/GFS_suite_interstitial_1_cap.F90
	physics/GFS_suite_interstitial_2_cap.F90
	physics/GFS_suite_interstitial_3_cap.F90
	physics/GFS_suite_interstitial_4_cap.F90
	physics/GFS_suite_interstitial_phys_reset_cap.F90
	physics/GFS_suite_interstitial_rad_reset_cap.F90
	physics/GFS_suite_stateout_reset_cap.F90
	physics/GFS_suite_stateout_update_cap.F90
	physics/GFS_surface_generic_post_cap.F90
	physics/GFS_surface_generic_pre_cap.F90
	physics/GFS_surface_loop_control_part1_cap.F90
	physics/GFS_surface_loop_control_part2_cap.F90
	physics/GFS_time_vary_pre_cap.F90
	physics/ccpp_group_physics_cap.F90
	physics/ccpp_group_radiation_cap.F90
	physics/ccpp_group_stochastics_cap.F90
	physics/ccpp_group_time_vary_cap.F90
	physics/ccpp_suite_cap.F90
	physics/cires_ugwp.F90
	physics/cires_ugwp_beta_v0.f
	physics/cires_ugwp_cap.F90
	physics/cires_ugwp_initialize.F90
	physics/cires_ugwp_module.F90
	physics/cires_ugwp_module.F90~
	physics/cires_ugwp_post.F90
	physics/cires_ugwp_solvers.F90
	physics/cires_ugwp_triggers.F90
	physics/cires_ugwp_utils.F90
	physics/cires_ugwp_v1.F90
	physics/cires_vert_lsatdis.F90
	physics/cires_vert_orodis.F90
	physics/cires_vert_wmsdis.F90
	physics/cnvc90_cap.F90
	physics/cs_conv_aw_adj_cap.F90
	physics/cs_conv_cap.F90
	physics/cs_conv_post_cap.F90
	physics/cs_conv_pre_cap.F90
	physics/cu_gf_driver_cap.F90
	physics/cu_gf_driver_post_cap.F90
	physics/cu_gf_driver_pre_cap.F90
	physics/dcyc2t3_cap.F90
	physics/dcyc2t3_post_cap.F90
	physics/fv_sat_adj_cap.F90
	physics/get_phi_fv3_cap.F90
	physics/get_prs_fv3_cap.F90
	physics/gfdl_cloud_microphys_cap.F90
	physics/gwdc_cap.F90
	physics/gwdc_post_cap.F90
	physics/gwdc_pre_cap.F90
	physics/gwdps_cap.F90
	physics/gwdps_post_cap.F90
	physics/gwdps_pre_cap.F90
	physics/h2ophys_cap.F90
	physics/hedmf_cap.F90
	physics/lsm_noah_cap.F90
	physics/lsm_ruc_cap.F90
	physics/m_micro_cap.F90
	physics/m_micro_post_cap.F90
	physics/m_micro_pre_cap.F90
	physics/memcheck_cap.F90
	physics/module_cires_ugwp.F90
	physics/moninshoc_cap.F90
	physics/mp_thompson_hrrr_cap.F90
	physics/mp_thompson_hrrr_post_cap.F90
	physics/mp_thompson_hrrr_pre_cap.F90
	physics/mynnedmf_wrapper_cap.F90
	physics/mynnrad_post_cap.F90
	physics/mynnrad_pre_cap.F90
	physics/mynnsfc_wrapper_cap.F90
	physics/ozphys_2015_cap.F90
	physics/ozphys_cap.F90
	physics/rayleigh_damp_cap.F90
	physics/rrtmg_lw_cap.F90
	physics/rrtmg_lw_post_cap.F90
	physics/rrtmg_lw_pre_cap.F90
	physics/rrtmg_sw_cap.F90
	physics/rrtmg_sw_post_cap.F90
	physics/rrtmg_sw_pre_cap.F90
	physics/samfdeepcnv_cap.F90
	physics/samfshalcnv_cap.F90
	physics/samfshalcnv_post_cap.F90
	physics/satmedmfvdif_cap.F90
	physics/sfc_diag_cap.F90
	physics/sfc_diag_post_cap.F90
	physics/sfc_ex_coef_cap.F90
	physics/sfc_nst_cap.F90
	physics/sfc_nst_post_cap.F90
	physics/sfc_nst_pre_cap.F90
	physics/sfc_ocean_cap.F90
	physics/sfc_sice_cap.F90
	physics/sfc_sice_post_cap.F90
	physics/shoc_cap.F90
	physics/stochastic_physics_cap.F90
	physics/stochastic_physics_sfc_cap.F90
	physics/ugwp_driver_v0.f
	physics/ugwp_driver_v0.f.bak
	physics/zhaocarr_gscond_cap.F90
	physics/zhaocarr_precpd_cap.F90
Copy link
Copy Markdown
Collaborator

@grantfirl grantfirl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments that will need to be addressed at some point:

  1. It looks like file permissions were changed on all of the files in the physics dir. Why?
  2. When the PR is ready to merge, there should be no autogenerated code (caps) in the repo. The only changes should be the files that UGWP is bringing in. So, rather than there being 240 files changed, there should be maybe on the order of 10, I'm guessing.

@grantfirl
Copy link
Copy Markdown
Collaborator

@grantfirl
Copy link
Copy Markdown
Collaborator

Also, you'll want to update this branch to the latest master. I see that it is behind NCAR/master by 56 commits.

Comment thread physics/cires_ugwp_v1.F90
@@ -0,0 +1,362 @@
!> \file cires_ugwp.F90
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be removed until v1 is being worked on. Otherwise, it is confusing to have two cires_ugwp modules in here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done



!WL* not sure if we need to put them in a _pre?
Pdudt = 0.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to understand what Valery is trying to do with tendencies. It seems like what was added is different than what other schemes have done, so we need to understand if he really needs to do something different or he didn't understand how tendencies were done previously for other schemes. According to what he added to GFS_physics_driver, PdXdt are zeroed out every timestep within the driver. If we're keeping what he has done, these variables should be added to the GFS_interstitial_type in GFS_typedefs.F90 (they are zeroed out before every physics call in a reset routine, so the initialize statements would not need to be here).

Pdvdt = 0.
Pdtdt = 0.

Tdudt = 0.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment applies to these (TdXdt) variables too (need to understand what Valery intends with these). It appears that these variables should be diagnostics that are zeroed out periodically but not every timestep. If so, they belong in the GFS_diag_type of GFS_typedefs.F90 and they should be zeroed out with the other diagnostics periodically in GFS_typedefs.F90/diag_phys_zero.

!> \section arg_table_cire_ugwp_post_run Argument Table
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |------------------|--------------------------------------------------------------------------------|--------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------|
!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GFS derived type instances should not be passed into schemes for portability. We should be passing in components of these types directly as needed. This has been relaxed in the past due to expediency concerns, but we should not be doing this going forward, especially for new CCPP schemes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. All GFS derived types (Statein, Stateout, Sfcprop, and Diag) have been replaced with the relevant components.

Comment thread physics/cires_ugwp.F90
!> \section arg_table_cires_ugwp_run Argument Table
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |------------------|--------------------------------------------------------------------------------|--------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------|
!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GFS derived type instances should not be passed into schemes for portability. We should be passing in components of these types directly as needed. This has been relaxed in the past due to expediency concerns, but we should not be doing this going forward, especially for new CCPP schemes. (applies to Model, Statein, Sfcprop)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. All GFS derived types (Statein, Stateout, Sfcprop, and Diag) have been replaced with the relevant components.

Comment thread physics/cires_ugwp.F90
errflg = 0


! For COORDE averaging over fdaily. It's done before 3Diag fixes and averaging ingested using "fdaily"-factor
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to keep how VAY did diagnostics, this will need to be put in a "pre" interstitial routine.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread physics/cires_ugwp.F90

! topo paras
! with orographic effects
if(nmtvr == 14)then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code (except for the calculation of sgh30) is currently in gwdps_pre_run in gwdps.F. We'll need to think about where it belongs (probably moving the stuff out of gwdps.F into its own GWD_generic file now that there is more than one GWD scheme.)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a bunch of diagnostics-related stuff the VAY does in GFS_physics_driver.F90 that will need to go into a "pre" interstitial (IF the way that VAY did his diagnostics is really necessary).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lines 680-765 and 1669-1683 in GFS_physics_driver.F90 from VAY

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is GWD_generic file? Where is it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't exist yet. We had been separating interstitial code into "scheme-specific" interstitial code that only gets executed when a specific scheme is active, or "scheme-generic" code that gets executed as part of a suite for any scheme of that type, i.e. for any GWD scheme. When we originally wrote the interstitial schemes (I believe Gerard Ketefian did the GWD schemes), there was only one GWD scheme, so the interstitial code was scheme-specific by default. Now that there are more than one GWD schemes, we should create a new file called GFS_GWD_generic.F90. It should at least contain what is in gwdps_pre_run in gwdps.f and maybe more, depending on what we find out from VAY about the diagnostics and tendencies code in GFS_physics_driver.F90.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. thx!

endif


! Not sure how to add this part: tendencies from multiple parameterizations
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a mess (not your fault). The updating of the state is done in an interstitial (something like GFS_suite_stateout_update in GFS_suite_interstitial.F90). I don't know why VAY didn't just add to the dtdt, dudt, dvdt variables that already had accumulated tendencies.

PdVdt(i,k) =(Stateout%gv0(i,k)-dVdt(i,k)) * frain/dtp
PdTdt(i,k) =(Stateout%gt0(i,k)-dTdt(i,k)) * frain/dtp

!WL* don't quite understand what they are (haven't defined them in typedefs)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are multiple sections of GFS_physics_driver.F90 that would need to go into separate "post" interstitial schemes if we were to just make what VAY wrote CCPP-compliant since they need to be called at specific times within the execution of the suite. I'd like to avoid that. We need to figure out exactly what VAY is trying to accomplish when ldiag_ugwp is T to try to do it cleaner in CCPP. Lines 3729-3731 would be yet another little interstitial scheme.

@bluefinweiwei
Copy link
Copy Markdown
Collaborator Author

Note has been taken for the comments about diag. This fork is a little messy due to my poor git skill. I've created another fork "ugwp" and will submit a PR for it and close the PR for "cires_ugwp" soon.

@bluefinweiwei bluefinweiwei deleted the cires_ugwp branch April 1, 2019 22:57
dustinswales added a commit to dustinswales/ccpp-physics that referenced this pull request Oct 22, 2024
First reconciliation PR from production/RRFS.v1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants