From 22da826aebc06569fb1e085f2568ea1f17165369 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 13 Jul 2018 19:28:10 -0600 Subject: [PATCH 1/3] update gmtb_scm_type_defs.f90 for scnv interstitial changes --- scm/src/gmtb_scm_type_defs.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scm/src/gmtb_scm_type_defs.f90 b/scm/src/gmtb_scm_type_defs.f90 index b4e413db9..ab9195440 100644 --- a/scm/src/gmtb_scm_type_defs.f90 +++ b/scm/src/gmtb_scm_type_defs.f90 @@ -489,7 +489,7 @@ module gmtb_scm_type_defs !! | physics%Model(i)%uni_cld | | flag for clouds in grrad | | 0 | logical | | none | F | !! | physics%Model(i)%h2o_phys | | flag for stratosphere h2o | | 0 | logical | | none | F | !! | physics%Model(i)%pdfcld | | flag for pdfcld | | 0 | logical | | none | F | -!! | physics%Model(i)%shcnvcw | | flag for shallow convective cloud | | 0 | logical | | none | F | +!! | physics%Model(i)%shcnvcw | flag_shallow_convective_cloud | flag for shallow convective cloud | | 0 | logical | | none | F | !! | physics%Model(i)%redrag | flag_for_reduced_drag_coefficient_over_sea | flag for reduced drag coeff. over sea | flag | 0 | logical | | none | F | !! | physics%Model(i)%hybedmf | | flag for hybrid edmf pbl scheme | | 0 | logical | | none | F | !! | physics%Model(i)%dspheat | flag_TKE_dissipation_heating | flag for tke dissipative heating | flag | 0 | logical | | none | F | @@ -720,9 +720,11 @@ module gmtb_scm_type_defs !! | physics%Diag(i)%dt3dt | | temperature change due to physics | | 3 | real | kind_phys | none | F | !! | physics%Diag(i)%dt3dt(:,:,2) | cumulative_change_in_temperature_due_to_surface_processes | cumulative change in temperature due to surface processes | K | 2 | real | kind_phys | none | F | !! | physics%Diag(i)%dt3dt(:,:,4) | cumulative_change_in_temperature_due_to_deep_convection | cumulative change in temperature due to deep conv. | K | 2 | real | kind_phys | none | F | +!! | physics%Diag(i)%dt3dt(:,:,5) | cumulative_change_in_temperature_due_to_shal_convection | cumulative change in temperature due to shal conv. | K | 2 | real | kind_phys | none | F | !! | physics%Diag(i)%dt3dt(:,:,6) | large_scale_condensate_heating_rate_at_model_layers | large scale condensate heating rate at model layers | K s-1 | 2 | real | kind_phys | none | F | !! | physics%Diag(i)%dq3dt | | moisture change due to physics | | 3 | real | kind_phys | none | F | !! | physics%Diag(i)%dq3dt(:,:,2) | cumulative_change_in_water_vapor_specific_humidity_due_to_deep_convection | cumulative change in water vapor specific humidity due to deep conv. | kg kg-1 | 2 | real | kind_phys | none | F | +!! | physics%Diag(i)%dq3dt(:,:,3) | cumulative_change_in_water_vapor_specific_humidity_due_to_shal_convection | cumulative change in water vapor specific humidity due to shal conv. | kg kg-1 | 2 | real | kind_phys | none | F | !! | physics%Diag(i)%dq3dt(:,:,4) | large_scale_condensate_moistening_rate_at_model_layers | large scale condensate moistening rate at model layers | kg kg-1 s-1 | 2 | real | kind_phys | none | F | !! | physics%Diag(i)%upd_mf | cumulative_atmosphere_updraft_convective_mass_flux | cumulative updraft mass flux | Pa | 2 | real | kind_phys | none | F | !! | physics%Diag(i)%dwn_mf | cumulative_atmosphere_downdraft_convective_mass_flux | cumulative downdraft mass flux | Pa | 2 | real | kind_phys | none | F | From 83332c2d8ab801b51655ea7ab4dee22290bb8218 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 20 Jul 2018 21:08:18 -0600 Subject: [PATCH 2/3] updated gmtb_scm_type_defs.f90 and GFS_typedefs.F90 for tracer index code changes --- ccpp-framework | 2 +- ccpp-physics | 2 +- scm/src/GFS_typedefs.F90 | 125 ++++++++++++++++++++++++--------- scm/src/gmtb_scm_type_defs.f90 | 2 + 4 files changed, 94 insertions(+), 37 deletions(-) diff --git a/ccpp-framework b/ccpp-framework index 53380261f..25bf400ba 160000 --- a/ccpp-framework +++ b/ccpp-framework @@ -1 +1 @@ -Subproject commit 53380261fa0e41166cc6732860e853e3679bb4f1 +Subproject commit 25bf400ba3f93d8a4a07ece1e44ad31726da5f1d diff --git a/ccpp-physics b/ccpp-physics index b8f3701e3..b7c355dc0 160000 --- a/ccpp-physics +++ b/ccpp-physics @@ -1 +1 @@ -Subproject commit b8f3701e3ee5fc88111bf703d9b7e7a6ee5d6c75 +Subproject commit b7c355dc0d56b1a6c2fd2b557c702acc8255b93c diff --git a/scm/src/GFS_typedefs.F90 b/scm/src/GFS_typedefs.F90 index 61c638a73..e6e1d0007 100644 --- a/scm/src/GFS_typedefs.F90 +++ b/scm/src/GFS_typedefs.F90 @@ -1062,14 +1062,19 @@ module GFS_typedefs integer :: lmk !< integer :: lmp !< integer, pointer :: mbota(:,:) => null() !< + logical :: mg3_as_mg2 !< integer, pointer :: mtopa(:,:) => null() !< + integer :: ncstrac !< integer :: nday !< + integer :: nn !< + integer :: nncl !< integer :: nsamftrac !< integer :: ntk !< integer :: nvdiff !< real (kind=kind_phys), pointer :: oa4(:,:) => null() !< real (kind=kind_phys), pointer :: oc(:) => null() !< real (kind=kind_phys), pointer :: olyr(:,:) => null() !< + logical , pointer :: otspt(:,:) => null() !< integer :: oz_coeff !< real (kind=kind_phys), pointer :: oz_pres(:) => null() !< real (kind=kind_phys), pointer :: plvl(:,:) => null() !< @@ -3289,8 +3294,9 @@ subroutine interstitial_create (Interstitial, IM, Model) integer, intent(in) :: IM type(GFS_control_type), intent(in) :: Model ! - ! Set up numbers of tracers for water etc - previously interstitial code: sets - ! Interstitial%{tracers_water,tracers_total,tracers_start_index,ntk} + allocate (Interstitial%otspt (Model%ntrac+1,2)) + ! Set up numbers of tracers for PBL, convection, etc: sets + ! Interstitial%{nncl,nvdiff,mg3_as_mg2,nn,tracers_total,ntk,otspt,nsamftrac,ncstrac} call interstitial_setup_tracers(Interstitial, Model) ! Allocate arrays allocate (Interstitial%adjnirbmd (IM)) @@ -3315,7 +3321,7 @@ subroutine interstitial_create (Interstitial, IM, Model) allocate (Interstitial%cldsa (IM,5)) allocate (Interstitial%cld1d (IM)) allocate (Interstitial%clouds (IM,Model%levr+LTP,NF_CLDS)) - allocate (Interstitial%clw (IM,Model%levs,Interstitial%tracers_total+2)) + allocate (Interstitial%clw (IM,Model%levs,Interstitial%nn)) allocate (Interstitial%clx (IM,4)) allocate (Interstitial%cnvc (IM,Model%levs)) allocate (Interstitial%cnvw (IM,Model%levs)) @@ -3442,7 +3448,6 @@ subroutine interstitial_create (Interstitial, IM, Model) Interstitial%lm = Model%levr Interstitial%lmk = Model%levr+LTP Interstitial%lmp = Model%levr+1+LTP - Interstitial%nvdiff = Model%ntrac Interstitial%oz_coeff = oz_coeff Interstitial%oz_pres = oz_pres Interstitial%skip_macro = .false. @@ -3458,40 +3463,91 @@ subroutine interstitial_setup_tracers(Interstitial, Model) ! class(GFS_interstitial_type) :: Interstitial type(GFS_control_type), intent(in) :: Model - ! - ! DH* 20180517 - ! CHECK IF THIS ROUTINE IS STILL CORRECT - INDICES MIGHT HAVE CHANGED ETC - ! IS PART OF INTERSTITIAL CODE IN GFS_PHYSICS_DRIVER.F90 I BELIEVE - ! *DH - ! - Interstitial%tracers_water = 0 - Interstitial%tracers_total = 0 - Interstitial%tracers_start_index = 0 - ! - Interstitial%ntk = 0 - ! - if (Model%trans_trac .or. Model%cscnv) then - ! - if (Model%ntcw > 0) then - if (Model%ntoz < Model%ntcw) then - Interstitial%tracers_start_index = Model%ntcw + Model%ncld - 1 - else - Interstitial%tracers_start_index = Model%ntoz + integer :: n, tracers + + !first, initialize the values (in case the values don't get initialized within if statements below) + Interstitial%nncl = Model%ncld + Interstitial%nvdiff = Model%ntrac + Interstitial%mg3_as_mg2 = .false. + Interstitial%nn = Model%ntrac + 1 + Interstitial%ntk = 0 + Interstitial%tracers_total = 0 + Interstitial%otspt(:,:) = .true. + Interstitial%nsamftrac = 0 + Interstitial%ncstrac = 0 + + ! GF* 20180712 moved from GFS_physics_driver.F90 + if (Model%imp_physics == Model%imp_physics_thompson) then + if (Model%ltaerosol) then + Interstitial%nvdiff = 8 + else + Interstitial%nvdiff = 5 + endif + Interstitial%nncl = 5 + elseif (Model%imp_physics == 6) then + Interstitial%nvdiff = Model%ntrac -3 + Interstitial%nncl = 5 + elseif (Model%ntclamt > 0) then ! for GFDL MP don't diffuse cloud amount + Interstitial%nvdiff = Model%ntrac - 1 + endif + + if (Model%imp_physics == 10) then + if (abs(Model%fprcp) == 1) then + Interstitial%nncl = 4 ! MG2 with rain and snow + Interstitial%mg3_as_mg2 = .false. + elseif (Model%fprcp >= 2) then + if(Model%ntgl > 0 .and. (Model%mg_do_graupel .or. Model%mg_do_hail)) then + Interstitial%nncl = 5 ! MG3 with rain and snow and grapuel/hail + Interstitial%mg3_as_mg2 = .false. + else ! MG3 code run without graupel/hail i.e. as MG2 + Interstitial%nncl = 4 + Interstitial%mg3_as_mg2 = .true. endif - elseif (Model%ntoz > 0) then - Interstitial%tracers_start_index = Model%ntoz + endif + endif + ! *GF + ! DH* NEW CODE 20180626 + if (Model%ntiw > 0) then + if (Model%ntclamt > 0) then + Interstitial%nn = Model%ntrac - 2 else - Interstitial%tracers_start_index = 1 + Interstitial%nn = Model%ntrac - 1 endif - ! - Interstitial%tracers_water = Model%ntrac - Interstitial%tracers_start_index - Interstitial%tracers_total = Interstitial%tracers_water - ! - if (Model%ntoz > 0) Interstitial%tracers_total = Interstitial%tracers_total + 1 ! ozone is added separately - ! + elseif (Model%ntcw > 0) then + Interstitial%nn = Model%ntrac + else + Interstitial%nn = Model%ntrac + 1 endif - ! - if (Model%ntke > 0) Interstitial%ntk = Model%ntke - Interstitial%tracers_start_index + 3 + ! *DH END NEW CODE 20180626 + ! GF* 20180712 moved from GFS_physics_driver.F90 + if (Model%cscnv .or. Model%satmedmf .or. Model%trans_trac ) then + Interstitial%otspt(:,:) = .true. ! otspt is used only for cscnv + Interstitial%otspt(1:3,:) = .false. ! this is for sp.hum, ice and liquid water + tracers = 2 + do n=2,Model%ntrac + if ( n /= Model%ntcw .and. n /= Model%ntiw .and. n /= Model%ntclamt .and. & + n /= Model%ntrw .and. n /= Model%ntsw .and. n /= Model%ntrnc .and. & + n /= Model%ntsnc .and. n /= Model%ntgl .and. n /= Model%ntgnc) then + tracers = tracers + 1 + if (Model%ntke == n ) then + Interstitial%otspt(tracers+1,1) = .false. + Interstitial%ntk = tracers + endif + if (Model%ntlnc == n .or. Model%ntinc == n .or. Model%ntrnc == n .or. Model%ntsnc == n .or. Model%ntgnc == n) & +! if (ntlnc == n .or. ntinc == n .or. ntrnc == n .or. ntsnc == n .or.& +! ntrw == n .or. ntsw == n .or. ntgl == n) & + Interstitial%otspt(tracers+1,1) = .false. + endif + enddo + Interstitial%tracers_total = tracers - 2 + endif ! end if_ras or cfscnv or samf + if(.not. Model%satmedmf .and. .not. Model%trans_trac) then + Interstitial%nsamftrac = 0 + else + Interstitial%nsamftrac = Interstitial%tracers_total + endif + Interstitial%ncstrac = Interstitial%tracers_total + 3 + ! *GF ! end subroutine interstitial_setup_tracers @@ -3615,7 +3671,6 @@ subroutine interstitial_phys_reset (Interstitial, Model) Interstitial%kinver = 0 Interstitial%kpbl = 0 Interstitial%ktop = 0 - Interstitial%nsamftrac = 0 Interstitial%oa4 = clear_val Interstitial%oc = clear_val Interstitial%qss = clear_val diff --git a/scm/src/gmtb_scm_type_defs.f90 b/scm/src/gmtb_scm_type_defs.f90 index 30ed61a47..5a62cc338 100644 --- a/scm/src/gmtb_scm_type_defs.f90 +++ b/scm/src/gmtb_scm_type_defs.f90 @@ -311,6 +311,8 @@ module gmtb_scm_type_defs !! | physics%Interstitial(i)%mbota | model_layer_number_at_cloud_base | vertical indices for low, middle and high cloud bases | index | 2 | integer | | none | F | !! | physics%Interstitial(i)%mtopa | model_layer_number_at_cloud_top | vertical indices for low, middle and high cloud tops | index | 2 | integer | | none | F | !! | physics%Interstitial(i)%nday | daytime_points_dimension | daytime points dimension | count | 0 | integer | | none | F | +!! | physics%Interstitial(i)%nn | number_of_tracers_for_allocating_cloud_work_function | number of tracers for allocating cloud work function | count | 0 | integer | | none | F | +!! | physics%Interstitial(i)%nncl | number_of_tracers_for_cloud_condensate | number of tracers for cloud condensate | count | 0 | integer | | none | F | !! | physics%Interstitial(i)%nsamftrac | number_of_tracers_for_samf | number of tracers for scale-aware mass flux schemes | count | 0 | integer | | none | F | !! | physics%Interstitial(i)%ntk | index_of_TKE_convective_transport_tracer | index of TKE in the convectively transported tracer array | index | 0 | integer | | none | F | !! | physics%Interstitial(i)%nvdiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | none | F | From bcb5c6209b7a4b7ed6e33977917d0e31eaa0817c Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 20 Jul 2018 21:13:56 -0600 Subject: [PATCH 3/3] added some forgotten metadata table information for tracer index changes --- scm/src/gmtb_scm_type_defs.f90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scm/src/gmtb_scm_type_defs.f90 b/scm/src/gmtb_scm_type_defs.f90 index 5a62cc338..5087ef889 100644 --- a/scm/src/gmtb_scm_type_defs.f90 +++ b/scm/src/gmtb_scm_type_defs.f90 @@ -309,7 +309,9 @@ module gmtb_scm_type_defs !! | physics%Interstitial(i)%lmk | adjusted_vertical_layer_dimension_for_radiation | adjusted number of vertical layers for radiation | count | 0 | integer | | none | F | !! | physics%Interstitial(i)%lmp | adjusted_vertical_level_dimension_for_radiation | adjusted number of vertical levels for radiation | count | 0 | integer | | none | F | !! | physics%Interstitial(i)%mbota | model_layer_number_at_cloud_base | vertical indices for low, middle and high cloud bases | index | 2 | integer | | none | F | +!! | physics%Interstitial(i)%mg3_as_mg2 | flag_mg3_as_mg2 | flag for controlling prep for Morrison-Gettleman microphysics | flag | 0 | logical | | none | F | !! | physics%Interstitial(i)%mtopa | model_layer_number_at_cloud_top | vertical indices for low, middle and high cloud tops | index | 2 | integer | | none | F | +!! | physics%Interstitial(i)%ncstrac | number_of_tracers_for_CS | number of convectively transported tracers in Chikira-Sugiyama deep conv. scheme | count | 0 | integer | | none | F | !! | physics%Interstitial(i)%nday | daytime_points_dimension | daytime points dimension | count | 0 | integer | | none | F | !! | physics%Interstitial(i)%nn | number_of_tracers_for_allocating_cloud_work_function | number of tracers for allocating cloud work function | count | 0 | integer | | none | F | !! | physics%Interstitial(i)%nncl | number_of_tracers_for_cloud_condensate | number of tracers for cloud condensate | count | 0 | integer | | none | F | @@ -319,6 +321,7 @@ module gmtb_scm_type_defs !! | physics%Interstitial(i)%oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | none | F | !! | physics%Interstitial(i)%oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | none | F | !! | physics%Interstitial(i)%olyr | ozone_concentration_at_layer_for_radiation | ozone concentration layer | kg kg-1 | 2 | real | kind_phys | none | F | +!! | physics%Interstitial(i)%otspt | | | none | 2 | logical | | none | F | !! | physics%Interstitial(i)%oz_coeff | number_of_coefficients_in_ozone_forcing_data | number of coefficients in ozone forcing data | index | 0 | integer | | none | F | !! | physics%Interstitial(i)%oz_pres | natural_log_of_ozone_forcing_data_pressure_levels | natural log of ozone forcing data pressure levels | log(Pa) | 1 | real | kind_phys | none | F | !! | physics%Interstitial(i)%plvl | air_pressure_at_interface_for_radiation_in_hPa | air pressure at vertical interface for radiation calculation | hPa | 2 | real | kind_phys | none | F |