diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 8a3a75903..d6bfc1573 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 8a3a75903de68ae15527f116087ff2020e86d717 +Subproject commit d6bfc1573d34cb2df20fe658568d9cca5232565d diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index 3ebc40edc..2eafbd952 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -105,10 +105,6 @@ add_subdirectory(physics) add_library( fv3ccpp - data/CCPP_typedefs.F90 - data/GFS_typedefs.F90 - data/CCPP_data.F90 - driver/GFS_diagnostics.F90 driver/GFS_restart.F90 driver/GFS_init.F90 diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index a1a4db794..cd01dbbc8 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -2929,7 +2929,7 @@ subroutine coupling_create (Coupling, IM, Model) endif !--- stochastic physics option - if (Model%do_sppt .or. Model%ca_global)then + if (Model%do_sppt .or. Model%ca_global) then allocate (Coupling%sppt_wts (IM,Model%levs)) Coupling%sppt_wts = clear_val endif diff --git a/ccpp/driver/GFS_diagnostics.F90 b/ccpp/driver/GFS_diagnostics.F90 index be79b5963..529700ca9 100644 --- a/ccpp/driver/GFS_diagnostics.F90 +++ b/ccpp/driver/GFS_diagnostics.F90 @@ -2031,27 +2031,29 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop enddo endif - idx = idx + 1 - ExtDiag(idx)%axes = 3 - ExtDiag(idx)%name = 'skebu_wts' - ExtDiag(idx)%desc = 'perturbation velocity' - ExtDiag(idx)%unit = 'm/s' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%skebu_wts(:,:) - enddo + if (Model%do_skeb) then + idx = idx + 1 + ExtDiag(idx)%axes = 3 + ExtDiag(idx)%name = 'skebu_wts' + ExtDiag(idx)%desc = 'perturbation velocity' + ExtDiag(idx)%unit = 'm/s' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%skebu_wts(:,:) + enddo - idx = idx + 1 - ExtDiag(idx)%axes = 3 - ExtDiag(idx)%name = 'skebv_wts' - ExtDiag(idx)%desc = 'perturbation velocity' - ExtDiag(idx)%unit = 'm/s' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%skebv_wts(:,:) - enddo + idx = idx + 1 + ExtDiag(idx)%axes = 3 + ExtDiag(idx)%name = 'skebv_wts' + ExtDiag(idx)%desc = 'perturbation velocity' + ExtDiag(idx)%unit = 'm/s' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%skebv_wts(:,:) + enddo + endif idx = idx + 1 ExtDiag(idx)%axes = 2 @@ -2085,115 +2087,123 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%refdmax263k(:) enddo - idx = idx + 1 - ExtDiag(idx)%axes = 3 - ExtDiag(idx)%name = 'sppt_wts' - ExtDiag(idx)%desc = 'perturbation velocity' - ExtDiag(idx)%unit = 'm/s' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%sppt_wts(:,:) - enddo + if (Model%do_sppt .or. Model%ca_global) then + idx = idx + 1 + ExtDiag(idx)%axes = 3 + ExtDiag(idx)%name = 'sppt_wts' + ExtDiag(idx)%desc = 'perturbation velocity' + ExtDiag(idx)%unit = 'm/s' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%sppt_wts(:,:) + enddo + endif - idx = idx + 1 - ExtDiag(idx)%axes = 3 - ExtDiag(idx)%name = 'shum_wts' - ExtDiag(idx)%desc = 'perturbation velocity' - ExtDiag(idx)%unit = 'm/s' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%shum_wts(:,:) - enddo + if (Model%do_shum) then + idx = idx + 1 + ExtDiag(idx)%axes = 3 + ExtDiag(idx)%name = 'shum_wts' + ExtDiag(idx)%desc = 'perturbation velocity' + ExtDiag(idx)%unit = 'm/s' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%shum_wts(:,:) + enddo + endif - idx = idx + 1 - ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'sfc_wts1' - ExtDiag(idx)%desc = 'perturbation amplitude' - ExtDiag(idx)%unit = 'none' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%sfc_wts(:,1) - enddo + if (Model%lndp_type /= 0) then + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'sfc_wts1' + ExtDiag(idx)%desc = 'perturbation amplitude' + ExtDiag(idx)%unit = 'none' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%sfc_wts(:,1) + enddo - idx = idx + 1 - ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'sfc_wts2' - ExtDiag(idx)%desc = 'perturbation amplitude' - ExtDiag(idx)%unit = 'none' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%sfc_wts(:,2) - enddo + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'sfc_wts2' + ExtDiag(idx)%desc = 'perturbation amplitude' + ExtDiag(idx)%unit = 'none' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%sfc_wts(:,2) + enddo + endif - idx = idx + 1 - ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'ca1' - ExtDiag(idx)%desc = 'Cellular Automata' - ExtDiag(idx)%unit = '%' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca1(:) - enddo + if (Model%do_ca) then + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'ca1' + ExtDiag(idx)%desc = 'Cellular Automata' + ExtDiag(idx)%unit = '%' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca1(:) + enddo - idx = idx + 1 - ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'ca_deep' - ExtDiag(idx)%desc = 'CA deep conv' - ExtDiag(idx)%unit = '%' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_deep(:) - enddo + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'ca_deep' + ExtDiag(idx)%desc = 'CA deep conv' + ExtDiag(idx)%unit = '%' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_deep(:) + enddo - idx = idx + 1 - ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'ca_turb' - ExtDiag(idx)%desc = 'CA turbulence' - ExtDiag(idx)%unit = '%' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_turb(:) - enddo + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'ca_turb' + ExtDiag(idx)%desc = 'CA turbulence' + ExtDiag(idx)%unit = '%' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_turb(:) + enddo - idx = idx + 1 - ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'ca_shal' - ExtDiag(idx)%desc = 'CA shallow conv' - ExtDiag(idx)%unit = '%' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_shal(:) - enddo + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'ca_shal' + ExtDiag(idx)%desc = 'CA shallow conv' + ExtDiag(idx)%unit = '%' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_shal(:) + enddo - idx = idx + 1 - ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'ca_rad' - ExtDiag(idx)%desc = 'CA radiation' - ExtDiag(idx)%unit = '%' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_rad(:) - enddo + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'ca_rad' + ExtDiag(idx)%desc = 'CA radiation' + ExtDiag(idx)%unit = '%' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_rad(:) + enddo - idx = idx + 1 - ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'ca_micro' - ExtDiag(idx)%desc = 'CA microphys' - ExtDiag(idx)%unit = '%' - ExtDiag(idx)%mod_name = 'gfs_phys' - allocate (ExtDiag(idx)%data(nblks)) - do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_micro(:) - enddo + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'ca_micro' + ExtDiag(idx)%desc = 'CA microphys' + ExtDiag(idx)%unit = '%' + ExtDiag(idx)%mod_name = 'gfs_phys' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%ca_micro(:) + enddo + endif if (Model%ldiag_ugwp) THEN ! diff --git a/ccpp/physics b/ccpp/physics index d18964278..b8b7c3154 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d189642784545b7edfeebace7b972fea25f42e20 +Subproject commit b8b7c3154b633a372c79a09c556e54743f0d2c7e diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index 7b1becf10..157e51102 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -175,15 +175,25 @@ subroutine FV3GFS_GFS_checksum (Model, GFS_Data, Atm_block) ntr = size(GFS_Data(1)%Statein%qgrs,3) + nsfcprop2d = 93 if (Model%lsm == Model%lsm_noahmp) then - nsfcprop2d = 156 + nsfcprop2d = nsfcprop2d + 49 + if (Model%use_cice_alb) then + nsfcprop2d = nsfcprop2d + 4 + endif elseif (Model%lsm == Model%lsm_ruc) then - nsfcprop2d = 125 + nsfcprop2d = nsfcprop2d + 4 + 12 if (Model%rdlai) then nsfcprop2d = nsfcprop2d + 1 endif else - nsfcprop2d = 107 + if (Model%use_cice_alb) then + nsfcprop2d = nsfcprop2d + 4 + endif + endif + + if (Model%nstf_name(1) > 0) then + nsfcprop2d = nsfcprop2d + 16 endif allocate (temp2d(isc:iec,jsc:jec,nsfcprop2d+Model%ntot3d+Model%nctp)) @@ -316,14 +326,14 @@ subroutine FV3GFS_GFS_checksum (Model, GFS_Data, Atm_block) temp2d(i,j,92) = GFS_Data(nb)%Sfcprop%emis_ice(ix) temp2d(i,j,93) = GFS_Data(nb)%Sfcprop%sncovr_ice(ix) - idx_opt = 93 + idx_opt = 94 if (Model%use_cice_alb .or. Model%lsm == Model%lsm_ruc) then - temp2d(i,j,idx_opt+1) = GFS_Data(nb)%Sfcprop%albdirvis_ice(ix) - temp2d(i,j,idx_opt+2) = GFS_Data(nb)%Sfcprop%albdirnir_ice(ix) - temp2d(i,j,idx_opt+3) = GFS_Data(nb)%Sfcprop%albdifvis_ice(ix) - temp2d(i,j,idx_opt+4) = GFS_Data(nb)%Sfcprop%albdifnir_ice(ix) + temp2d(i,j,idx_opt) = GFS_Data(nb)%Sfcprop%albdirvis_ice(ix) + temp2d(i,j,idx_opt+1) = GFS_Data(nb)%Sfcprop%albdirnir_ice(ix) + temp2d(i,j,idx_opt+2) = GFS_Data(nb)%Sfcprop%albdifvis_ice(ix) + temp2d(i,j,idx_opt+3) = GFS_Data(nb)%Sfcprop%albdifnir_ice(ix) + idx_opt = idx_opt + 4 endif - idx_opt = idx_opt + 5 if (Model%lsm == Model%lsm_noahmp) then temp2d(i,j,idx_opt) = GFS_Data(nb)%Sfcprop%snowxy(ix) @@ -390,7 +400,7 @@ subroutine FV3GFS_GFS_checksum (Model, GFS_Data, Atm_block) temp2d(i,j,idx_opt+9) = GFS_Data(nb)%Sfcprop%sfalb_lnd(ix) temp2d(i,j,idx_opt+10) = GFS_Data(nb)%Sfcprop%sfalb_lnd_bck(ix) temp2d(i,j,idx_opt+11) = GFS_Data(nb)%Sfcprop%sfalb_ice(ix) - idx_opt = idx_opt + 11 + idx_opt = idx_opt + 12 if (Model%rdlai) then temp2d(i,j,idx_opt+1) = GFS_Data(nb)%Sfcprop%xlaixy(ix) idx_opt = idx_opt + 1