From e198c5252ac222be5f5d1a3b1fea138f70fe4421 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Tue, 5 Nov 2019 15:51:23 +0000 Subject: [PATCH 01/12] this PR includes: 1)vlab #69814: post update,2)ufs issue #3, Add 3D reflectivity to restart file and restart reproducibility for regional fv3,3)ufs issue #5, Updates to WW3, 4)vlab #69735, update netcdf time units attribute when iau_offset --- .gitmodules | 4 +-- atmos_cubed_sphere | 2 +- gfsphysics/GFS_layer/GFS_physics_driver.F90 | 2 +- gfsphysics/GFS_layer/GFS_restart.F90 | 11 +++++- gfsphysics/GFS_layer/GFS_typedefs.F90 | 12 ++++++- io/FV3GFS_io.F90 | 9 ++--- io/module_write_netcdf.F90 | 39 ++++++++++++++++++--- io/module_wrt_grid_comp.F90 | 4 +-- io/post_gfs.F90 | 32 +++++++++++++---- 9 files changed, 90 insertions(+), 25 deletions(-) diff --git a/.gitmodules b/.gitmodules index 949d298df..04f5ebec0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/junwang-noaa/GFDL_atmos_cubed_sphere + branch = regfv3_rst [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 786447c83..cc28aa5aa 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 786447c8391a6806cd7b869bfa9dca69e3c95a48 +Subproject commit cc28aa5aa94817b24aea033cc19c1792e5927459 diff --git a/gfsphysics/GFS_layer/GFS_physics_driver.F90 b/gfsphysics/GFS_layer/GFS_physics_driver.F90 index 401fbbf86..5b67f7faa 100644 --- a/gfsphysics/GFS_layer/GFS_physics_driver.F90 +++ b/gfsphysics/GFS_layer/GFS_physics_driver.F90 @@ -1149,7 +1149,7 @@ subroutine GFS_physics_driver & if (fice(i) < one) then wet(i) = .true. ! Sfcprop%tsfco(i) = tgice - Sfcprop%tsfco(i) = max(Sfcprop%tisfc(i), tgice) + if (.not. Model%cplflx) Sfcprop%tsfco(i) = max(Sfcprop%tisfc(i), tgice) ! Sfcprop%tsfco(i) = max((Sfcprop%tsfc(i) - fice(i)*sfcprop%tisfc(i)) & ! / (one - fice(i)), tgice) endif diff --git a/gfsphysics/GFS_layer/GFS_restart.F90 b/gfsphysics/GFS_layer/GFS_restart.F90 index eafbcb9ba..a24cc0fc6 100644 --- a/gfsphysics/GFS_layer/GFS_restart.F90 +++ b/gfsphysics/GFS_layer/GFS_restart.F90 @@ -117,6 +117,9 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & #endif Restart%num3d = Model%ntot3d + if(Model%lrefres) then + Restart%num3d = Model%ntot3d+1 + endif #ifdef CCPP ! GF if (Model%imfdeepcnv == 3) then @@ -252,7 +255,13 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & Restart%data(nb,num)%var3p => Tbd(nb)%phy_f3d(:,:,num) enddo enddo - + if (Model%lrefres) then + num = Model%ntot3d+1 + restart%name3d(num) = 'ref_f3d' + do nb = 1,nblks + Restart%data(nb,num)%var3p => IntDiag(nb)%refl_10cm(:,:) + enddo + endif #ifdef CCPP !--- RAP/HRRR-specific variables, 3D num = Model%ntot3d diff --git a/gfsphysics/GFS_layer/GFS_typedefs.F90 b/gfsphysics/GFS_layer/GFS_typedefs.F90 index 7f8239a5a..39520b0d4 100644 --- a/gfsphysics/GFS_layer/GFS_typedefs.F90 +++ b/gfsphysics/GFS_layer/GFS_typedefs.F90 @@ -701,6 +701,9 @@ module GFS_typedefs !--- GFDL microphysical paramters logical :: lgfdlmprad !< flag for GFDL mp scheme and radiation consistency + !--- Thompson,GFDL mp parameter + logical :: lrefres !< flag for radar reflectivity in restart file + !--- land/surface model parameters integer :: lsm !< flag for land surface model lsm=1 for noah lsm integer :: lsm_noah=1 !< flag for NOAH land surface model @@ -2740,6 +2743,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- GFDL microphysical parameters logical :: lgfdlmprad = .false. !< flag for GFDLMP radiation interaction + !--- Thompson,GFDL microphysical parameter + logical :: lrefres = .false. !< flag for radar reflectivity in restart file + !--- land/surface model parameters integer :: lsm = 1 !< flag for land surface model to use =0 for osu lsm; =1 for noah lsm; =2 for noah mp lsm; =3 for RUC lsm integer :: lsoil = 4 !< number of soil layers @@ -3023,7 +3029,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & mg_do_graupel, mg_do_hail, mg_nccons, mg_nicons, mg_ngcons, & mg_ncnst, mg_ninst, mg_ngnst, sed_supersat, do_sb_physics, & mg_alf, mg_qcmin, mg_do_ice_gmao, mg_do_liq_liu, & - ltaerosol, lradar, ttendlim, lgfdlmprad, & + ltaerosol, lradar, lrefres, ttendlim, lgfdlmprad, & !--- max hourly avg_max_length, & !--- land/surface model control @@ -3312,6 +3318,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%ttendlim = ttendlim !--- gfdl MP parameters Model%lgfdlmprad = lgfdlmprad +!--- Thompson,GFDL MP parameter + Model%lrefres = lrefres !--- land/surface model parameters Model%lsm = lsm @@ -4310,6 +4318,7 @@ subroutine control_print(Model) print *, ' Thompson microphysical parameters' print *, ' ltaerosol : ', Model%ltaerosol print *, ' lradar : ', Model%lradar + print *, ' lrefres : ', Model%lrefres print *, ' ttendlim : ', Model%ttendlim print *, ' ' endif @@ -4327,6 +4336,7 @@ subroutine control_print(Model) if (Model%imp_physics == Model%imp_physics_gfdl) then print *, ' GFDL microphysical parameters' print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad + print *, ' lrefres : ', Model%lrefres print *, ' ' endif diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index 3e7b7d2e7..e7f7dbd57 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -1119,15 +1119,10 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) Sfcprop(nb)%zorll(ix) = Sfcprop(nb)%zorlo(ix) Sfcprop(nb)%zorl(ix) = Sfcprop(nb)%zorlo(ix) Sfcprop(nb)%tsfc(ix) = Sfcprop(nb)%tsfco(ix) - if (Sfcprop(nb)%slmsk(ix) < 0.1 .or. Sfcprop(nb)%slmsk(ix) > 1.9) then + if (Sfcprop(nb)%slmsk(ix) > 1.9) then Sfcprop(nb)%landfrac(ix) = 0.0 - if (Sfcprop(nb)%oro_uf(ix) > 0.01) then - Sfcprop(nb)%lakefrac(ix) = 1.0 ! lake - else - Sfcprop(nb)%lakefrac(ix) = 0.0 ! ocean - endif else - Sfcprop(nb)%landfrac(ix) = 1.0 ! land + Sfcprop(nb)%landfrac(ix) = Sfcprop(nb)%slmsk(ix) endif enddo enddo diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index 1fce3d8b9..5de1362af 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -22,7 +22,7 @@ module module_write_netcdf contains !---------------------------------------------------------------------------------------- - subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, rc) + subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, idate, rc) ! type(ESMF_FieldBundle), intent(in) :: fieldbundle type(ESMF_FieldBundle), intent(in) :: wrtfb @@ -30,6 +30,7 @@ subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, rc integer, intent(in) :: mpi_comm integer, intent(in) :: mype integer, intent(in) :: im, jm + integer, intent(in) :: idate(7) integer, optional,intent(out) :: rc ! !** local vars @@ -146,7 +147,7 @@ subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, rc call add_dim(ncid, "phalf", phalf_dimid, wrtgrid, rc) end if - call add_dim(ncid, "time", time_dimid, wrtgrid, rc) + call add_dim(ncid, "time", time_dimid, wrtgrid, rc, idate=idate) call get_global_attr(wrtfb, ncid, rc) @@ -503,11 +504,12 @@ subroutine get_grid_attr(grid, prefix, ncid, varid, rc) end subroutine get_grid_attr - subroutine add_dim(ncid, dim_name, dimid, grid, rc) + subroutine add_dim(ncid, dim_name, dimid, grid, idate, rc) integer, intent(in) :: ncid character(len=*), intent(in) :: dim_name - integer, intent(inout) :: dimid + integer, intent(inout) :: dimid type(ESMF_Grid), intent(in) :: grid + integer, intent(in), optional :: idate(7) integer, intent(out) :: rc ! local variable @@ -556,9 +558,38 @@ subroutine add_dim(ncid, dim_name, dimid, grid, rc) call get_grid_attr(grid, dim_name, ncid, dim_varid, rc) + ! if write grid comp changes time units + if ( present (idate) ) then + if ( trim(dim_name) == "time") then + ncerr = nf90_get_att(ncid, dim_varid, 'units', time_units); NC_ERR_STOP(ncerr) + time_units = get_time_units_from_idate(idate) + ncerr = nf90_put_att(ncid, dim_varid, 'units', trim(time_units)); NC_ERR_STOP(ncerr) + endif + endif + end subroutine add_dim ! !---------------------------------------------------------------------------------------- + function get_time_units_from_idate(idate, time_measure) result(time_units) + ! create time units attribute of form 'hours since YYYY-MM-DD HH:MM:SS' + ! from integer array with year,month,day,hour,minute,second + ! optional argument 'time_measure' can be used to change 'hours' to + ! 'days', 'minutes', 'seconds' etc. + character(len=*), intent(in), optional :: time_measure + integer, intent(in) :: idate(7) + character(len=12) :: timechar + character(len=nf90_max_name) :: time_units + if (present(time_measure)) then + timechar = trim(time_measure) + else + timechar = 'hours' + endif + write(time_units,101) idate(1:6) +101 format(' since ',i4.4,'-',i2.2,'-',i2.2,' ',& + i2.2,':',i2.2,':',i2.2) + time_units = trim(adjustl(timechar))//time_units + end function get_time_units_from_idate +! subroutine nccheck(status) use netcdf implicit none diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index d0846be53..f8546614b 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -1386,7 +1386,7 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) wbeg = MPI_Wtime() call write_netcdf(file_bundle,wrt_int_state%wrtFB(nbdl),trim(filename), & - wrt_mpi_comm,wrt_int_state%mype,imo,jmo,rc) + wrt_mpi_comm,wrt_int_state%mype,imo,jmo,idate,rc) wend = MPI_Wtime() if (lprnt) then write(*,'(A,F10.5,A,I4.2,A,I2.2)')' netcdf Write Time is ',wend-wbeg & @@ -1431,7 +1431,7 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) wbeg = MPI_Wtime() call write_netcdf(file_bundle,wrt_int_state%wrtFB(nbdl),trim(filename), & - wrt_mpi_comm,wrt_int_state%mype,imo,jmo,rc) + wrt_mpi_comm,wrt_int_state%mype,imo,jmo,idate,rc) wend = MPI_Wtime() if (mype == lead_write_task) then write(*,'(A,F10.5,A,I4.2,A,I2.2)')' netcdf Write Time is ',wend-wbeg & diff --git a/io/post_gfs.F90 b/io/post_gfs.F90 index 7b5a87026..ce6bb281e 100644 --- a/io/post_gfs.F90 +++ b/io/post_gfs.F90 @@ -451,8 +451,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & end do ! ! GFS does not output PD -! pt = 10000. ! this is for 100 hPa added by Moorthi - pt = 0. + pt = ak5(1) ! GFS may not have model derived radar ref. ! TKE @@ -1296,7 +1295,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & endif ! inst incoming sfc longwave - if(trim(fieldname)=='dlwsf') then + if(trim(fieldname)=='dlwrf') then !$omp parallel do private(i,j) do j=jsta,jend do i=ista, iend @@ -1845,6 +1844,16 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & ! time averaged surface clear sky outgoing LW if(trim(fieldname)=='csulf') then + !$omp parallel do private(i,j) + do j=jsta,jend + do i=ista, iend + alwoutc(i,j) = arrayr42d(i,j) + enddo + enddo + endif + + ! time averaged TOA clear sky outgoing LW + if(trim(fieldname)=='csulftoa') then !$omp parallel do private(i,j) do j=jsta,jend do i=ista, iend @@ -1864,7 +1873,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & endif ! time averaged TOA clear sky outgoing SW - if(trim(fieldname)=='csusf') then + if(trim(fieldname)=='csusftoa') then !$omp parallel do private(i,j) do j=jsta,jend do i=ista, iend @@ -2271,7 +2280,6 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & enddo end do -!??? reset pint(lev=1) !$omp parallel do private(i,j) do j=jsta,jend do i=1,im @@ -2282,7 +2290,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & ! print *,'in setvar, pt=',pt,'ak5(lp1)=', ak5(lp1),'ak5(1)=',ak5(1) ! compute alpint - do l=lp1,2,-1 + do l=lp1,1,-1 !$omp parallel do private(i,j) do j=jsta,jend do i=1,im @@ -2321,6 +2329,18 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & enddo enddo +! compute cwm for gfdlmp + if( imp_physics == 11 ) then + do l=1,lm +!$omp parallel do private(i,j) + do j=jsta,jend + do i=ista,iend + cwm(i,j,l)=qqg(i,j,l)+qqs(i,j,l)+qqr(i,j,l)+qqi(i,j,l)+qqw(i,j,l) + enddo + enddo + enddo + endif + ! estimate 2m pres and convert t2m to theta !$omp parallel do private(i,j) do j=jsta,jend From 0e01f028b669d94de540a798f9e019b9eef0a26e Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Wed, 6 Nov 2019 02:12:00 +0000 Subject: [PATCH 02/12] fix the add_dim interface --- io/module_write_netcdf.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index 5de1362af..0a2b63d73 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -504,17 +504,18 @@ subroutine get_grid_attr(grid, prefix, ncid, varid, rc) end subroutine get_grid_attr - subroutine add_dim(ncid, dim_name, dimid, grid, idate, rc) + subroutine add_dim(ncid, dim_name, dimid, grid, rc, idate) integer, intent(in) :: ncid character(len=*), intent(in) :: dim_name integer, intent(inout) :: dimid type(ESMF_Grid), intent(in) :: grid - integer, intent(in), optional :: idate(7) integer, intent(out) :: rc + integer, intent(in), optional :: idate(7) ! local variable integer :: i, attcount, n, dim_varid integer :: ncerr + character(255) :: time_units character(len=ESMF_MAXSTR) :: attName type(ESMF_TypeKind_Flag) :: typekind From d47965cadfa665b0353d675851e3954472fb6857 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Wed, 6 Nov 2019 20:38:00 +0000 Subject: [PATCH 03/12] update gfslmp code changes from Ruiyu --- gfsphysics/physics/gfdl_cloud_microphys.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gfsphysics/physics/gfdl_cloud_microphys.F90 b/gfsphysics/physics/gfdl_cloud_microphys.F90 index 9a1820465..ba4c814d6 100644 --- a/gfsphysics/physics/gfdl_cloud_microphys.F90 +++ b/gfsphysics/physics/gfdl_cloud_microphys.F90 @@ -4688,7 +4688,7 @@ subroutine cloud_diagnosis (is, ie, ks, ke, den, delp, lsm, qmw, qmi, qmr, qms, real :: n0r = 8.0e6, n0s = 3.0e6, n0g = 4.0e6 real :: alphar = 0.8, alphas = 0.25, alphag = 0.5 real :: gammar = 17.837789, gammas = 8.2850630, gammag = 11.631769 - real :: qmin = 1.0e-12, beta = 1.22 + real :: qmin = 1.0e-12, beta = 1.22, qmin1 = 9.e-6 do k = ks, ke do i = is, ie @@ -4718,7 +4718,7 @@ subroutine cloud_diagnosis (is, ie, ks, ke, den, delp, lsm, qmw, qmi, qmr, qms, ! cloud ice (Heymsfield and Mcfarquhar, 1996) ! ----------------------------------------------------------------------- - if (qmi (i, k) .gt. qmin) then + if (qmi (i, k) .gt. qmin1) then qci (i, k) = dpg * qmi (i, k) * 1.0e3 rei_fac = log (1.0e3 * qmi (i, k) * den (i, k)) if (t (i, k) - tice .lt. - 50) then @@ -4744,7 +4744,7 @@ subroutine cloud_diagnosis (is, ie, ks, ke, den, delp, lsm, qmw, qmi, qmr, qms, ! cloud ice (Wyser, 1998) ! ----------------------------------------------------------------------- - if (qmi (i, k) .gt. qmin) then + if (qmi (i, k) .gt. qmin1) then qci (i, k) = dpg * qmi (i, k) * 1.0e3 bw = - 2. + 1.e-3 * log10 (den (i, k) * qmi (i, k) / rho_0) * max (0.0, tice - t (i, k)) ** 1.5 rei (i, k) = 377.4 + bw * (203.3 + bw * (37.91 + 2.3696 * bw)) @@ -4774,7 +4774,7 @@ subroutine cloud_diagnosis (is, ie, ks, ke, den, delp, lsm, qmw, qmi, qmr, qms, ! snow (Lin et al., 1983) ! ----------------------------------------------------------------------- - if (qms (i, k) .gt. qmin) then + if (qms (i, k) .gt. qmin1) then qcs (i, k) = dpg * qms (i, k) * 1.0e3 lambdas = exp (0.25 * log (pi * rhos * n0s / qms (i, k) / den (i, k))) res (i, k) = 0.5 * exp (log (gammas / 6) / alphas) / lambdas * 1.0e6 From 2d737534a785579b680c5aa773a5bcc0c64c8351 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Thu, 7 Nov 2019 15:10:44 +0000 Subject: [PATCH 04/12] update satmedmfvdifq from Jongil --- gfsphysics/physics/satmedmfvdifq.f | 53 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/gfsphysics/physics/satmedmfvdifq.f b/gfsphysics/physics/satmedmfvdifq.f index 1a8be355e..11c047fd0 100644 --- a/gfsphysics/physics/satmedmfvdifq.f +++ b/gfsphysics/physics/satmedmfvdifq.f @@ -151,7 +151,7 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, & rlmn, rlmn1, rlmx, elmx, & ttend, utend, vtend, qtend, & zfac, zfmin, vk, spdk2, - & tkmin, xkzinv, xkgdx, + & tkmin, tkminx, xkzinv, xkgdx, & zlup, zldn, bsum, & tem, tem1, tem2, & ptem, ptem0, ptem1, ptem2 @@ -176,11 +176,11 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, parameter(prmin=0.25,prmax=4.0) parameter(pr0=1.0,prtke=1.0,prscu=0.67) parameter(f0=1.e-4,crbmin=0.15,crbmax=0.35) - parameter(tkmin=1.e-9,dspmax=10.0) + parameter(tkmin=1.e-9,tkminx=0.2,dspmax=10.0) parameter(qmin=1.e-8,qlmin=1.e-12,zfmin=1.e-8) parameter(aphi5=5.,aphi16=16.) parameter(elmfac=1.0,elefac=1.0,cql=100.) - parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=25000.) + parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=5000.) parameter(qlcr=3.5e-5,zstblmax=2500.,xkzinv=0.1) parameter(h1=0.33333333) parameter(ck0=0.4,ck1=0.15,ch0=0.4,ch1=0.15) @@ -273,20 +273,20 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, xkzo(i,k) = 0.0 xkzmo(i,k) = 0.0 if (k < kinver(i)) then -! vertical background diffusivity - ptem = prsi(i,k+1) * tx1(i) - tem1 = 1.0 - ptem - tem2 = tem1 * tem1 * 10.0 - tem2 = min(1.0, exp(-tem2)) - xkzo(i,k) = xkzm_hx(i) * tem2 -! +! minimum turbulent mixing length ptem = prsl(i,k) * tx1(i) tem1 = 1.0 - ptem tem2 = tem1 * tem1 * 2.5 tem2 = min(1.0, exp(-tem2)) rlmnz(i,k)= rlmn * tem2 rlmnz(i,k)= max(rlmnz(i,k), rlmn1) -! vertical background diffusivity for momentum +! vertical background diffusivity + ptem = prsi(i,k+1) * tx1(i) + tem1 = 1.0 - ptem + tem2 = tem1 * tem1 * 10.0 + tem2 = min(1.0, exp(-tem2)) + xkzo(i,k) = xkzm_hx(i) * tem2 +! vertical background diffusivity for momentum if (ptem >= xkzm_s) then xkzmo(i,k) = xkzm_mx(i) kx1(i) = k + 1 @@ -674,20 +674,20 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, ! ! background diffusivity decreasing with increasing surface layer stability ! - do i = 1, im - if(.not.sfcflg(i)) then - tem = (1. + 5. * rbsoil(i))**2. -! tem = (1. + 5. * zol(i))**2. - frik(i) = 0.1 + 0.9 / tem - endif - enddo -! - do k = 1,km1 - do i=1,im - xkzo(i,k) = frik(i) * xkzo(i,k) - xkzmo(i,k)= frik(i) * xkzmo(i,k) - enddo - enddo +! do i = 1, im +! if(.not.sfcflg(i)) then +! tem = (1. + 5. * rbsoil(i))**2. +!! tem = (1. + 5. * zol(i))**2. +! frik(i) = 0.1 + 0.9 / tem +! endif +! enddo +! +! do k = 1,km1 +! do i=1,im +! xkzo(i,k) = frik(i) * xkzo(i,k) +! xkzmo(i,k)= frik(i) * xkzmo(i,k) +! enddo +! enddo ! ! The background vertical diffusivities in the inversion layers are limited ! to be less than or equal to xkzminv @@ -867,13 +867,14 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, do i = 1, im if(k == 1) then tem = ckz(i,1) - tem1 = xkzmo(i,1) + tem1 = 0.5 * xkzmo(i,1) else tem = 0.5 * (ckz(i,k-1) + ckz(i,k)) tem1 = 0.5 * (xkzmo(i,k-1) + xkzmo(i,k)) endif ptem = tem1 / (tem * elm(i,k)) tkmnz(i,k) = ptem * ptem + tkmnz(i,k) = min(tkmnz(i,k), tkminx) tkmnz(i,k) = max(tkmnz(i,k), tkmin) enddo enddo From 7e91866d114c17022822946de0bdb6c86dd51de3 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Thu, 7 Nov 2019 20:12:57 +0000 Subject: [PATCH 05/12] update ccpp with gfdlmp change from Ruiyu --- .gitmodules | 3 ++- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 04f5ebec0..f64926ad2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,4 +7,5 @@ url = https://github.com/NCAR/ccpp-framework [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics + url = https://github.com/junwang-noaa/ccpp-physics + branch = gfdlmp_update diff --git a/ccpp/physics b/ccpp/physics index d4b1cd020..594b5db85 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d4b1cd020f8347147b86d3a18b56c03cb5c57d67 +Subproject commit 594b5db851b98acb68c9b33a9f326b9e203fc1a1 From 3e018222ea70e30b0d5df1234044cfb817ec5e86 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Sun, 10 Nov 2019 00:58:26 +0000 Subject: [PATCH 06/12] update idate and nfhours for iau --- io/module_write_netcdf.F90 | 40 +++------------------ io/module_wrt_grid_comp.F90 | 70 ++++++++++++++++++++++--------------- 2 files changed, 46 insertions(+), 64 deletions(-) diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index 0a2b63d73..1fce3d8b9 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -22,7 +22,7 @@ module module_write_netcdf contains !---------------------------------------------------------------------------------------- - subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, idate, rc) + subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, rc) ! type(ESMF_FieldBundle), intent(in) :: fieldbundle type(ESMF_FieldBundle), intent(in) :: wrtfb @@ -30,7 +30,6 @@ subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, id integer, intent(in) :: mpi_comm integer, intent(in) :: mype integer, intent(in) :: im, jm - integer, intent(in) :: idate(7) integer, optional,intent(out) :: rc ! !** local vars @@ -147,7 +146,7 @@ subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, id call add_dim(ncid, "phalf", phalf_dimid, wrtgrid, rc) end if - call add_dim(ncid, "time", time_dimid, wrtgrid, rc, idate=idate) + call add_dim(ncid, "time", time_dimid, wrtgrid, rc) call get_global_attr(wrtfb, ncid, rc) @@ -504,18 +503,16 @@ subroutine get_grid_attr(grid, prefix, ncid, varid, rc) end subroutine get_grid_attr - subroutine add_dim(ncid, dim_name, dimid, grid, rc, idate) + subroutine add_dim(ncid, dim_name, dimid, grid, rc) integer, intent(in) :: ncid character(len=*), intent(in) :: dim_name - integer, intent(inout) :: dimid + integer, intent(inout) :: dimid type(ESMF_Grid), intent(in) :: grid integer, intent(out) :: rc - integer, intent(in), optional :: idate(7) ! local variable integer :: i, attcount, n, dim_varid integer :: ncerr - character(255) :: time_units character(len=ESMF_MAXSTR) :: attName type(ESMF_TypeKind_Flag) :: typekind @@ -559,38 +556,9 @@ subroutine add_dim(ncid, dim_name, dimid, grid, rc, idate) call get_grid_attr(grid, dim_name, ncid, dim_varid, rc) - ! if write grid comp changes time units - if ( present (idate) ) then - if ( trim(dim_name) == "time") then - ncerr = nf90_get_att(ncid, dim_varid, 'units', time_units); NC_ERR_STOP(ncerr) - time_units = get_time_units_from_idate(idate) - ncerr = nf90_put_att(ncid, dim_varid, 'units', trim(time_units)); NC_ERR_STOP(ncerr) - endif - endif - end subroutine add_dim ! !---------------------------------------------------------------------------------------- - function get_time_units_from_idate(idate, time_measure) result(time_units) - ! create time units attribute of form 'hours since YYYY-MM-DD HH:MM:SS' - ! from integer array with year,month,day,hour,minute,second - ! optional argument 'time_measure' can be used to change 'hours' to - ! 'days', 'minutes', 'seconds' etc. - character(len=*), intent(in), optional :: time_measure - integer, intent(in) :: idate(7) - character(len=12) :: timechar - character(len=nf90_max_name) :: time_units - if (present(time_measure)) then - timechar = trim(time_measure) - else - timechar = 'hours' - endif - write(time_units,101) idate(1:6) -101 format(' since ',i4.4,'-',i2.2,'-',i2.2,' ',& - i2.2,':',i2.2,':',i2.2) - time_units = trim(adjustl(timechar))//time_units - end function get_time_units_from_idate -! subroutine nccheck(status) use netcdf implicit none diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index f8546614b..49dfdcff3 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -71,6 +71,7 @@ module module_wrt_grid_comp logical,save :: first_init=.false. logical,save :: first_run=.false. logical,save :: first_getlatlon=.true. + logical,save :: change_wrtidate=.false. ! !----------------------------------------------------------------------- ! @@ -173,7 +174,8 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) real(ESMF_KIND_R4) :: valueR4 real(ESMF_KIND_R8) :: valueR8 - integer :: attCount, axeslen, jidx, noutfile + integer :: attCount, axeslen, jidx, idx, noutfile + character(19) :: newdate character(128) :: FBlist_outfilename(100), outfile_name character(128),dimension(:,:), allocatable :: outfilename real(8), dimension(:), allocatable :: slat @@ -183,7 +185,6 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) real(ESMF_KIND_R8) :: geo_lon, geo_lat real(ESMF_KIND_R8) :: lon1_r8, lat1_r8 real(ESMF_KIND_R8) :: x1, y1, x, y - type(ESMF_Time) :: IO_BASETIME_IAU type(ESMF_TimeInterval) :: IAU_offsetTI type(ESMF_DataCopy_Flag) :: copyflag=ESMF_DATACOPY_REFERENCE ! real(8),parameter :: PI=3.14159265358979d0 @@ -469,8 +470,31 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) call ESMF_Finalize(endflag=ESMF_END_ABORT) endif +! +!----------------------------------------------------------------------- +!*** get write grid component initial time from clock +!----------------------------------------------------------------------- +! + call ESMF_ClockGet(clock =CLOCK & !<-- The ESMF Clock + ,startTime=wrt_int_state%IO_BASETIME & !<-- The Clock's starting time + ,rc =RC) - + call ESMF_TimeGet(time=wrt_int_state%IO_BASETIME,yy=idate(1),mm=idate(2),dd=idate(3),h=idate(4), & + m=idate(5),s=idate(6),rc=rc) +! if (lprnt) write(0,*) 'in wrt initial, io_baseline time=',idate,'rc=',rc + idate(7) = 1 + wrt_int_state%idate = idate + wrt_int_state%fdate = idate + if(iau_offset > 0 ) then + call ESMF_TimeIntervalSet(IAU_offsetTI, h=iau_offset, rc=rc) + wrt_int_state%IO_BASETIME = wrt_int_state%IO_BASETIME + IAU_offsetTI + call ESMF_TimeGet(time=wrt_int_state%IO_BASETIME,yy=idate(1),mm=idate(2),dd=idate(3),h=idate(4), & + m=idate(5),s=idate(6),rc=rc) + wrt_int_state%idate = idate + change_wrtidate = .true. + if (mype == lead_write_task) print *,'in wrt initial, with iau, io_baseline time=',idate,'rc=',rc + endif +! ! Create field bundle !------------------------------------------------------------------- ! @@ -867,6 +891,17 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return +! add iau here + if ( index(trim(attNameList(i)),'time:units')>0) then + if ( change_wrtidate ) then + idx = index(trim(valueS),' since ') + if(mype == lead_write_task) print *,'in write grid comp, time:unit=',trim(valueS) + write(newdate,'(I4.4,a,I2.2,a,I2.2,a,I2.2,a,I2.2,a,I2.2)') idate(1),'-', & + idate(2),'-',idate(3),' ',idate(4),':',idate(5),':',idate(6) + valueS = valueS(1:idx+6)//newdate + if(mype == lead_write_task) print *,'in write grid comp, new time:unit=',trim(valueS) + endif + endif call ESMF_AttributeSet(wrtgrid, convention="NetCDF", purpose="FV3", & name=trim(attNameList(i)), value=valueS, rc=rc) @@ -1036,28 +1071,6 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return ! !----------------------------------------------------------------------- -!*** SET THE IO_BaseTime TO THE INITIAL CLOCK TIME. -!----------------------------------------------------------------------- -! - call ESMF_ClockGet(clock =CLOCK & !<-- The ESMF Clock - ,startTime=wrt_int_state%IO_BASETIME & !<-- The Clock's starting time - ,rc =RC) - - call ESMF_TimeGet(time=wrt_int_state%IO_BASETIME,yy=idate(1),mm=idate(2),dd=idate(3),h=idate(4), & - m=idate(5),s=idate(6),rc=rc) -! if (lprnt) write(0,*) 'in wrt initial, io_baseline time=',idate,'rc=',rc - idate(7) = 1 - wrt_int_state%idate = idate - wrt_int_state%fdate = idate - if(iau_offset > 0 ) then - call ESMF_TimeIntervalSet(IAU_offsetTI, h=iau_offset, rc=rc) - IO_BASETIME_IAU = wrt_int_state%IO_BASETIME + IAU_offsetTI - call ESMF_TimeGet(time=IO_BASETIME_IAU,yy=idate(1),mm=idate(2),dd=idate(3),h=idate(4), & - m=idate(5),s=idate(6),rc=rc) -! if (lprnt) write(0,*) 'in wrt initial, with iau, io_baseline time=',idate,'rc=',rc - endif -! -!----------------------------------------------------------------------- !*** SET THE FIRST HISTORY FILE'S TIME INDEX. !----------------------------------------------------------------------- ! @@ -1251,9 +1264,10 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) ! nf_seconds = nf_hours*3600+nf_minuteS*60+nseconds+real(nseconds_num)/real(nseconds_den) ! shift forecast hour by iau_offset if iau is on. - nf_seconds = nf_seconds - iau_offset*3600 + !nf_seconds = nf_seconds - iau_offset*3600 wrt_int_state%nfhour = nf_seconds/3600. nf_hours = int(nf_seconds/3600.) + if(mype == lead_write_task) print *,'in write grid comp, nf_hours=',nf_hours ! if iau_offset > nf_hours, don't write out anything if (nf_hours < 0) return @@ -1386,7 +1400,7 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) wbeg = MPI_Wtime() call write_netcdf(file_bundle,wrt_int_state%wrtFB(nbdl),trim(filename), & - wrt_mpi_comm,wrt_int_state%mype,imo,jmo,idate,rc) + wrt_mpi_comm,wrt_int_state%mype,imo,jmo,rc) wend = MPI_Wtime() if (lprnt) then write(*,'(A,F10.5,A,I4.2,A,I2.2)')' netcdf Write Time is ',wend-wbeg & @@ -1431,7 +1445,7 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) wbeg = MPI_Wtime() call write_netcdf(file_bundle,wrt_int_state%wrtFB(nbdl),trim(filename), & - wrt_mpi_comm,wrt_int_state%mype,imo,jmo,idate,rc) + wrt_mpi_comm,wrt_int_state%mype,imo,jmo,rc) wend = MPI_Wtime() if (mype == lead_write_task) then write(*,'(A,F10.5,A,I4.2,A,I2.2)')' netcdf Write Time is ',wend-wbeg & From 94842bcc0b5798963ab9e0cd74566d930605a287 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Sun, 10 Nov 2019 04:11:51 +0000 Subject: [PATCH 07/12] fix print line --- io/module_wrt_grid_comp.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index 49dfdcff3..3439e89a4 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -492,7 +492,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) m=idate(5),s=idate(6),rc=rc) wrt_int_state%idate = idate change_wrtidate = .true. - if (mype == lead_write_task) print *,'in wrt initial, with iau, io_baseline time=',idate,'rc=',rc + if (lprnt) print *,'in wrt initial, with iau, io_baseline time=',idate,'rc=',rc endif ! ! Create field bundle @@ -895,11 +895,11 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) if ( index(trim(attNameList(i)),'time:units')>0) then if ( change_wrtidate ) then idx = index(trim(valueS),' since ') - if(mype == lead_write_task) print *,'in write grid comp, time:unit=',trim(valueS) + if(lprnt) print *,'in write grid comp, time:unit=',trim(valueS) write(newdate,'(I4.4,a,I2.2,a,I2.2,a,I2.2,a,I2.2,a,I2.2)') idate(1),'-', & idate(2),'-',idate(3),' ',idate(4),':',idate(5),':',idate(6) valueS = valueS(1:idx+6)//newdate - if(mype == lead_write_task) print *,'in write grid comp, new time:unit=',trim(valueS) + if(lprnt) print *,'in write grid comp, new time:unit=',trim(valueS) endif endif call ESMF_AttributeSet(wrtgrid, convention="NetCDF", purpose="FV3", & From b71e959dc6e9f96359472ee8be267905b70f0143 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Sun, 10 Nov 2019 20:24:53 +0000 Subject: [PATCH 08/12] initialize ihrst for ihrst --- io/post_gfs.F90 | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/io/post_gfs.F90 b/io/post_gfs.F90 index ce6bb281e..d7a2a0d42 100644 --- a/io/post_gfs.F90 +++ b/io/post_gfs.F90 @@ -28,7 +28,7 @@ subroutine post_run_gfs(wrt_int_state,mypei,mpicomp,lead_write, & ! use ctlblk_mod, only : komax,ifhr,ifmin,modelname,datapd,fld_info, & npset,grib,gocart_on,icount_calmict, jsta, & - jend,im, nsoil + jend,im, nsoil, ihrst use gridspec_mod, only : maptype, gridtype use grib2_module, only : gribit2,num_pset,nrecout,first_grbtbl ! @@ -369,7 +369,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & ! integer i, ip1, j, l, k, n, iret, ibdl, rc, kstart, kend integer ista,iend,fieldDimCount,gridDimCount,ncount_field - integer idate(8), jdate(8) + integer jdate(8) logical foundland, foundice, found real(4) rinc(5) real tlmh,RADI,TMP,ES,TV,RHOAIR,tem,tstart,dtp @@ -641,26 +641,16 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & enddo ! ! get inital date - idate = 0 - idate(1) = wrt_int_state%idate(1) - idate(2) = wrt_int_state%idate(2) - idate(3) = wrt_int_state%idate(3) - idate(5) = wrt_int_state%idate(4) - idate(6) = wrt_int_state%idate(5) sdat(1) = wrt_int_state%idate(2) !month sdat(2) = wrt_int_state%idate(3) !day sdat(3) = wrt_int_state%idate(1) !year - jdate = 0 - jdate(1) = wrt_int_state%fdate(1) - jdate(2) = wrt_int_state%fdate(2) - jdate(3) = wrt_int_state%fdate(3) !jdate(4): time zone - jdate(5) = wrt_int_state%fdate(4) - jdate(6) = wrt_int_state%fdate(5) - idat(1) = wrt_int_state%idate(2) - idat(2) = wrt_int_state%idate(3) - idat(3) = wrt_int_state%idate(1) - idat(4) = IFHR - idat(5) = IFMIN + ihrst = wrt_int_state%idate(4) !hour + + idat(1) = wrt_int_state%fdate(2) + idat(2) = wrt_int_state%fdate(3) + idat(3) = wrt_int_state%fdate(1) + idat(4) = wrt_int_state%fdate(4) + idat(5) = wrt_int_state%fdate(5) ! ! if(mype==0) print *,'jdate=',jdate,'idate=',idate,'sdat=',sdat ! CALL W3DIFDAT(JDATE,IDATE,0,RINC) From 2eb8b2cd7c63bcaae1157ccf9ef418b67933d9c3 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Mon, 11 Nov 2019 02:56:16 +0000 Subject: [PATCH 09/12] initialize ihrst for inline post --- io/post_gfs.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/io/post_gfs.F90 b/io/post_gfs.F90 index d7a2a0d42..3ea19c555 100644 --- a/io/post_gfs.F90 +++ b/io/post_gfs.F90 @@ -28,7 +28,7 @@ subroutine post_run_gfs(wrt_int_state,mypei,mpicomp,lead_write, & ! use ctlblk_mod, only : komax,ifhr,ifmin,modelname,datapd,fld_info, & npset,grib,gocart_on,icount_calmict, jsta, & - jend,im, nsoil, ihrst + jend,im, nsoil use gridspec_mod, only : maptype, gridtype use grib2_module, only : gribit2,num_pset,nrecout,first_grbtbl ! @@ -342,7 +342,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & tprec, tclod, trdlw, trdsw, tsrfc, tmaxmin, theat, & ardlw, ardsw, asrfc, avrain, avcnvc, iSF_SURFACE_PHYSICS,& td3d, idat, sdat, ifhr, ifmin, dt, nphs, dtq2, pt_tbl, & - alsl, spl + alsl, spl, ihrst use params_mod, only: erad, dtr, capa, p1000 use gridspec_mod,only: latstart, latlast, lonstart, lonlast, cenlon, cenlat use lookup_mod, only: thl, plq, ptbl, ttbl, rdq, rdth, rdp, rdthe, pl, & @@ -652,7 +652,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & idat(4) = wrt_int_state%fdate(4) idat(5) = wrt_int_state%fdate(5) ! -! if(mype==0) print *,'jdate=',jdate,'idate=',idate,'sdat=',sdat + if(mype==0) print *,'idat=',idat,'sdat=',sdat,'ihrst=',ihrst ! CALL W3DIFDAT(JDATE,IDATE,0,RINC) ! ! if(mype==0)print *,' rinc=',rinc @@ -690,7 +690,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & call ESMF_FieldBundleGet(wrt_int_state%wrtFB(ibdl),fieldName='land',isPresent=found, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) return ! bail out - if(mype==0) print *,'ibdl=',ibdl,'land, found=',found +! if(mype==0) print *,'ibdl=',ibdl,'land, found=',found if (found) then call ESMF_FieldBundleGet(wrt_int_state%wrtFB(ibdl),'land',field=theField, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & @@ -714,7 +714,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, & call ESMF_FieldBundleGet(wrt_int_state%wrtFB(ibdl),'icec',isPresent=found, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) return ! bail out - if(mype==0) print *,'ibdl=',ibdl,'ice, found=',found +! if(mype==0) print *,'ibdl=',ibdl,'ice, found=',found if (found) then call ESMF_FieldBundleGet(wrt_int_state%wrtFB(ibdl),'icec',field=theField, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & From 248196cd055c67b0b16c1cbc2ea946b8f385d027 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Tue, 12 Nov 2019 19:41:30 +0000 Subject: [PATCH 10/12] add comments for write grid comp idate change when iau is enabled --- io/module_wrt_grid_comp.F90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index 3439e89a4..405af2841 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -485,6 +485,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) idate(7) = 1 wrt_int_state%idate = idate wrt_int_state%fdate = idate +! update IO-BASETIME and idate on write grid comp when IAU is enabled if(iau_offset > 0 ) then call ESMF_TimeIntervalSet(IAU_offsetTI, h=iau_offset, rc=rc) wrt_int_state%IO_BASETIME = wrt_int_state%IO_BASETIME + IAU_offsetTI @@ -891,7 +892,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return -! add iau here +! update the time:units when idate on write grid component is changed if ( index(trim(attNameList(i)),'time:units')>0) then if ( change_wrtidate ) then idx = index(trim(valueS),' since ') @@ -1263,8 +1264,6 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) ! 'nseconds_num=',nseconds_num,nseconds_den,'mype=',mype ! nf_seconds = nf_hours*3600+nf_minuteS*60+nseconds+real(nseconds_num)/real(nseconds_den) - ! shift forecast hour by iau_offset if iau is on. - !nf_seconds = nf_seconds - iau_offset*3600 wrt_int_state%nfhour = nf_seconds/3600. nf_hours = int(nf_seconds/3600.) if(mype == lead_write_task) print *,'in write grid comp, nf_hours=',nf_hours From bddc70cf49acd4e39213120be38f116750fe5804 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Fri, 15 Nov 2019 15:15:45 +0000 Subject: [PATCH 11/12] update fv3 dycore and ccpp physics repo --- .gitmodules | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index f64926ad2..81687f8ab 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,11 +1,9 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/junwang-noaa/GFDL_atmos_cubed_sphere - branch = regfv3_rst + url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/junwang-noaa/ccpp-physics - branch = gfdlmp_update + url = https://github.com/NCAR/ccpp-physics From 97d12bc6594854674c34b837bfbbf7ae408785a9 Mon Sep 17 00:00:00 2001 From: "Jun.Wang" Date: Fri, 15 Nov 2019 15:35:19 +0000 Subject: [PATCH 12/12] checkout out dev/emc from EMC fv3 dycore repo and master branch in NCAR ccpp physics repo --- .gitmodules | 1 + atmos_cubed_sphere | 2 +- ccpp/physics | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 81687f8ab..949d298df 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere + branch = dev/emc [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index cc28aa5aa..f967c71b8 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit cc28aa5aa94817b24aea033cc19c1792e5927459 +Subproject commit f967c71b8f59c22c86de2ead1074e85e3ccf97b4 diff --git a/ccpp/physics b/ccpp/physics index 594b5db85..c0bec7173 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 594b5db851b98acb68c9b33a9f326b9e203fc1a1 +Subproject commit c0bec7173d10ca1460986a8dea81681736a26e56