diff --git a/atmos_model.F90 b/atmos_model.F90 index 0c7d27337..8faf66037 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -2044,7 +2044,7 @@ subroutine setup_exportdata (rc) if (IPD_Control%cplflx) then ! MEAN Zonal compt of momentum flux (N/m**2) - idx = queryfieldlist(exportFieldsList,'mean_zonal_moment_flx') + idx = queryfieldlist(exportFieldsList,'mean_zonal_moment_flx_atm') if (idx > 0 ) then !$omp parallel do default(shared) private(i,j,nb,ix) do j=jsc,jec @@ -2057,7 +2057,7 @@ subroutine setup_exportdata (rc) endif ! MEAN Merid compt of momentum flux (N/m**2) - idx = queryfieldlist(exportFieldsList,'mean_merid_moment_flx') + idx = queryfieldlist(exportFieldsList,'mean_merid_moment_flx_atm') if (idx > 0 ) then !$omp parallel do default(shared) private(i,j,nb,ix) do j=jsc,jec diff --git a/ccpp/build_ccpp.sh b/ccpp/build_ccpp.sh index 82014b8c4..8d8ef89ce 100755 --- a/ccpp/build_ccpp.sh +++ b/ccpp/build_ccpp.sh @@ -28,7 +28,6 @@ function usage { echo " SUITES=ABC,XYZ (comma-separated list of CCPP suites; " echo " corresponding filenames: suite_ABC.xml. ...)" echo " MULTI_GASES=Y/N (default N)" - echo " INTEL16=Y/N (default N)" echo " clean_before [optional] can be 'YES' (default) or 'NO'" echo " clean_after [optional] can be 'YES' (default) or 'NO'" exit 1 @@ -129,14 +128,9 @@ if [[ "${MAKE_OPT}" == *"MULTI_GASES=Y"* ]]; then else CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=OFF" fi -if [[ "${MAKE_OPT}" == *"INTEL16=Y"* ]]; then - CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DLEGACY_INTEL=ON" -elif [[ "${MACHINE_ID}" == "wcoss_cray" ]]; then - echo "In ccpp_build.sh: flag to cmake that wcoss_cray uses Intel 16" - CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DLEGACY_INTEL=ON" -else - CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DLEGACY_INTEL=OFF" -fi + +# Flag to cmake that modern Intel compilers are used +CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DLEGACY_INTEL=OFF" # Generate additional CCPP cmake flags depending on machine / compiler if [[ "${MACHINE_ID}" == "macosx.gnu" ]]; then diff --git a/ccpp/physics b/ccpp/physics index 20d7e9d68..494489205 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 20d7e9d687f0ec44d76a6c2b754a44a2fbbad0d9 +Subproject commit 494489205e9117cf6d889bdf67bc9bd1d6afbd69 diff --git a/cpl/module_cap_cpl.F90 b/cpl/module_cap_cpl.F90 index 2c4b33739..82980612b 100644 --- a/cpl/module_cap_cpl.F90 +++ b/cpl/module_cap_cpl.F90 @@ -214,13 +214,15 @@ end subroutine realizeConnectedCplFields !----------------------------------------------------------------------------- subroutine Dump_cplFields(gcomp, importState, exportstate, clock_fv3, & - statewrite_flag, timeslice) + statewrite_flag, state_tag, timestr) type(ESMF_GridComp), intent(in) :: gcomp type(ESMF_State) :: importState, exportstate type(ESMF_Clock),intent(in) :: clock_fv3 logical, intent(in) :: statewrite_flag - integer :: timeslice + character(len=*), intent(in) :: state_tag !< Import or export. + character(len=*), intent(in) :: timestr !< Import or export. + integer :: timeslice = 1 ! character(len=160) :: nuopcMsg character(len=160) :: filename @@ -229,34 +231,39 @@ subroutine Dump_cplFields(gcomp, importState, exportstate, clock_fv3, & call ESMF_ClockPrint(clock_fv3, options="currTime", & preString="leaving FV3_ADVANCE with clock_fv3 current: ", & unit=nuopcMsg) - call ESMF_LogWrite(nuopcMsg, ESMF_LOGMSG_INFO) +! call ESMF_LogWrite(nuopcMsg, ESMF_LOGMSG_INFO) call ESMF_ClockPrint(clock_fv3, options="startTime", & preString="leaving FV3_ADVANCE with clock_fv3 start: ", & unit=nuopcMsg) - call ESMF_LogWrite(nuopcMsg, ESMF_LOGMSG_INFO) +! call ESMF_LogWrite(nuopcMsg, ESMF_LOGMSG_INFO) call ESMF_ClockPrint(clock_fv3, options="stopTime", & preString="leaving FV3_ADVANCE with clock_fv3 stop: ", & unit=nuopcMsg) - call ESMF_LogWrite(nuopcMsg, ESMF_LOGMSG_INFO) +! call ESMF_LogWrite(nuopcMsg, ESMF_LOGMSG_INFO) ! Dumping Fields out if (statewrite_flag) then - timeslice = timeslice + 1 - call ESMF_GridCompGet(gcomp, importState=importState, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - ! replace with tiled field dumps - !call ESMFPP_RegridWriteState(importState, "fv3_cap_import_", timeslice, rc=rc) - write(filename,'(a,i6.6)') 'fv3_cap_import_',timeslice - call State_RWFields_tiles(importState,trim(filename), timeslice, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - call ESMF_GridCompGet(gcomp, exportState=exportState, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - ! replace with tiled field dumps - !call ESMFPP_RegridWriteState(exportState, "fv3_cap_export_", timeslice, rc=rc) - write(filename,'(a,i6.6)') 'fv3_cap_export_',timeslice - call State_RWFields_tiles(exportState,trim(filename), timeslice, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + if(trim(state_tag) .eq. 'import')then + call ESMF_GridCompGet(gcomp, importState=importState, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + ! replace with tiled field dumps + !call ESMFPP_RegridWriteState(importState, "fv3_cap_import_", timeslice, rc=rc) + write(filename,'(a,a,a)') 'fv3_cap_import_'//trim(timestr)//'_' + call State_RWFields_tiles(importState,trim(filename), timeslice, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + end if + + if(trim(state_tag) .eq. 'export')then + call ESMF_GridCompGet(gcomp, exportState=exportState, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + ! replace with tiled field dumps + !call ESMFPP_RegridWriteState(exportState, "fv3_cap_export_", timeslice, rc=rc) + write(filename,'(a,a,a)') 'fv3_cap_export_'//trim(timestr)//'_' + call State_RWFields_tiles(exportState,trim(filename), timeslice, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + end if + endif ! end subroutine Dump_cplFields diff --git a/cpl/module_cplfields.F90 b/cpl/module_cplfields.F90 index cd87e3925..5e62755f9 100644 --- a/cpl/module_cplfields.F90 +++ b/cpl/module_cplfields.F90 @@ -39,8 +39,8 @@ module module_cplfields "vegetation_type ", & "inst_vegetation_area_frac ", & "inst_surface_roughness ", & - "mean_zonal_moment_flx ", & - "mean_merid_moment_flx ", & + "mean_zonal_moment_flx_atm ", & + "mean_merid_moment_flx_atm ", & "mean_sensi_heat_flx ", & "mean_laten_heat_flx ", & "mean_down_lw_flx ", & diff --git a/fv3_cap.F90 b/fv3_cap.F90 index 1c9136185..99f2acb12 100644 --- a/fv3_cap.F90 +++ b/fv3_cap.F90 @@ -400,7 +400,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) write_nemsioflip =.false. write_fsyncflag =.false. - if(trim(output_grid) == 'gaussian_grid') then + if(trim(output_grid) == 'gaussian_grid' .or. trim(output_grid) == 'global_latlon') then call ESMF_ConfigGetAttribute(config=CF, value=imo, label ='imo:',rc=rc) call ESMF_ConfigGetAttribute(config=CF, value=jmo, label ='jmo:',rc=rc) call ESMF_ConfigGetAttribute(config=CF, value=write_nemsioflip, label ='write_nemsioflip:',rc=rc) @@ -703,7 +703,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call ESMF_StateGet(wrtState(i), & itemName="mirror_"//trim(fcstItemNameList(j)), & fieldbundle=wrtFB(j,i), rc=rc) - if(mype == 0) print *,'af get wrtfb=',"mirror_"//trim(fcstItemNameList(j)),'rc=',rc + if(mype == 0) print *,'af get wrtfb=',"mirror_"//trim(fcstItemNameList(j)),' rc=',rc if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return ! determine regridmethod @@ -949,6 +949,7 @@ subroutine ModelAdvance(gcomp, rc) logical :: isAlarmEnabled, isAlarmRinging, lalarm, reconcileFlag character(len=*),parameter :: subname='(fv3_cap:ModelAdvance)' character(240) :: msgString + character(240) :: import_timestr, export_timestr !jw debug character(ESMF_MAXSTR) :: name integer :: mype,date(6), fieldcount, fcst_nfld @@ -1026,6 +1027,10 @@ subroutine ModelAdvance(gcomp, rc) m=date(5),s=date(6),rc=rc) ! if(mype==0) print *,'af clock,timestep date=',date ! if(mype==lead_wrttask(1)) print *,'on wrt lead,af clock,timestep date=',date +! + call ESMF_ClockGet(clock_fv3, currTime=currTime, timeStep=timeStep, rc=rc) + call ESMF_TimeGet(currTime, timestring=import_timestr, rc=rc) + call ESMF_TimeGet(currTime+timestep, timestring=export_timestr, rc=rc) ! !----------------------------------------------------------------------------- !*** integration loop @@ -1048,6 +1053,12 @@ subroutine ModelAdvance(gcomp, rc) if (ESMF_LogFoundError(rcToCheck=urc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__, rcToReturn=rc)) return + if ( cpl ) then + ! assign import_data called during phase=1 + call Dump_cplFields(gcomp, importState, exportstate, clock_fv3, & + cplprint_flag, 'import', import_timestr) + endif + call ESMF_GridCompRun(fcstComp, exportState=fcstState, clock=clock_fv3, & phase=2, userRc=urc, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return @@ -1164,7 +1175,7 @@ subroutine ModelAdvance(gcomp, rc) !jw for coupled, check clock and dump import and export state if ( cpl ) then call Dump_cplFields(gcomp, importState, exportstate, clock_fv3, & - cplprint_flag, timeslice) + cplprint_flag, 'export', export_timestr) endif if (mype==0) print *,'fv3_cap,end integrate,na=',na,' time=',mpi_wtime()- timeri diff --git a/gfsphysics/GFS_layer/GFS_physics_driver.F90 b/gfsphysics/GFS_layer/GFS_physics_driver.F90 index ab92b7ebc..afc4d499d 100644 --- a/gfsphysics/GFS_layer/GFS_physics_driver.F90 +++ b/gfsphysics/GFS_layer/GFS_physics_driver.F90 @@ -644,6 +644,14 @@ subroutine GFS_physics_driver & tau_tms, tau_mtb, tau_ogw, tau_ngw real(kind=kind_phys), dimension(size(Grid%xlon,1)) :: & zm_mtb, zm_ogw, zm_ngw, zm_lwb +!------------------------------------------------------ +! parameters for canopy heat storage parametrization +!------------------------------------------------------ + real(kind=kind_phys), dimension(size(Grid%xlon,1)) :: & + hflxq, evapq, hffac, hefac + real (kind=kind_phys), parameter :: z0min=0.2, z0max=1.0 + real (kind=kind_phys), parameter :: u10min=2.5, u10max=7.5 +! !=============================================================================== real, allocatable, dimension(:) :: refd, REFD263K @@ -1831,7 +1839,6 @@ subroutine GFS_physics_driver & Diag%zlvl, dry, wind, slopetyp, & Sfcprop%shdmin, Sfcprop%shdmax, Sfcprop%snoalb, & Radtend%sfalb, flag_iter, flag_guess, & - Model%lheatstrg, & Model%iopt_dveg, Model%iopt_crs, Model%iopt_btr, & Model%iopt_run, Model%iopt_sfc, Model%iopt_frz, & Model%iopt_inf, Model%iopt_rad, Model%iopt_alb, & @@ -2066,6 +2073,7 @@ subroutine GFS_physics_driver & Sfcprop%tsfco(i) = tsfc3(i,3) ! over lake (and ocean when uncoupled) stress(i) = stress3(i,3) ! Sfcprop%tprcp(i) = tprcp3(i,3) + if(Model%cplflx)Sfcprop%tsfcl(i) = tsfc3(i,3) ! for restart repro comparisons else k = 2 if (.not. flag_cice(i)) then @@ -2073,6 +2081,7 @@ subroutine GFS_physics_driver & endif stress(i) = fice(i)*stress3(i,2) + (one-fice(i))*stress3(i,3) ! Sfcprop%tprcp(i) = fice(i)*tprcp3(i,2) + (one-fice(i))*tprcp3(i,3) + if(Model%cplflx)Sfcprop%tsfcl(i) = tsfc3(i,2) ! for restart repro comparisons endif Sfcprop%zorl(i) = zorl3(i,k) cd(i) = cd3(i,k) @@ -2279,9 +2288,36 @@ subroutine GFS_physics_driver & !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! --- ... Boundary Layer and Free atmospheic turbulence parameterization - +! +! in order to achieve heat storage within canopy layer, in the canopy heat +! storage parameterization the kinematic sensible and latent heat fluxes +! (hflx & evap) as surface boundary forcings to the pbl scheme are +! reduced as a function of surface roughness +! + do i=1,im + hflxq(i) = hflx(i) + evapq(i) = evap(i) + hffac(i) = 1.0 + hefac(i) = 1.0 + enddo + if (Model%lheatstrg) then + do i=1,im + tem = 0.01 * Sfcprop%zorl(i) ! change unit from cm to m + tem1 = (tem - z0min) / (z0max - z0min) + hffac(i) = Model%z0fac * min(max(tem1, 0.0), 1.0) + tem = sqrt(Diag%u10m(i)**2+Diag%v10m(i)**2) + tem1 = (tem - u10min) / (u10max - u10min) + tem2 = 1.0 - min(max(tem1, 0.0), 1.0) + hffac(i) = tem2 * hffac(i) + hefac(i) = 1. + Model%e0fac * hffac(i) + hffac(i) = 1. + hffac(i) + hflxq(i) = hflx(i) / hffac(i) + evapq(i) = evap(i) / hefac(i) + enddo + endif +! ! if (lprnt) write(0,*)' tsea3=',Sfcprop%tsfc(ipr),' slmsk=',Sfcprop%slmsk(ipr) & -! &, ' kdt=',kdt,' evap=',evap(ipr) +! &, ' kdt=',kdt,' evap=',evapq(ipr) ! if (lprnt) write(0,*)' dtdtb=',(dtdt(ipr,k),k=1,15) ! do i=1,im @@ -2296,15 +2332,15 @@ subroutine GFS_physics_driver & ! if (lprnt) write(0,*)'befmonshoc=',Statein%tgrs(ipr,:) ! if (lprnt) write(0,*)'befmonshocdtdt=',dtdt(ipr,1:10) ! if (lprnt) write(0,*)'befmonshoctkh=',Tbd%phy_f3d(ipr,1:10,ntot3d-1) -! if (lprnt) write(0,*)'befmonshochflx=',hflx(ipr),' tsea=',Sfcprop%tsfc(ipr),& -! ' evap=',evap(ipr) +! if (lprnt) write(0,*)'befmonshochflx=',hflxq(ipr),' tsea=',Sfcprop%tsfc(ipr),& +! ' evap=',evapq(ipr) ! if (lprnt) write(0,*)'befmonshocq=',Statein%qgrs(ipr,:,1) ! if (lprnt) write(0,*)'befmonice=',Statein%qgrs(ipr,:,ntiw) ! if (lprnt) write(0,*)'befmonwat=',Statein%qgrs(ipr,:,ntcw) ! if (lprnt) write(0,*)'befmonshoctke=',Statein%qgrs(ipr,:,ntke) -! write(0,*)' before monsho hflx=',hflx,' me=',me -! write(0,*)' before monsho evap=',evap,' me=',me +! write(0,*)' before monsho hflx=',hflxq,' me=',me +! write(0,*)' before monsho evap=',evapq,' me=',me !## CCPP ##* Note: In the CCPP, the vdftra array is prepared in GFS_PBL_generic.F90/GFS_PBL_generic_pre_run ! regardless of the following conditions. Therefore, this block is redundant in the CCPP and is not included. if (nvdiff == ntrac .or. Model%do_ysu .or. Model%shinhong) then @@ -2316,8 +2352,8 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Tbd%phy_f3d(1,1,ntot3d-1), prnum, ntke, & Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, & - Diag%v10m, Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflx,& - evap, stress, wind, kpbl, Statein%prsi, del, Statein%prsl,& + Diag%v10m, Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc,hflxq,& + evapq,stress, wind, kpbl, Statein%prsi, del, Statein%prsl,& Statein%prslk, Statein%phii, Statein%phil, dtp, dusfc1, & dvsfc1, dtsfc1, dqsfc1, dkt, Diag%hpbl, kinver, & Model%xkzm_m, Model%xkzm_h, Model%xkzm_s, Model%xkzminv, & @@ -2341,7 +2377,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Radtend%htrsw, Radtend%htrlw, xmu, garea, & Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, & - Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflx, evap, & + Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, evapq, & stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl, & @@ -2354,7 +2390,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Radtend%htrsw, Radtend%htrlw, xmu, garea, & Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, & - Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflx, evap, & + Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, evapq, & stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl, & @@ -2368,7 +2404,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(1,1), & rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, Sfcprop%ffmm, & - Sfcprop%ffhh, Sfcprop%tsfc, qss, hflx, evap, stress, & + Sfcprop%ffhh, Sfcprop%tsfc, qss, hflxq, evapq, stress, & wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl,& @@ -2380,7 +2416,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(1,1), & rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, Sfcprop%ffmm, & - Sfcprop%ffhh, Sfcprop%tsfc, qss, hflx, evap, stress, & + Sfcprop%ffhh, Sfcprop%tsfc, qss, hflxq, evapq, stress, & wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl,& @@ -2404,7 +2440,7 @@ subroutine GFS_physics_driver & call moninq(ix, im, levs, nvdiff, ntcw, dvdt, dudt, dtdt, dqdt, & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(1,1), rb, & - Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, qss, hflx, evap, & + Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, qss, hflxq, evapq,& stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl, & @@ -2416,7 +2452,7 @@ subroutine GFS_physics_driver & call moninp1(ix, im, levs, nvdiff, dvdt, dudt, dtdt, dqdt, & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Statein%prsik(1,1), rb, Sfcprop%ffmm, Sfcprop%ffhh, & - Sfcprop%tsfc, qss, hflx, evap, stress, wind, kpbl, & + Sfcprop%tsfc, qss, hflxq, evapq, stress, wind, kpbl, & Statein%prsi, del, Statein%prsl, Statein%prslk, & Statein%phii, Statein%phil, dtp, dusfc1, dvsfc1, & dtsfc1, dqsfc1, Diag%hpbl, gamt, gamq, dkt, kinver, & @@ -2425,7 +2461,7 @@ subroutine GFS_physics_driver & call moninp(ix, im, levs, nvdiff, dvdt, dudt, dtdt, dqdt, & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Statein%prsik(1,1), rb, Sfcprop%ffmm, Sfcprop%ffhh, & - Sfcprop%tsfc, qss, hflx, evap, stress, wind, kpbl, & + Sfcprop%tsfc, qss, hflxq, evapq, stress, wind, kpbl, & Statein%prsi, del, Statein%prsl, Statein%phii, & Statein%phil, dtp, dusfc1, dvsfc1, dtsfc1, dqsfc1, & Diag%hpbl, gamt, gamq, dkt, Model%xkzm_m, Model%xkzm_h) @@ -2578,8 +2614,8 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & Tbd%phy_f3d(1,1,ntot3d-1), prnum, ntkev, & Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, & - Diag%v10m, Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflx, & - evap, stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & + Diag%v10m, Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, & + evapq, stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, dusfc1, & dvsfc1, dtsfc1, dqsfc1, dkt, Diag%hpbl, kinver, & Model%xkzm_m, Model%xkzm_h, Model%xkzm_s, Model%xkzminv, & @@ -2594,7 +2630,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & Radtend%htrsw, Radtend%htrlw, xmu, garea, & Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, & - Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflx, evap, & + Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, evapq, & stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl, & @@ -2607,7 +2643,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & Radtend%htrsw, Radtend%htrlw, xmu, garea, & Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, & - Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflx, evap, & + Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, evapq, & stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl, & @@ -2623,7 +2659,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(1,1), & rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, Sfcprop%ffmm, & - Sfcprop%ffhh, Sfcprop%tsfc, qss, hflx, evap, stress, & + Sfcprop%ffhh, Sfcprop%tsfc, qss, hflxq, evapq, stress, & wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl, & @@ -2637,7 +2673,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(1,1), & rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, Sfcprop%ffmm, & - Sfcprop%ffhh, Sfcprop%tsfc, qss, hflx, evap, stress, & + Sfcprop%ffhh, Sfcprop%tsfc, qss, hflxq, evapq, stress, & wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl, & @@ -2649,7 +2685,7 @@ subroutine GFS_physics_driver & call moninq(ix, im, levs, nvdiff, ntcw, dvdt, dudt, dtdt, dvdftra, & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(1,1), rb, & - Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, qss, hflx, evap, & + Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, qss, hflxq, evapq, & stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl, & @@ -2661,7 +2697,7 @@ subroutine GFS_physics_driver & call moninp1(ix, im, levs, nvdiff, dvdt, dudt, dtdt, dvdftra, & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & Statein%prsik(1,1), rb, Sfcprop%ffmm, Sfcprop%ffhh, & - Sfcprop%tsfc, qss, hflx, evap, stress, wind, kpbl, & + Sfcprop%tsfc, qss, hflxq, evapq, stress, wind, kpbl, & Statein%prsi, del, Statein%prsl, Statein%prslk, & Statein%phii, Statein%phil, dtp, dusfc1, dvsfc1, & dtsfc1, dqsfc1, Diag%hpbl, gamt, gamq, dkt, kinver, & @@ -2670,7 +2706,7 @@ subroutine GFS_physics_driver & call moninp(ix, im, levs, nvdiff, dvdt, dudt, dtdt, dvdftra, & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & Statein%prsik(1,1), rb, Sfcprop%ffmm, Sfcprop%ffhh, & - Sfcprop%tsfc, qss, hflx, evap, stress, wind, kpbl, & + Sfcprop%tsfc, qss, hflxq, evapq, stress, wind, kpbl, & Statein%prsi, del, Statein%prsl, Statein%phii, & Statein%phil, dtp, dusfc1, dvsfc1, dtsfc1, dqsfc1, & Diag%hpbl, gamt, gamq, dkt, Model%xkzm_m, Model%xkzm_h) @@ -2808,8 +2844,8 @@ subroutine GFS_physics_driver & ! if (lprnt) then ! write(0,*) ' dusfc1=',dusfc1(ipr),' kdt=',kdt ! write(0,*) ' dvsfc1=',dvsfc1(ipr),' kdt=',kdt -! write(0,*)' dtsfc1=',dtsfc1(ipr) -! write(0,*)' dqsfc1=',dqsfc1(ipr) +! write(0,*)' dtsfc1=',dtsfc1(ipr)*hffac(ipr) +! write(0,*)' dqsfc1=',dqsfc1(ipr)*hefac(ipr) ! write(0,*)' dtdtc=',(dtdt(ipr,k),k=1,15) ! write(0,*)' dqdtc=',(dqdt(ipr,k,1),k=1,15) ! print *,' dudtm=',dudt(ipr,:) @@ -2841,8 +2877,8 @@ subroutine GFS_physics_driver & else ! use results from PBL scheme for 100% open ocean Coupling%dusfci_cpl(i) = dusfc1(i) Coupling%dvsfci_cpl(i) = dvsfc1(i) - Coupling%dtsfci_cpl(i) = dtsfc1(i) - Coupling%dqsfci_cpl(i) = dqsfc1(i) + Coupling%dtsfci_cpl(i) = dtsfc1(i)*hffac(i) + Coupling%dqsfci_cpl(i) = dqsfc1(i)*hefac(i) endif Coupling%dusfc_cpl (i) = Coupling%dusfc_cpl(i) + Coupling%dusfci_cpl(i) * dtf @@ -2865,12 +2901,12 @@ subroutine GFS_physics_driver & do i=1,im Diag%dusfc (i) = Diag%dusfc(i) + dusfc1(i)*dtf Diag%dvsfc (i) = Diag%dvsfc(i) + dvsfc1(i)*dtf - Diag%dtsfc (i) = Diag%dtsfc(i) + dtsfc1(i)*dtf - Diag%dqsfc (i) = Diag%dqsfc(i) + dqsfc1(i)*dtf + Diag%dtsfc (i) = Diag%dtsfc(i) + dtsfc1(i)*hffac(i)*dtf + Diag%dqsfc (i) = Diag%dqsfc(i) + dqsfc1(i)*hefac(i)*dtf Diag%dusfci(i) = dusfc1(i) Diag%dvsfci(i) = dvsfc1(i) - Diag%dtsfci(i) = dtsfc1(i) - Diag%dqsfci(i) = dqsfc1(i) + Diag%dtsfci(i) = dtsfc1(i)*hffac(i) + Diag%dqsfci(i) = dqsfc1(i)*hefac(i) enddo ! if (lprnt) then ! write(0,*)' dusfc=',dusfc(ipr),' dusfc1=',dusfc1(ipr),' dtf=', @@ -3561,7 +3597,7 @@ subroutine GFS_physics_driver & ! if (lprnt) write(0,*)'clwl=',clw(ipr,:,2) ! if (lprnt) write(0,*)'befncpi=',ncpi(ipr,:) ! if (lprnt) write(0,*)'tkh=',Tbd%phy_f3d(ipr,:,ntot3d-1) -! if (lprnt) write(0,*) ' befshoc hflx=',hflx(ipr),' evap=',evap(ipr),& +! if (lprnt) write(0,*) ' befshoc hflx=',hflxq(ipr),' evap=',evapq(ipr),& ! ' stress=',stress(ipr) ! dtshoc = 60.0 ! dtshoc = 120.0 @@ -3585,8 +3621,8 @@ subroutine GFS_physics_driver & ! call shoc (ix, im, 1, levs, levs+1, dtp, me, 1, Statein%prsl(1,1), & ! call shoc (ix, im, 1, levs, levs+1, dtshoc, me, 1, Statein%prsl(1,1), & ! call shoc (ix, im, 1, levs, levs+1, dtp, me, 1, Staotein%prsl(1,1), & -! write(0,*)' before shoc hflx=',hflx, ' me=',me -! write(0,*)' before shoc evap=',evap,' me=',me +! write(0,*)' before shoc hflx=',hflxq, ' me=',me +! write(0,*)' before shoc evap=',evapq,' me=',me call shoc (ix, im, levs, levs+1, dtp, me, 1, Statein%prsl(1,1), del,& Statein%phii(1,1), Statein%phil(1,1), Stateout%gu0(1,1), & Stateout%gv0(1,1), Statein%vvl(1,1), Stateout%gt0(1,1), & @@ -3594,7 +3630,7 @@ subroutine GFS_physics_driver & rhc, Model%sup, Model%shoc_parm(1), Model%shoc_parm(2), & Model%shoc_parm(3), Model%shoc_parm(4), & Model%shoc_parm(5), Tbd%phy_f3d(1,1,ntot3d-2), & - clw(1,1,ntk), hflx, evap, prnum, & + clw(1,1,ntk), hflxq, evapq, prnum, & Tbd%phy_f3d(1,1,ntot3d-1), Tbd%phy_f3d(1,1,ntot3d), & lprnt, ipr, imp_physics, ncpl, ncpi) @@ -4275,7 +4311,7 @@ subroutine GFS_physics_driver & Statein%pgr, Statein%phil, clw, Stateout%gq0, & Stateout%gt0, Stateout%gu0, Stateout%gv0, rain1, & kbot, ktop, kcnv, islmsk, Statein%vvl, ncld, & - Diag%hpbl, hflx, evap, ud_mf, dt_mf, cnvw, cnvc, & + Diag%hpbl, hflxq, evapq, ud_mf, dt_mf, cnvw, cnvc,& Model%clam_shal, Model%c0s_shal, Model%c1_shal, & Model%pgcon_shal) !*## CCPP ## @@ -4484,7 +4520,7 @@ subroutine GFS_physics_driver & rhc, Model%sup, Model%shoc_parm(1), Model%shoc_parm(2), & Model%shoc_parm(3), Model%shoc_parm(4), & Model%shoc_parm(5), Tbd%phy_f3d(1,1,ntot3d-2), & - clw(1,1,ntk), hflx, evap, prnum, & + clw(1,1,ntk), hflxq, evapq, prnum, & Tbd%phy_f3d(1,1,ntot3d-1), Tbd%phy_f3d(1,1,ntot3d), & lprnt, ipr, imp_physics, ncpl, ncpi) ! enddo @@ -5517,11 +5553,11 @@ subroutine GFS_physics_driver & ! tem = dtf * 0.03456 / 86400.0 ! write(1000+me,*)' pwat=',pwat(i),'i=',i,', -! &' rain=',rain(i)*1000.0,' dqsfc1=',dqsfc1(i)*tem,' kdt=',kdt -! &,' e-p=',dqsfc1(i)*tem-rain(i)*1000.0 +! &' rain=',rain(i)*1000.0,' dqsfc1=',dqsfc1(i)*hefac(i)*tem,' kdt=',kdt +! &,' e-p=',dqsfc1(i)*hefac(i)*tem-rain(i)*1000.0 ! if (lprnt) write(0,*)' pwat=',pwat(ipr),', -! &' rain=',rain(ipr)*1000.0,' dqsfc1=',dqsfc1(ipr)*tem,' kdt=',kdt -! &,' e-p=',dqsfc1(ipr)*tem-rain(ipr)*1000.0 +! &' rain=',rain(ipr)*1000.0,' dqsfc1=',dqsfc1(ipr)*hefac(ipr)*tem,' kdt=',kdt +! &,' e-p=',dqsfc1(ipr)*hefac(ipr)*tem-rain(ipr)*1000.0 ! ! if (lprnt .and. rain(ipr) > 5) call mpi_quit(5678) diff --git a/gfsphysics/GFS_layer/GFS_typedefs.F90 b/gfsphysics/GFS_layer/GFS_typedefs.F90 index 74598d522..c2b64a544 100644 --- a/gfsphysics/GFS_layer/GFS_typedefs.F90 +++ b/gfsphysics/GFS_layer/GFS_typedefs.F90 @@ -153,7 +153,7 @@ module GFS_typedefs character(len=32), pointer :: tracer_names(:) !< tracers names to dereference tracer id !< based on name location in array - character(len=65) :: fn_nml !< namelist filename + character(len=64) :: fn_nml !< namelist filename character(len=256), pointer :: input_nml_file(:) !< character string containing full namelist !< for use with internal file reads end type GFS_init_type @@ -970,7 +970,7 @@ module GFS_typedefs !< 6=areodynamical roughness over water with input 10-m wind !< 7=slightly decrease Cd for higher wind speed compare to 6 -!--- background vertical diffusion +!--- vertical diffusion real(kind=kind_phys) :: xkzm_m !< [in] bkgd_vdif_m background vertical diffusion for momentum real(kind=kind_phys) :: xkzm_h !< [in] bkgd_vdif_h background vertical diffusion for heat q real(kind=kind_phys) :: xkzm_s !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion @@ -980,7 +980,13 @@ module GFS_typedefs real(kind=kind_phys) :: bl_upfr !< updraft fraction in boundary layer mass flux scheme real(kind=kind_phys) :: bl_dnfr !< downdraft fraction in boundary layer mass flux scheme - !---cellular automata control parameters +!--- parameters for canopy heat storage (CHS) parameterization + real(kind=kind_phys) :: z0fac !< surface roughness fraction factor + real(kind=kind_phys) :: e0fac !< latent heat flux fraction factor relative to sensible heat flux + !< e.g., e0fac=0.5 indicates that CHS for latent heat flux is 50% of that for + !< sensible heat flux + +!---cellular automata control parameters integer :: nca !< number of independent cellular automata integer :: nlives !< cellular automata lifetime integer :: ncells !< cellular automata finer grid @@ -1688,6 +1694,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: ep1d_land(:) => null() !< real (kind=kind_phys), pointer :: ep1d_ocean(:) => null() !< real (kind=kind_phys), pointer :: evap(:) => null() !< + real (kind=kind_phys), pointer :: evapq(:) => null() !< real (kind=kind_phys), pointer :: evap_ice(:) => null() !< real (kind=kind_phys), pointer :: evap_land(:) => null() !< real (kind=kind_phys), pointer :: evap_ocean(:) => null() !< @@ -1733,7 +1740,10 @@ module GFS_typedefs real (kind=kind_phys), pointer :: gwdcv(:,:) => null() !< integer :: h2o_coeff !< real (kind=kind_phys), pointer :: h2o_pres(:) => null() !< + real (kind=kind_phys), pointer :: hefac(:) => null() !< + real (kind=kind_phys), pointer :: hffac(:) => null() !< real (kind=kind_phys), pointer :: hflx(:) => null() !< + real (kind=kind_phys), pointer :: hflxq(:) => null() !< real (kind=kind_phys), pointer :: hflx_ice(:) => null() !< real (kind=kind_phys), pointer :: hflx_land(:) => null() !< real (kind=kind_phys), pointer :: hflx_ocean(:) => null() !< @@ -3149,17 +3159,20 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< 7=slightly decrease Cd for higher wind speed compare to 6 !< negative when cplwav2atm=.true. - i.e. two way wave coupling -!--- background vertical diffusion +!--- vertical diffusion real(kind=kind_phys) :: xkzm_m = 1.0d0 !< [in] bkgd_vdif_m background vertical diffusion for momentum real(kind=kind_phys) :: xkzm_h = 1.0d0 !< [in] bkgd_vdif_h background vertical diffusion for heat q real(kind=kind_phys) :: xkzm_s = 1.0d0 !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion real(kind=kind_phys) :: xkzminv = 0.3 !< diffusivity in inversion layers real(kind=kind_phys) :: moninq_fac = 1.0 !< turbulence diffusion coefficient factor real(kind=kind_phys) :: dspfac = 1.0 !< tke dissipative heating factor - real(kind=kind_phys) :: bl_upfr = 0.13 !< updraft fraction in boundary layer mass flux scheme real(kind=kind_phys) :: bl_dnfr = 0.1 !< downdraft fraction in boundary layer mass flux scheme +!--- parameters for canopy heat storage (CHS) parameterization + real(kind=kind_phys) :: z0fac = 0.3 + real(kind=kind_phys) :: e0fac = 0.5 + !---Cellular automaton options integer :: nca = 1 @@ -3291,9 +3304,11 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & frac_grid_off, ignore_lake, & !--- surface layer sfc_z0_type, & - ! background vertical diffusion + ! vertical diffusion xkzm_m, xkzm_h, xkzm_s, xkzminv, moninq_fac, dspfac, & bl_upfr, bl_dnfr, & + !--- canopy heat storage parameterization + z0fac, e0fac, & !--- cellular automata nca, ncells, nlives, nfracseed,nseed, nthresh, do_ca, & ca_sgs, ca_global,iseed_ca,ca_smooth,isppt_deep,nspinup, & @@ -3452,6 +3467,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%ialb = ialb Model%iems = iems Model%iaer = iaer + Model%iaerclm = iaerclm if (iaer/1000 == 1 .or. Model%iccn == 2) then Model%iaerclm = .true. ntrcaer = ntrcaerm @@ -3757,7 +3773,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%sfc_z0_type = sfc_z0_type if (Model%cplwav2atm) Model%sfc_z0_type = -1 -!--- backgroud vertical diffusion +!--- vertical diffusion Model%xkzm_m = xkzm_m Model%xkzm_h = xkzm_h Model%xkzm_s = xkzm_s @@ -3767,6 +3783,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%bl_upfr = bl_upfr Model%bl_dnfr = bl_dnfr +!--- canopy heat storage parametrization + Model%z0fac = z0fac + Model%e0fac = e0fac + !--- stochastic physics options ! do_sppt, do_shum, do_skeb and do_sfcperts are namelist variables in group ! physics that are parsed here and then compared in init_stochastic_physics @@ -3808,6 +3828,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%iau_drymassfixer = iau_drymassfixer if(Model%me==0) print *,' model init,iaufhrs=',Model%iaufhrs +!--- debug flag + Model%debug = debug + Model%pre_rad = pre_rad + !--- tracer handling Model%ntrac = size(tracer_names) #ifdef CCPP @@ -3927,10 +3951,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%ncnvcld3d = ncnvcld3d Model%nctp = nctp -!--- debug flag - Model%debug = debug - Model%pre_rad = pre_rad - !--- set initial values for time varying properties Model%ipt = 1 Model%lprnt = .false. @@ -3969,11 +3989,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- ps is replaced with p0. The value of p0 uses that in http://www.emc.ncep.noaa.gov/officenotes/newernotes/on461.pdf !--- ak/bk have been flipped from their original FV3 orientation and are defined sfc -> toa Model%si = (ak + bk * con_p0 - ak(Model%levr+1)) / (con_p0 - ak(Model%levr+1)) - - if (Model%lsm == Model%lsm_noahmp) then - Model%yearlen = 365 - Model%julian = -9999. - endif #endif #ifndef CCPP @@ -4795,7 +4810,7 @@ subroutine control_print(Model) print *, 'surface layer options' print *, ' sfc_z0_type : ', Model%sfc_z0_type print *, ' ' - print *, 'background vertical diffusion coefficients' + print *, 'vertical diffusion coefficients' print *, ' xkzm_m : ', Model%xkzm_m print *, ' xkzm_h : ', Model%xkzm_h print *, ' xkzm_s : ', Model%xkzm_s @@ -4805,6 +4820,10 @@ subroutine control_print(Model) print *, ' bl_upfr : ', Model%bl_upfr print *, ' bl_dnfr : ', Model%bl_dnfr print *, ' ' + print *, 'parameters for canopy heat storage parametrization' + print *, ' z0fac : ', Model%z0fac + print *, ' e0fac : ', Model%e0fac + print *, ' ' print *, 'stochastic physics' print *, ' do_sppt : ', Model%do_sppt print *, ' do_shum : ', Model%do_shum @@ -5933,6 +5952,7 @@ subroutine interstitial_create (Interstitial, IM, Model) allocate (Interstitial%ep1d_land (IM)) allocate (Interstitial%ep1d_ocean (IM)) allocate (Interstitial%evap (IM)) + allocate (Interstitial%evapq (IM)) allocate (Interstitial%evap_ice (IM)) allocate (Interstitial%evap_land (IM)) allocate (Interstitial%evap_ocean (IM)) @@ -5975,7 +5995,10 @@ subroutine interstitial_create (Interstitial, IM, Model) allocate (Interstitial%gwdcu (IM,Model%levs)) allocate (Interstitial%gwdcv (IM,Model%levs)) allocate (Interstitial%h2o_pres (levh2o)) + allocate (Interstitial%hefac (IM)) + allocate (Interstitial%hffac (IM)) allocate (Interstitial%hflx (IM)) + allocate (Interstitial%hflxq (IM)) allocate (Interstitial%hflx_ice (IM)) allocate (Interstitial%hflx_land (IM)) allocate (Interstitial%hflx_ocean (IM)) @@ -6573,6 +6596,7 @@ subroutine interstitial_phys_reset (Interstitial, Model) Interstitial%ep1d_land = huge Interstitial%ep1d_ocean = huge Interstitial%evap = clear_val + Interstitial%evapq = clear_val Interstitial%evap_ice = huge Interstitial%evap_land = huge Interstitial%evap_ocean = huge @@ -6611,7 +6635,10 @@ subroutine interstitial_phys_reset (Interstitial, Model) Interstitial%gflx_ocean = clear_val Interstitial%gwdcu = clear_val Interstitial%gwdcv = clear_val + Interstitial%hefac = clear_val + Interstitial%hffac = clear_val Interstitial%hflx = clear_val + Interstitial%hflxq = clear_val Interstitial%hflx_ice = huge Interstitial%hflx_land = huge Interstitial%hflx_ocean = huge @@ -6884,6 +6911,7 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno) write (0,*) 'sum(Interstitial%ep1d_land ) = ', sum(Interstitial%ep1d_land ) write (0,*) 'sum(Interstitial%ep1d_ocean ) = ', sum(Interstitial%ep1d_ocean ) write (0,*) 'sum(Interstitial%evap ) = ', sum(Interstitial%evap ) + write (0,*) 'sum(Interstitial%evapq ) = ', sum(Interstitial%evapq ) write (0,*) 'sum(Interstitial%evap_ice ) = ', sum(Interstitial%evap_ice ) write (0,*) 'sum(Interstitial%evap_land ) = ', sum(Interstitial%evap_land ) write (0,*) 'sum(Interstitial%evap_ocean ) = ', sum(Interstitial%evap_ocean ) @@ -6926,7 +6954,10 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno) write (0,*) 'sum(Interstitial%gflx_ocean ) = ', sum(Interstitial%gflx_ocean ) write (0,*) 'sum(Interstitial%gwdcu ) = ', sum(Interstitial%gwdcu ) write (0,*) 'sum(Interstitial%gwdcv ) = ', sum(Interstitial%gwdcv ) + write (0,*) 'sum(Interstitial%hefac ) = ', sum(Interstitial%hefac ) + write (0,*) 'sum(Interstitial%hffac ) = ', sum(Interstitial%hffac ) write (0,*) 'sum(Interstitial%hflx ) = ', sum(Interstitial%hflx ) + write (0,*) 'sum(Interstitial%hflxq ) = ', sum(Interstitial%hflxq ) write (0,*) 'sum(Interstitial%hflx_ice ) = ', sum(Interstitial%hflx_ice ) write (0,*) 'sum(Interstitial%hflx_land ) = ', sum(Interstitial%hflx_land ) write (0,*) 'sum(Interstitial%hflx_ocean ) = ', sum(Interstitial%hflx_ocean ) diff --git a/gfsphysics/GFS_layer/GFS_typedefs.meta b/gfsphysics/GFS_layer/GFS_typedefs.meta index f02602277..11c6ffa5e 100644 --- a/gfsphysics/GFS_layer/GFS_typedefs.meta +++ b/gfsphysics/GFS_layer/GFS_typedefs.meta @@ -3438,6 +3438,20 @@ dimensions = () type = real kind = kind_phys +[z0fac] + standard_name = surface_roughness_fraction_factor + long_name = surface roughness fraction for canopy heat storage parameterization + units = none + dimensions = () + type = real + kind = kind_phys +[e0fac] + standard_name = latent_heat_flux_fraction_factor_relative_to_sensible_heat_flux + long_name = latent heat flux fraction relative to sensible heat flux for canopy heat storage parameterization + units = none + dimensions = () + type = real + kind = kind_phys [nca] standard_name = number_of_independent_cellular_automata long_name = number of independent cellular automata @@ -6751,6 +6765,13 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys +[evapq] + standard_name = kinematic_surface_upward_latent_heat_flux_reduced_by_surface_roughness + long_name = kinematic surface upward latent heat flux reduced by surface roughness + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys [evap_ocean] standard_name = kinematic_surface_upward_latent_heat_flux_over_ocean long_name = kinematic surface upward latent heat flux over ocean @@ -7167,6 +7188,20 @@ dimensions = (vertical_dimension_of_h2o_forcing_data) type = real kind = kind_phys +[hefac] + standard_name = surface_upward_latent_heat_flux_reduction_factor + long_name = surface upward latent heat flux reduction factor from canopy heat storage + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys +[hffac] + standard_name = surface_upward_sensible_heat_flux_reduction_factor + long_name = surface upward sensible heat flux reduction factor from canopy heat storage + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux long_name = kinematic surface upward sensible heat flux @@ -7174,6 +7209,13 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys +[hflxq] + standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness + long_name = kinematic surface upward sensible heat flux reduced by surface roughness + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys [hflx_ocean] standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean long_name = kinematic surface upward sensible heat flux over ocean diff --git a/gfsphysics/physics/module_sf_noahmplsm.f90 b/gfsphysics/physics/module_sf_noahmplsm.f90 index 052c15c3d..83724aa5f 100644 --- a/gfsphysics/physics/module_sf_noahmplsm.f90 +++ b/gfsphysics/physics/module_sf_noahmplsm.f90 @@ -284,7 +284,6 @@ subroutine noahmp_sflx (parameters, & qc , soldn , lwdn , & ! in : forcing prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing - lheatstrg , & ! in : canopy heat storage albold , sneqvo , & ! in/out : stc , sh2o , smc , tah , eah , fwet , & ! in/out : canliq , canice , tv , tg , qsfc , qsnow , & ! in/out : @@ -292,9 +291,9 @@ subroutine noahmp_sflx (parameters, & zwt , wa , wt , wslake , lfmass , rtmass , & ! in/out : stmass , wood , stblcp , fastcp , lai , sai , & ! in/out : cm , ch , tauss , & ! in/out : - smcwtd ,deeprech , rech , cpfac , & ! in/out : + smcwtd ,deeprech , rech , & ! in/out : z0wrf , & - fsa , fsr , fira , fshx , ssoil , fcev , & ! out : + fsa , fsr , fira , fsh , ssoil , fcev , & ! out : fgev , fctr , ecan , etran , edir , trad , & ! out : tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out : runsrf , runsub , apar , psn , sav , sag , & ! out : @@ -331,7 +330,6 @@ subroutine noahmp_sflx (parameters, & real , intent(in) :: lwdn !downward longwave radiation (w/m2) real , intent(in) :: sfcprs !pressure (pa) real , intent(inout) :: zlvl !reference height (m) - logical , intent(in) :: lheatstrg ! flag for canopy heat storage parameterization real , intent(in) :: cosz !cosine solar zenith angle [0-1] real , intent(in) :: tbot !bottom condition for soil temp. [k] real , intent(in) :: foln !foliage nitrogen (%) [1-saturated] @@ -390,14 +388,13 @@ subroutine noahmp_sflx (parameters, & real, intent(inout) :: smcwtd !soil water content between bottom of the soil and water table [m3/m3] real, intent(inout) :: deeprech !recharge to or from the water table when deep [m] real, intent(inout) :: rech !recharge to or from the water table when shallow [m] (diagnostic) - real, intent(inout) :: cpfac ! heat capacity enhancement factor due to heat storage ! output real , intent(out) :: z0wrf !combined z0 sent to coupled model real , intent(out) :: fsa !total absorbed solar radiation (w/m2) real , intent(out) :: fsr !total reflected solar radiation (w/m2) real , intent(out) :: fira !total net lw rad (w/m2) [+ to atm] - real , intent(out) :: fshx !total sensible heat (w/m2) [+ to atm] + real , intent(out) :: fsh !total sensible heat (w/m2) [+ to atm] real , intent(out) :: fcev !canopy evap heat (w/m2) [+ to atm] real , intent(out) :: fgev !ground evap heat (w/m2) [+ to atm] real , intent(out) :: fctr !transpiration heat (w/m2) [+ to atm] @@ -443,7 +440,6 @@ subroutine noahmp_sflx (parameters, & real :: taux !wind stress: e-w (n/m2) real :: tauy !wind stress: n-s (n/m2) real :: rhoair !density air (kg/m3) - real :: fsh !total sensible heat (w/m2) [+ to atm] ! real, dimension( 1: 5) :: vocflx !voc fluxes [ug c m-2 h-1] real, dimension(-nsnow+1:nsoil) :: dzsnso !snow/soil layer thickness [m] real :: thair !potential temperature (k) @@ -628,7 +624,6 @@ subroutine noahmp_sflx (parameters, & call energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in isnow ,dt ,rhoair ,sfcprs ,qair , & !in sfctmp ,thair ,lwdn ,uu ,vv ,zlvl , & !in - lheatstrg , & !in co2air ,o2air ,solad ,solai ,cosz ,igs , & !in eair ,tbot ,zsnso ,zsoil , & !in elai ,esai ,fwet ,foln , & !in @@ -637,13 +632,13 @@ subroutine noahmp_sflx (parameters, & z0wrf , & imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out - tauy ,fira ,fsh ,fshx ,fcev ,fgev ,fctr , & !out + tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out trad ,psn ,apar ,ssoil ,btrani ,btran , & !out ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout - tauss ,cpfac , & !inout + tauss , & !inout !jref:start qc ,qsfc ,psfc , & !in t2mv ,t2mb ,fsrv , & @@ -1326,7 +1321,6 @@ end subroutine error subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in isnow ,dt ,rhoair ,sfcprs ,qair , & !in sfctmp ,thair ,lwdn ,uu ,vv ,zref , & !in - lheatstrg , & !in co2air ,o2air ,solad ,solai ,cosz ,igs , & !in eair ,tbot ,zsnso ,zsoil , & !in elai ,esai ,fwet ,foln , & !in @@ -1335,13 +1329,13 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in z0wrf , & imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out - tauy ,fira ,fsh ,fshx ,fcev ,fgev ,fctr , & !out + tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out trad ,psn ,apar ,ssoil ,btrani ,btran , & !out ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout - tauss ,cpfac , & !inout + tauss , & !inout !jref:start qc ,qsfc ,psfc , & !in t2mv ,t2mb ,fsrv , & @@ -1422,7 +1416,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real , intent(in) :: igs !growing season index (0=off, 1=on) real , intent(in) :: zref !reference height (m) - logical , intent(in) :: lheatstrg ! flag for canopy heat storage parameterization real , intent(in) :: tbot !bottom condition for soil temp. (k) real , dimension(-nsnow+1:nsoil), intent(in) :: zsnso !layer-bottom depth from snow surf [m] real , dimension( 1:nsoil), intent(in) :: zsoil !layer-bottom depth from soil surf [m] @@ -1457,7 +1450,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real , intent(out) :: tauy !wind stress: n-s (n/m2) real , intent(out) :: fira !total net lw. rad (w/m2) [+ to atm] real , intent(out) :: fsh !total sensible heat (w/m2) [+ to atm] - real , intent(out) :: fshx !total sensible heat (w/m2) [+ to atm] real , intent(out) :: fcev !canopy evaporation (w/m2) [+ to atm] real , intent(out) :: fgev !ground evaporation (w/m2) [+ to atm] real , intent(out) :: fctr !transpiration (w/m2) [+ to atm] @@ -1504,7 +1496,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real , intent(inout) :: tah !canopy air temperature (k) real , intent(inout) :: albold !snow albedo at last time step(class type) real , intent(inout) :: tauss !non-dimensional snow age - real , intent(inout) :: cpfac !heat capacity enhancement factor due to heat storage real , intent(inout) :: cm !momentum drag coefficient real , intent(inout) :: ch !sensible heat exchange coefficient real , intent(inout) :: q1 @@ -1602,11 +1593,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real, parameter :: mpe = 1.e-6 real, parameter :: psiwlt = -150. !metric potential for wilting point (m) real, parameter :: z0 = 0.01 ! bare-soil roughness length (m) (i.e., under the canopy) -! -! parameters for heat storage parametrization -! - real, parameter :: z0min = 0.2 !minimum roughness length for heat storage - real, parameter :: z0max = 1.0 !maximum roughness length for heat storage ! --------------------------------------------------------------------------------------------------- ! initialize fluxes from veg. fraction @@ -1672,13 +1658,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in z0m = z0mg zpd = zpdg end if -! -! compute heat capacity enhancement factor as a function of z0m to mimic heat storage -! - if (lheatstrg .and. (.not. parameters%urban_flag) ) then - cpfac = (z0m - z0min) / (z0max - z0min) - cpfac = 1. + min(max(cpfac, 0.0), 1.0) - endif zlvl = max(zpd,parameters%hvt) + zref if(zpdg >= zlvl) zlvl = zpdg + zref @@ -1783,7 +1762,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in latheav = hsub frozen_canopy = .true. end if - gammav = cpair*cpfac*sfcprs/(0.622*latheav) + gammav = cpair*sfcprs/(0.622*latheav) if (tg .gt. tfrz) then latheag = hvap @@ -1792,14 +1771,14 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in latheag = hsub frozen_ground = .true. end if - gammag = cpair*cpfac*sfcprs/(0.622*latheag) + gammag = cpair*sfcprs/(0.622*latheag) ! if (sfctmp .gt. tfrz) then ! lathea = hvap ! else ! lathea = hsub ! end if -! gamma = cpair*cpfac*sfcprs/(0.622*lathea) +! gamma = cpair*sfcprs/(0.622*lathea) ! surface temperatures of the ground and canopy and energy fluxes @@ -1814,7 +1793,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in uu ,vv ,sfctmp ,thair ,qair , & !in eair ,rhoair ,snowh ,vai ,gammav ,gammag , & !in fwet ,laisun ,laisha ,cwp ,dzsnso , & !in - zlvl ,cpfac ,zpd ,z0m ,fveg , & !in + zlvl ,zpd ,z0m ,fveg , & !in z0mg ,emv ,emg ,canliq ,fsno, & !in canice ,stc ,df ,rssun ,rssha , & !in rsurf ,latheav ,latheag ,parsun ,parsha ,igs , & !in @@ -1857,7 +1836,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in tauy = fveg * tauyv + (1.0 - fveg) * tauyb fira = fveg * irg + (1.0 - fveg) * irb + irc fsh = fveg * shg + (1.0 - fveg) * shb + shc - fshx = fveg * shg/cpfac + (1.0 - fveg) * shb + shc/cpfac fgev = fveg * evg + (1.0 - fveg) * evb ssoil = fveg * ghv + (1.0 - fveg) * ghb fcev = evc @@ -1876,7 +1854,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in tauy = tauyb fira = irb fsh = shb - fshx = shb fgev = evb ssoil = ghb tg = tgb @@ -3149,8 +3126,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & uu ,vv ,sfctmp ,thair ,qair , & !in eair ,rhoair ,snowh ,vai ,gammav ,gammag, & !in fwet ,laisun ,laisha ,cwp ,dzsnso , & !in - zlvl ,cpfac , & !in - zpd ,z0m ,fveg , & !in + zlvl ,zpd ,z0m ,fveg , & !in z0mg ,emv ,emg ,canliq ,fsno, & !in canice ,stc ,df ,rssun ,rssha , & !in rsurf ,latheav ,latheag ,parsun ,parsha ,igs , & !in @@ -3206,7 +3182,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real, intent(in) :: laisun !sunlit leaf area index, one-sided (m2/m2) real, intent(in) :: laisha !shaded leaf area index, one-sided (m2/m2) real, intent(in) :: zlvl !reference height (m) - real, intent(in) :: cpfac !heat capacity enhancement factor due to heat storage real, intent(in) :: zpd !zero plane displacement (m) real, intent(in) :: z0m !roughness length, momentum (m) @@ -3529,7 +3504,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & cond = cah + cvh + cgh ata = (sfctmp*cah + tg*cgh) / cond bta = cvh/cond - csh = (1.-bta)*rhoair*cpair*cpfac*cvh + csh = (1.-bta)*rhoair*cpair*cvh ! prepare for latent heat flux above veg. @@ -3540,8 +3515,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & cond = caw + cew + ctw + cgw aea = (eair*caw + estg*cgw) / cond bea = (cew+ctw)/cond - cev = (1.-bea)*cew*rhoair*cpair*cpfac/gammav ! barlage: change to vegetation v3.6 - ctr = (1.-bea)*ctw*rhoair*cpair*cpfac/gammav + cev = (1.-bea)*cew*rhoair*cpair/gammav ! barlage: change to vegetation v3.6 + ctr = (1.-bea)*ctw*rhoair*cpair/gammav ! evaluate surface fluxes with current temperature and solve for dts @@ -3549,9 +3524,9 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & eah = aea + bea*estv ! canopy air e irc = fveg*(air + cir*tv**4) - shc = fveg*rhoair*cpair*cpfac*cvh * ( tv-tah) - evc = fveg*rhoair*cpair*cpfac*cew * (estv-eah) / gammav ! barlage: change to v in v3.6 - tr = fveg*rhoair*cpair*cpfac*ctw * (estv-eah) / gammav + shc = fveg*rhoair*cpair*cvh * ( tv-tah) + evc = fveg*rhoair*cpair*cew * (estv-eah) / gammav ! barlage: change to v in v3.6 + tr = fveg*rhoair*cpair*ctw * (estv-eah) / gammav if (tv > tfrz) then evc = min(canliq*latheav/dt,evc) ! barlage: add if block for canice in v3.6 else @@ -3591,8 +3566,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & air = - emg*(1.-emv)*lwdn - emg*emv*sb*tv**4 cir = emg*sb - csh = rhoair*cpair*cpfac/rahg - cev = rhoair*cpair*cpfac / (gammag*(rawg+rsurf)) ! barlage: change to ground v3.6 + csh = rhoair*cpair/rahg + cev = rhoair*cpair/(gammag*(rawg+rsurf)) ! barlage: change to ground v3.6 cgh = 2.*df(isnow+1)/dzsnso(isnow+1) ! write(*,*)'inside tg=',tg,'stc(1)=',stc(1) @@ -3647,10 +3622,10 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & ! consistent vegetation air temperature and vapor pressure since tg is not consistent with the tah/eah ! calculation. -! tah = sfctmp + (shg+shc)/(rhoair*cpair*cpfac*cah) -! tah = sfctmp + (shg*fveg+shc)/(rhoair*cpair*cpfac*cah) ! ground flux need fveg -! eah = eair + (evc+fveg*(tr+evg))/(rhoair*caw*cpair*cpfac/gammag ) -! qfx = (qsfc-qair)*rhoair*cpfac*caw !*cpair/gammag +! tah = sfctmp + (shg+shc)/(rhoair*cpair*cah) +! tah = sfctmp + (shg*fveg+shc)/(rhoair*cpair*cah) ! ground flux need fveg +! eah = eair + (evc+fveg*(tr+evg))/(rhoair*caw*cpair/gammag ) +! qfx = (qsfc-qair)*rhoair*caw !*cpair/gammag ! 2m temperature over vegetation ( corrected for low cq2v values ) if (opt_sfc == 1 .or. opt_sfc == 2) then @@ -3663,7 +3638,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & ! q2v = (eah*0.622/(sfcprs - 0.378*eah)) q2v = qsfc else - t2mv = tah - (shg+shc/fveg)/(rhoair*cpair*cpfac) * 1./cah2 + t2mv = tah - (shg+shc/fveg)/(rhoair*cpair) * 1./cah2 ! q2v = (eah*0.622/(sfcprs - 0.378*eah))- qfx/(rhoair*fv)* 1./vkc * log((2.+z0h)/z0h) q2v = qsfc - ((evc+tr)/fveg+evg)/(latheav*rhoair) * 1./cq2v endif diff --git a/gfsphysics/physics/satmedmfvdifq.f b/gfsphysics/physics/satmedmfvdifq.f index 1cc0bbe89..478e909f0 100644 --- a/gfsphysics/physics/satmedmfvdifq.f +++ b/gfsphysics/physics/satmedmfvdifq.f @@ -173,7 +173,7 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, parameter(gamcrt=3.,gamcrq=0.,sfcfrac=0.1) parameter(vk=0.4,rimin=-100.) parameter(rbcr=0.25,zolcru=-0.02,tdzmin=1.e-3) - parameter(rlmn=30.,rlmn1=5.,rlmn2=10.) + parameter(rlmn=30.,rlmn1=5.,rlmn2=15.) parameter(rlmx=300.,elmx=300.) parameter(prmin=0.25,prmax=4.0) parameter(pr0=1.0,prtke=1.0,prscu=0.67) @@ -183,7 +183,7 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, parameter(aphi5=5.,aphi16=16.) parameter(elmfac=1.0,elefac=1.0,cql=100.) parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=5000.) - parameter(qlcr=3.5e-5,zstblmax=2500.,xkzinv=0.1) + parameter(qlcr=3.5e-5,zstblmax=2500.,xkzinv=0.15) parameter(h1=0.33333333) parameter(ck0=0.4,ck1=0.15,ch0=0.4,ch1=0.15) parameter(ce0=0.4) diff --git a/gfsphysics/physics/sfc_diff.f b/gfsphysics/physics/sfc_diff.f index ea08f5056..5874c01c1 100644 --- a/gfsphysics/physics/sfc_diff.f +++ b/gfsphysics/physics/sfc_diff.f @@ -139,11 +139,15 @@ subroutine sfc_diff(im,ps,t1,q1,z1, wind, !intent(in) z0max = max(z0max, 1.0e-6) ! czilc = 10.0 ** (- (0.40/0.07) * z0) ! fei's canopy height dependance of czil - czilc = 0.8 +! czilc = 0.8 - tem1 = 1.0 - sigmaf(i) - ztmax = z0max*exp( - tem1*tem1 - & * czilc*ca*sqrt(ustar(i,1)*(0.01/1.5e-05))) +! tem1 = 1.0 - sigmaf(i) +! ztmax = z0max*exp( - tem1*tem1 +! & * czilc*ca*sqrt(ustar(i,1)*(0.01/1.5e-05))) +! + czilc = 10.0 ** (- 4. * z0max) ! Trier et al. (2011, WAF) + ztmax = z0max * exp( - czilc * ca + & * 258.2 * sqrt(ustar(i,1)*z0max) ) ! mg, sfc-perts: add surface perturbations to ztmax/z0max ratio over land @@ -179,11 +183,16 @@ subroutine sfc_diff(im,ps,t1,q1,z1, wind, !intent(in) ! czilc = 10.0 ** (- (0.40/0.07) * z0) ! fei's canopy height ! dependance of czil - czilc = 0.8 +! czilc = 0.8 - tem1 = 1.0 - sigmaf(i) - ztmax = z0max*exp( - tem1*tem1 - & * czilc*ca*sqrt(ustar(i,2)*(0.01/1.5e-05))) +! tem1 = 1.0 - sigmaf(i) +! ztmax = z0max*exp( - tem1*tem1 +! & * czilc*ca*sqrt(ustar(i,2)*(0.01/1.5e-05))) +! + czilc = 10.0 ** (- 4. * z0max) ! Trier et al. (2011, WAF) + ztmax = z0max * exp( - czilc * ca + & * 258.2 * sqrt(ustar(i,2)*z0max) ) +! ztmax = max(ztmax, 1.0e-6) ! call stability diff --git a/gfsphysics/physics/sfc_noahmp_drv.f b/gfsphysics/physics/sfc_noahmp_drv.f index 2bd44bb79..70c1eb052 100644 --- a/gfsphysics/physics/sfc_noahmp_drv.f +++ b/gfsphysics/physics/sfc_noahmp_drv.f @@ -1,7 +1,4 @@ ! ! -! lheatstrg- logical, flag for canopy heat storage 1 ! -! parameterization ! -! ! !----------------------------------- subroutine noahmpdrv & !................................... @@ -10,7 +7,6 @@ subroutine noahmpdrv & & sfcemis, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & & prsl1, prslki, zf, dry, wind, slopetyp, & & shdmin, shdmax, snoalb, sfalb, flag_iter, flag_guess, & - & lheatstrg, & & idveg,iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, & & iopt_inf,iopt_rad, iopt_alb, iopt_snf,iopt_tbot,iopt_stc, & & xlatin,xcoszin, iyrlen, julian,imon, & @@ -109,8 +105,6 @@ subroutine noahmpdrv & real (kind=kind_phys), intent(in) :: delt logical, dimension(im), intent(in) :: flag_iter, flag_guess - logical, intent(in) :: lheatstrg - ! --- in/out: real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & & snwdph, tskin, tprcp, srflag, canopy, trans, tsurf,zorl @@ -202,8 +196,6 @@ subroutine noahmpdrv & & irb,tr,evc,chleaf,chuc,chv2,chb2, & & fpice,pahv,pahg,pahb,pah,co2pp,o2pp,ch2b - real (kind=kind_phys) :: cpfac - integer :: i, k, ice, stype, vtype ,slope,nroot,couple logical :: flag(im) logical :: snowng,frzgra @@ -580,11 +572,6 @@ subroutine noahmpdrv & call noahmp_options(idveg ,iopt_crs,iopt_btr,iopt_run,iopt_sfc, & & iopt_frz,iopt_inf,iopt_rad,iopt_alb,iopt_snf,iopt_tbot,iopt_stc) -! -! initialize heat capacity enhancement factor for heat storage parameterization -! - cpfac = 1.0 - if ( vtype == isice_table ) then ice = -1 @@ -665,7 +652,6 @@ subroutine noahmpdrv & & qc , swdn , lwdn ,& ! in : forcing & pconv , pnonc , pshcv , psnow , pgrpl , phail ,& ! in : forcing & tbot , co2pp , o2pp , foln , ficeold , zlvl ,& ! in : forcing - & lheatstrg ,& ! in : canopy heat storage & alboldx , sneqvox ,& ! in/out : & tsnsox , slsoil , smsoil , tahx , eahx , fwetx ,& ! in/out : & canliqx , canicex , tvx , tgx , qsfc1d , qsnowx ,& ! in/out : @@ -673,7 +659,7 @@ subroutine noahmpdrv & & zwtx , wax , wtx , wslakex , lfmassx , rtmassx,& ! in/out : & stmassx , woodx , stblcpx , fastcpx , xlaix ,xsaix ,& ! in/out : & cmx , chx , taussx ,& ! in/out : - & smcwtdx ,deeprechx, rechx , cpfac ,& ! in/out : + & smcwtdx ,deeprechx, rechx ,& ! in/out : & z0wrf ,& ! out & fsa , fsr , fira , fsh , ssoil , fcev ,& ! out : & fgev , fctr , ecan , etran , edir , trad ,& ! out : @@ -807,7 +793,7 @@ subroutine noahmpdrv & ! ssoil = -1.0 *ssoil call penman (sfctmp,sfcprs,chx,t2v,th2,prcp,fdown,ssoil, & - & cpfac,q2,q2sat,etp,snowng,frzgra,ffrozp,dqsdt2,emissi,fsno) + & q2,q2sat,etp,snowng,frzgra,ffrozp,dqsdt2,emissi,fsno) ep(i) = etp @@ -1069,7 +1055,7 @@ end subroutine transfer_mp_parameters subroutine penman (sfctmp,sfcprs,ch,t2v,th2,prcp,fdown,ssoil, & - & cpfac,q2,q2sat,etp,snowng,frzgra,ffrozp, & + & q2,q2sat,etp,snowng,frzgra,ffrozp, & & dqsdt2,emissi_in,sncovr) ! etp is calcuated right after ssoil @@ -1084,12 +1070,11 @@ subroutine penman (sfctmp,sfcprs,ch,t2v,th2,prcp,fdown,ssoil, & implicit none logical, intent(in) :: snowng, frzgra real, intent(in) :: ch, dqsdt2,fdown,prcp,ffrozp, & - & q2, q2sat,ssoil,cpfac, sfcprs, sfctmp, & + & q2, q2sat, ssoil, sfcprs, sfctmp, & & t2v, th2,emissi_in,sncovr real, intent(out) :: etp real :: epsca,flx2,rch,rr,t24 real :: a, delta, fnet,rad,rho,emissi,elcp1,lvs - real :: elcpx real, parameter :: elcp = 2.4888e+3, lsubc = 2.501000e+6,cp = 1004.6 real, parameter :: lsubs = 2.83e+6, rd = 287.05, cph2o = 4.1855e+3 @@ -1103,12 +1088,11 @@ subroutine penman (sfctmp,sfcprs,ch,t2v,th2,prcp,fdown,ssoil, & ! prepare partial quantities for penman equation. ! ---------------------------------------------------------------------- emissi=emissi_in - elcpx = elcp / cpfac -! elcp1 = (1.0-sncovr)*elcpx + sncovr*elcpx*lsubs/lsubc +! elcp1 = (1.0-sncovr)*elcp + sncovr*elcp*lsubs/lsubc lvs = (1.0-sncovr)*lsubc + sncovr*lsubs flx2 = 0.0 - delta = elcpx * dqsdt2 + delta = elcp * dqsdt2 ! delta = elcp1 * dqsdt2 t24 = sfctmp * sfctmp * sfctmp * sfctmp rr = t24 * 6.48e-8 / (sfcprs * ch) + 1.0 @@ -1119,7 +1103,7 @@ subroutine penman (sfctmp,sfcprs,ch,t2v,th2,prcp,fdown,ssoil, & ! adjust the partial sums / products with the latent heat ! effects caused by falling precipitation. ! ---------------------------------------------------------------------- - rch = rho * cp * cpfac * ch + rch = rho * cp * ch if (.not. snowng) then if (prcp > 0.0) rr = rr + cph2o * prcp / rch else @@ -1142,7 +1126,7 @@ subroutine penman (sfctmp,sfcprs,ch,t2v,th2,prcp,fdown,ssoil, & ! ---------------------------------------------------------------------- end if rad = fnet / rch + th2- sfctmp - a = elcpx * (q2sat - q2) + a = elcp * (q2sat - q2) ! a = elcp1 * (q2sat - q2) epsca = (a * rr + rad * delta) / (delta + rr) etp = epsca * rch / lsubc diff --git a/gfsphysics/physics/sflx.f b/gfsphysics/physics/sflx.f index f84006be9..bb816e9b2 100644 --- a/gfsphysics/physics/sflx.f +++ b/gfsphysics/physics/sflx.f @@ -64,7 +64,6 @@ subroutine sflx & ! consolidated constents/parameters by using ! ! module physcons, and added program documentation! ! ! sep 2009 -- s. moorthi minor fixes ! -! nov 2018 -- j. han add canopy heat storage parameterization ! ! ! ! ==================== defination of variables ==================== ! ! ! @@ -237,12 +236,6 @@ subroutine sflx & integer :: ice, k, kz ! -! --- parameters for heat storage parametrization -! - real (kind=kind_phys) :: cpx, cpx1, cpfac, xx1, xx2 - real (kind=kind_phys), parameter :: z0min=0.2_kind_phys, & - & z0max=1.0_kind_phys -! !===> ... begin here ! ! --- ... initialization @@ -550,7 +543,11 @@ subroutine sflx & ! overlying green canopy, adapted from section 2.1.2 of ! peters-lidard et al. (1997, jgr, vol 102(d4)) !wz only urban for igbp type - if(ivegsrc == 1 .and. vegtyp == 13) then +! +!jhan urban canopy heat storage effect is included in pbl scheme +! + if((.not.lheatstrg) .and. + & (ivegsrc == 1 .and. vegtyp == 13)) then df1 = 3.24*(1.-shdfac) + shdfac*df1*exp(sbeta*shdfac) else df1 = df1 * exp( sbeta*shdfac ) @@ -676,22 +673,6 @@ subroutine sflx & fdown = swnet + lwdn endif ! end if_couple_block -! -! --- enhance cp as a function of z0 to mimic heat storage -! - cpx = cp - cpx1 = cp1 - cpfac = 1.0 - if (lheatstrg) then - if ((ivegsrc == 1 .and. vegtyp /= 13) - & .or. ivegsrc == 2) then - xx1 = (z0 - z0min) / (z0max - z0min) - xx2 = 1.0 + min(max(xx1, 0.0), 1.0) - cpx = cp * xx2 - cpx1 = cp1 * xx2 - cpfac = cp / cpx - endif - endif ! --- ... call penman subroutine to calculate potential evaporation (etp), ! and other partial products and sums save in common/rite for later @@ -700,7 +681,7 @@ subroutine sflx & call penman ! --- inputs: ! ! ( sfctmp, sfcprs, sfcems, ch, t2v, th2, prcp, fdown, ! -! cpx, cpfac, ssoil, q2, q2sat, dqsdt2, snowng, frzgra, ! +! ssoil, q2, q2sat, dqsdt2, snowng, frzgra, ! ! --- outputs: ! ! t24, etp, rch, epsca, rr, flx2 ) ! @@ -715,7 +696,7 @@ subroutine sflx & call canres ! --- inputs: ! ! ( nsoil, nroot, swdn, ch, q2, q2sat, dqsdt2, sfctmp, ! -! cpx1, sfcprs, sfcems, sh2o, smcwlt, smcref, zsoil, rsmin, ! +! sfcprs, sfcems, sh2o, smcwlt, smcref, zsoil, rsmin, ! ! rsmax, topt, rgl, hs, xlai, ! ! --- outputs: ! ! rc, pc, rcs, rct, rcq, rcsoil ) ! @@ -735,7 +716,7 @@ subroutine sflx & ! smcdry, cmcmax, dt, shdfac, sbeta, sfctmp, sfcems, ! ! t24, th2, fdown, epsca, bexp, pc, rch, rr, cfactr, ! ! slope, kdt, frzx, psisat, zsoil, dksat, dwsat, ! -! zbot, ice, rtdis, quartz, fxexp, csoil, ! +! zbot, ice, rtdis, quartz, fxexp, csoil, lheatstrg, ! ! --- input/outputs: ! ! cmc, t1, stc, sh2o, tbot, ! ! --- outputs: ! @@ -750,7 +731,7 @@ subroutine sflx & ! cmcmax, dt, df1, sfcems, sfctmp, t24, th2, fdown, epsca, ! ! bexp, pc, rch, rr, cfactr, slope, kdt, frzx, psisat, ! ! zsoil, dwsat, dksat, zbot, shdfac, ice, rtdis, quartz, ! -! fxexp, csoil, flx2, snowng, ! +! fxexp, csoil, flx2, snowng, lheatstrg, ! ! --- input/outputs: ! ! prcp1, cmc, t1, stc, sncovr, sneqv, sndens, snowh, ! ! sh2o, tbot, beta, ! @@ -930,7 +911,7 @@ subroutine canres !................................... ! --- inputs: ! & ( nsoil, nroot, swdn, ch, q2, q2sat, dqsdt2, sfctmp, & -! & cpx1, sfcprs, sfcems, sh2o, smcwlt, smcref, zsoil, rsmin, & +! & sfcprs, sfcems, sh2o, smcwlt, smcref, zsoil, rsmin, & ! & rsmax, topt, rgl, hs, xlai, & ! --- outputs: ! & rc, pc, rcs, rct, rcq, rcsoil & @@ -963,7 +944,6 @@ subroutine canres ! q2sat - real, sat. air humidity at 1st level abv ground 1 ! ! dqsdt2 - real, slope of sat. humidity function wrt temp 1 ! ! sfctmp - real, sfc temperature at 1st level above ground 1 ! -! cpx1 - real, enhanced air heat capacity for heat storage 1 ! ! sfcprs - real, sfc pressure 1 ! ! sfcems - real, sfc emissivity for lw radiation 1 ! ! sh2o - real, volumetric soil moisture nsoil ! @@ -1069,8 +1049,8 @@ subroutine canres ! evaporation (containing rc term). rc = rsmin / (xlai*rcs*rct*rcq*rcsoil) - rr = (4.0*sfcems*sigma1*rd1/cpx1) * (sfctmp**4.0)/(sfcprs*ch) + 1.0 - delta = (lsubc/cpx1) * dqsdt2 + rr = (4.0*sfcems*sigma1*rd1/cp1) * (sfctmp**4.0)/(sfcprs*ch) + 1.0 + delta = (lsubc/cp1) * dqsdt2 pc = (rr + delta) / (rr*(1.0 + rc*ch) + delta) ! @@ -1149,7 +1129,7 @@ subroutine nopac ! & smcdry, cmcmax, dt, shdfac, sbeta, sfctmp, sfcems, & ! & t24, th2, fdown, epsca, bexp, pc, rch, rr, cfactr, & ! & slope, kdt, frzx, psisat, zsoil, dksat, dwsat, & -! & zbot, ice, rtdis, quartz, fxexp, csoil, & +! & zbot, ice, rtdis, quartz, fxexp, csoil, lheatstrg, & ! --- input/outputs: ! & cmc, t1, stc, sh2o, tbot, & ! --- outputs: @@ -1206,6 +1186,8 @@ subroutine nopac ! quartz - real, soil quartz content 1 ! ! fxexp - real, bare soil evaporation exponent 1 ! ! csoil - real, soil heat capacity 1 ! +! lheatstrg- logical, flag for canopy heat storage 1 ! +! parameterization ! ! ! ! input/outputs from and to the calling program: ! ! cmc - real, canopy moisture content 1 ! @@ -1242,7 +1224,9 @@ subroutine nopac ! & rch, rr, cfactr, slope, kdt, frzx, psisat, & ! & zsoil(nsoil), dksat, dwsat, zbot, rtdis(nsoil), & ! & quartz, fxexp, csoil - +! +! logical, intent(in) :: lheatstrg +! ! --- input/outputs: ! real (kind=kind_phys), intent(inout) :: cmc, t1, stc(nsoil), & ! & sh2o(nsoil), tbot @@ -1372,7 +1356,11 @@ subroutine nopac ! sub sfc heat flux (see additional comments on veg effect ! sub-sfc heat flx in routine sflx) !wz only urban for igbp type - if(ivegsrc == 1 .and. vegtyp == 13) then +! +!jhan urban canopy heat storage effect is included in pbl scheme +! + if((.not.lheatstrg) .and. + & (ivegsrc == 1 .and. vegtyp == 13)) then df1 = 3.24*(1.-shdfac) + shdfac*df1*exp(sbeta*shdfac) else df1 = df1 * exp( sbeta*shdfac ) @@ -1389,6 +1377,7 @@ subroutine nopac ! --- inputs: & ( nsoil, smc, smcmax, dt, yy, zz1, zsoil, zbot, & & psisat, bexp, df1, ice, quartz, csoil, vegtyp, & + & shdfac, lheatstrg, & ! --- input/outputs: & stc, t1, tbot, sh2o, & ! --- outputs: @@ -1413,7 +1402,7 @@ subroutine penman !................................... ! --- inputs: ! & ( sfctmp, sfcprs, sfcems, ch, t2v, th2, prcp, fdown, & -! & cpx, cpfac, ssoil, q2, q2sat, dqsdt2, snowng, frzgra, & +! & ssoil, q2, q2sat, dqsdt2, snowng, frzgra, & ! --- outputs: ! & t24, etp, rch, epsca, rr, flx2 & ! & ) @@ -1439,8 +1428,6 @@ subroutine penman ! th2 - real, air potential temp at zlvl abv grnd 1 ! ! prcp - real, precip rate 1 ! ! fdown - real, net solar + downward lw flux at sfc 1 ! -! cpx - real, enhanced air heat capacity for heat storage 1 ! -! cpfac - real, ratio air heat capacity to enhanced one 1 ! ! ssoil - real, upward soil heat flux 1 ! ! q2 - real, mixing ratio at hght zlvl abv ground 1 ! ! q2sat - real, sat mixing ratio at zlvl abv ground 1 ! @@ -1478,11 +1465,11 @@ subroutine penman ! --- ... prepare partial quantities for penman equation. - delta = elcp * cpfac * dqsdt2 + delta = elcp * dqsdt2 t24 = sfctmp * sfctmp * sfctmp * sfctmp rr = t24 * 6.48e-8 / (sfcprs*ch) + 1.0 rho = sfcprs / (rd1*t2v) - rch = rho * cpx * ch + rch = rho * cp * ch ! --- ... adjust the partial sums / products with the latent heat ! effects caused by falling precipitation. @@ -1508,7 +1495,7 @@ subroutine penman ! --- ... finish penman equation calculations. rad = fnet/rch + th2 - sfctmp - a = elcp * cpfac * (q2sat - q2) + a = elcp * (q2sat - q2) epsca = (a*rr + rad*delta) / (delta + rr) etp = epsca * rch / lsubc ! @@ -2169,7 +2156,7 @@ subroutine snopac ! & cmcmax, dt, df1, sfcems, sfctmp, t24, th2, fdown, epsca, & ! & bexp, pc, rch, rr, cfactr, slope, kdt, frzx, psisat, & ! & zsoil, dwsat, dksat, zbot, shdfac, ice, rtdis, quartz, & -! & fxexp, csoil, flx2, snowng, & +! & fxexp, csoil, flx2, snowng, lheatstrg, & ! --- input/outputs: ! & prcp1, cmc, t1, stc, sncovr, sneqv, sndens, snowh, & ! & sh2o, tbot, beta, & @@ -2229,6 +2216,8 @@ subroutine snopac ! csoil - real, soil heat capacity 1 ! ! flx2 - real, freezing rain latent heat flux 1 ! ! snowng - logical, snow flag 1 ! +! lheatstrg- logical, flag for canopy heat storage 1 ! +! parameterization ! ! ! ! input/outputs from and to the calling program: ! ! prcp1 - real, effective precip 1 ! @@ -2275,6 +2264,9 @@ subroutine snopac ! & csoil, fxexp, flx2, zsoil(nsoil), rtdis(nsoil) ! logical, intent(in) :: snowng +! +! logical, intent(in) :: lheatstrg +! ! --- input/outputs: ! real (kind=kind_phys), intent(inout) :: prcp1, t1, sncovr, sneqv, & @@ -2591,6 +2583,7 @@ subroutine snopac ! --- inputs: & ( nsoil, smc, smcmax, dt, yy, zz1, zsoil, zbot, & & psisat, bexp, df1, ice, quartz, csoil, vegtyp, & + & shdfac, lheatstrg, & ! --- input/outputs: & stc, t11, tbot, sh2o, & ! --- outputs: @@ -3096,6 +3089,7 @@ subroutine shflx & ! --- inputs: & ( nsoil, smc, smcmax, dt, yy, zz1, zsoil, zbot, & & psisat, bexp, df1, ice, quartz, csoil, vegtyp, & + & shdfac, lheatstrg, & ! --- input/outputs: & stc, t1, tbot, sh2o, & ! --- outputs: @@ -3130,6 +3124,9 @@ subroutine shflx & ! quartz - real, soil quartz content 1 ! ! csoil - real, soil heat capacity 1 ! ! vegtyp - integer, vegtation type 1 ! +! shdfac - real, aeral coverage of green vegetation 1 ! +! lheatstrg- logical, flag for canopy heat storage 1 ! +! parameterization ! ! ! ! input/outputs: ! ! stc - real, soil temp nsoil ! @@ -3150,8 +3147,10 @@ subroutine shflx & integer, intent(in) :: nsoil, ice, vegtyp real (kind=kind_phys), intent(in) :: smc(nsoil), smcmax, dt, yy, & - & zz1, zsoil(nsoil), zbot, psisat, bexp, df1, quartz, csoil - + & zz1, zsoil(nsoil), zbot, psisat, bexp, df1, quartz,csoil,shdfac +! + logical, intent(in) :: lheatstrg +! ! --- input/outputs: real (kind=kind_phys), intent(inout) :: stc(nsoil), t1, tbot, & & sh2o(nsoil) @@ -3205,7 +3204,7 @@ subroutine shflx & ! --- inputs: & ( nsoil, stc, smc, smcmax, zsoil, yy, zz1, tbot, & & zbot, psisat, dt, bexp, df1, quartz, csoil,vegtyp, & - & shdfac, & + & shdfac, lheatstrg, & ! --- input/outputs: & sh2o, & ! --- outputs: @@ -3846,7 +3845,7 @@ subroutine hrt & ! --- inputs: & ( nsoil, stc, smc, smcmax, zsoil, yy, zz1, tbot, & & zbot, psisat, dt, bexp, df1, quartz, csoil, vegtyp, & - & shdfac, & + & shdfac, lheatstrg, & ! --- input/outputs: & sh2o, & ! --- outputs: @@ -3883,6 +3882,9 @@ subroutine hrt & ! quartz - real, soil quartz content 1 ! ! csoil - real, soil heat capacity 1 ! ! vegtyp - integer, vegetation type 1 ! +! shdfac - real, aeral coverage of green vegetation 1 ! +! lheatstrg- logical, flag for canopy heat storage 1 ! +! parameterization ! ! ! ! input/outputs: ! ! sh2o - real, unfrozen soil moisture nsoil ! @@ -3902,6 +3904,8 @@ subroutine hrt & & smcmax, zsoil(nsoil), yy, zz1, tbot, zbot, psisat, dt, & & bexp, df1, quartz, csoil, shdfac + logical, intent(in) :: lheatstrg + ! --- input/outputs: real (kind=kind_phys), intent(inout) :: sh2o(nsoil) @@ -3923,8 +3927,11 @@ subroutine hrt & ! csoil_loc=csoil - if (ivegsrc == 1)then + if (.not.lheatstrg .and. ivegsrc == 1)then !urban +! +!jhan urban canopy heat storage effect is included in pbl scheme +! if( vegtyp == 13 ) then ! csoil_loc=3.0e6 csoil_loc=3.0e6*(1.-shdfac)+csoil*shdfac ! gvf @@ -4017,7 +4024,7 @@ subroutine hrt & call snksrc & ! --- inputs: & ( nsoil, 1, tavg, smc(1), smcmax, psisat, bexp, dt, & - & qtot, zsoil, shdfac, & + & qtot, zsoil, & ! --- input/outputs: & sh2o(1), & ! --- outputs: @@ -4063,7 +4070,11 @@ subroutine hrt & ! if ( vegtyp == 13 ) df1n = 3.24 ! endif !wz only urban for igbp type - if(ivegsrc == 1 .and. vegtyp == 13) then +! +!jhan urban canopy heat storage effect is included in pbl scheme +! + if((.not.lheatstrg) .and. + & (ivegsrc == 1 .and. vegtyp == 13)) then df1n = 3.24*(1.-shdfac) + shdfac*df1n endif @@ -4107,7 +4118,11 @@ subroutine hrt & ! if ( vegtyp == 13 ) df1n = 3.24 ! endif !wz only urban for igbp type - if(ivegsrc == 1 .and. vegtyp == 13) then +! +!jhan urban canopy heat storage effect is included in pbl scheme +! + if((.not.lheatstrg) .and. + & (ivegsrc == 1 .and. vegtyp == 13)) then df1n = 3.24*(1.-shdfac) + shdfac*df1n endif @@ -4163,7 +4178,7 @@ subroutine hrt & call snksrc & ! --- inputs: & ( nsoil, k, tavg, smc(k), smcmax, psisat, bexp, dt, & - & qtot, zsoil, shdfac, & + & qtot, zsoil, & ! --- input/outputs: & sh2o(k), & ! --- outputs: @@ -4572,7 +4587,7 @@ subroutine snksrc & !................................... ! --- inputs: & ( nsoil, k, tavg, smc, smcmax, psisat, bexp, dt, & - & qtot, zsoil, shdfac, & + & qtot, zsoil, & ! --- input/outputs: & sh2o, & ! --- outputs: @@ -4617,7 +4632,7 @@ subroutine snksrc & integer, intent(in) :: nsoil, k real (kind=kind_phys), intent(in) :: tavg, smc, smcmax, psisat, & - & bexp, dt, qtot, zsoil(nsoil), shdfac + & bexp, dt, qtot, zsoil(nsoil) ! --- input/outputs: real (kind=kind_phys), intent(inout) :: sh2o @@ -4631,14 +4646,6 @@ subroutine snksrc & ! --- external functions: ! real (kind=kind_phys) :: frh2o -!urban -! if (ivegsrc == 1)then -! if ( vegtyp == 13 ) df1=3.24 -! endif -!wz only urban for igbp type - if(ivegsrc == 1 .and. vegtyp == 13) then - df1 = 3.24*(1.-shdfac) + shdfac*df1 - endif ! !===> ... begin here ! diff --git a/gfsphysics/physics/ugwp_driver_v0.f b/gfsphysics/physics/ugwp_driver_v0.f index 4603208fc..872e5225b 100644 --- a/gfsphysics/physics/ugwp_driver_v0.f +++ b/gfsphysics/physics/ugwp_driver_v0.f @@ -8,6 +8,7 @@ module sso_coorde use machine, only: kind_phys real(kind=kind_phys),parameter :: pgwd = 1._kind_phys real(kind=kind_phys),parameter :: pgwd4 = 1._kind_phys + logical,parameter :: debugprint = .false. end module sso_coorde ! ! @@ -31,7 +32,7 @@ subroutine cires_ugwp_driver_v0(me, master, use physcons, only : con_cp, con_g, con_rd, con_rv use ugwp_wmsdis_init, only : tamp_mpa, ilaunch - use sso_coorde, only : pgwd, pgwd4 + use sso_coorde, only : pgwd, pgwd4, debugprint implicit none !input @@ -89,7 +90,7 @@ subroutine cires_ugwp_driver_v0(me, master, ! ! switches for GW-effects: pogw=1 (OGWs) pngw=1 (NGWs) pked=1 (eddy mixing) ! - if (me == master .and. kdt < 2) then + if (me == master .and. kdt < 2 .and. debugprint ) then print * write(6,*) 'FV3GFS execute ugwp_driver_v0 ' ! write(6,*) 'FV3GFS execute ugwp_driver_v0 nmtvr=', nmtvr @@ -118,7 +119,7 @@ subroutine cires_ugwp_driver_v0(me, master, & zmtb, zogw, tau_mtb, tau_ogw, tau_tofd, & du3dt_mtb, du3dt_ogw, du3dt_tms) ! - if (me == master .and. kdt < 2) then + if (me == master .and. kdt < 2 .and. debugprint) then print * write(6,*) 'FV3GFS finished gwdps_v0 in ugwp_driver_v0 ' print * @@ -190,7 +191,7 @@ subroutine cires_ugwp_driver_v0(me, master, & gw_dudt, gw_dvdt, gw_dTdt, gw_kdis, & tau_ngw, me, master, kdt) - if (me == master .and. kdt < 2) then + if (me == master .and. kdt < 2 .and. debugprint ) then print * write(6,*)'FV3GFS finished fv3_ugwp_v0 in ugwp_driver_v0 ' write(6,*) ' non-stationary GWs with GMAO/MERRA GW-forcing ' @@ -290,7 +291,7 @@ SUBROUTINE GWDPS_V0(IM, km, imx, do_tofd, &, n_tofd, ze_tofd, ztop_tofd use cires_ugwp_module, only : kxw, max_kdis, max_axyz - use sso_coorde, only : pgwd, pgwd4 + use sso_coorde, only : pgwd, pgwd4, debugprint !---------------------------------------- implicit none character(len=8) :: strsolver='PSS-1986' ! current operational solver or 'WAM-2017' @@ -432,7 +433,7 @@ SUBROUTINE GWDPS_V0(IM, km, imx, do_tofd, kxridge = float(IMX)/arad * cdmbgwd(2) - if (me == master .and. kdt == 1) then + if (me == master .and. kdt == 1 .and. debugprint) then print *, ' gwdps_v0 kxridge ', kxridge print *, ' gwdps_v0 scale2 ', cdmbgwd(2) print *, ' gwdps_v0 IMX ', imx @@ -514,7 +515,7 @@ SUBROUTINE GWDPS_V0(IM, km, imx, do_tofd, endif enddo - IF (npt == 0) then + IF (npt == 0 .and. debugprint) then ! print *, 'oro-npt = 0 elvmax ', maxval(elvmaxd), hminmt ! print *, 'oro-npt = 0 hprime ', maxval(hprime), hpmin RETURN ! No gwd/mb calculation done @@ -1053,7 +1054,7 @@ SUBROUTINE GWDPS_V0(IM, km, imx, do_tofd, ! --------------------------- IF( do_tofd ) then axtms(:,:) = 0.0 ; aytms(:,:) = 0.0 - if ( kdt == 1 .and. me == 0) then + if ( kdt == 1 .and. me == 0 .and. debugprint) then print *, 'VAY do_tofd from surface to ', ztop_tofd endif DO I = 1,npt @@ -1157,7 +1158,7 @@ SUBROUTINE GWDPS_V0(IM, km, imx, do_tofd, !============ debug ------------------------------------------------ - if (kdt <= 2 .and. me == 0) then + if (kdt <= 2 .and. me == 0 .and. debugprint) then print *, 'vgw-oro done gwdps_v0 in ugwp-v0 step-proc ', kdt, me ! print *, maxval(pdudt)*86400., minval(pdudt)*86400, 'vgw_axoro' @@ -1277,6 +1278,8 @@ subroutine fv3_ugwp_solv2_v0(klon, klev, dtime, &, zci, zdci, zci4, zci3, zci2 &, zaz_fct, zcosang, zsinang &, nwav, nazd, zcimin, zcimax + + use sso_coorde, only : debugprint ! implicit none !23456 @@ -1402,7 +1405,7 @@ subroutine fv3_ugwp_solv2_v0(klon, klev, dtime, ! rcpd = 1.0/(grav/cpd) ! 1/[g/cp] ! grav2cpd = grav*grav/cpd ! g*(g/cp)= g^2/cp - if (kdt ==1 .and. mpi_id == master) then + if (kdt ==1 .and. mpi_id == master .and. debugprint) then print *, maxval(tm1), minval(tm1), 'vgw: temp-res ' print *, 'ugwp-v0: zcimin=' , zcimin print *, 'ugwp-v0: zcimax=' , zcimax @@ -1830,7 +1833,7 @@ subroutine fv3_ugwp_solv2_v0(klon, klev, dtime, ! !--------------------------------------------------------------------------- ! - if (kdt == 1 .and. mpi_id == master) then + if (kdt == 1 .and. mpi_id == master .and. debugprint) then print *, 'vgw done ' ! print *, maxval(pdudt)*86400., minval(pdudt)*86400, 'vgw ax' @@ -1963,7 +1966,7 @@ subroutine edmix_ugwp_v0(im, levs, dtp, ! adjust PT-profile to bn2(k) = bnv2min -- neutral atmosphere ! adapt "pdtdt = (Ptadj-Ptdyn)/Ptmap" ! - print *,' UGWP-V0 unstab PT(z) via gwdTdt ', bn2(k), k +! print *,' UGWP-V0 unstab PT(z) via gwdTdt ', bn2(k), k rineg = bn2(k)/shr2(k) bn2(k) = max(bn2(k), bnv2min) diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index 652955816..7574f072b 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -89,7 +89,7 @@ module FV3GFS_io_mod integer :: tot_diag_idx = 0 integer :: total_outputlevel = 0 integer :: isco,ieco,jsco,jeco,levo,num_axes_phys - integer :: fhzero, ncld, nsoil, imp_physics + integer :: fhzero, ncld, nsoil, imp_physics, landsfcmdl real(4) :: dtp logical :: lprecip_accu character(len=64) :: Sprecip_accu @@ -181,6 +181,7 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block) integer :: nsfcprop2d, idx_opt real(kind=kind_phys), allocatable :: temp2d(:,:,:) real(kind=kind_phys), allocatable :: temp3d(:,:,:,:) + real(kind=kind_phys), allocatable :: temp3dlevsp1(:,:,:,:) character(len=32) :: name isc = Model%isc @@ -198,10 +199,12 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block) endif allocate (temp2d(isc:iec,jsc:jec,nsfcprop2d+Model%ntot3d+Model%nctp)) - allocate (temp3d(isc:iec,jsc:jec,1:lev,17+Model%ntot3d+2*ntr)) + allocate (temp3d(isc:iec,jsc:jec,1:lev,14+Model%ntot3d+2*ntr)) + allocate (temp3dlevsp1(isc:iec,jsc:jec,1:lev+1,3)) temp2d = 0. temp3d = 0. + temp3dlevsp1 = 0. do j=jsc,jec do i=isc,iec @@ -401,29 +404,30 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block) temp2d(i,j,nsfcprop2d+Model%ntot2d+l) = IPD_Data(nb)%Tbd%phy_fctd(ix,l) enddo - temp3d(i,j,:, 1) = IPD_Data(nb)%Statein%phii(ix,:) - temp3d(i,j,:, 2) = IPD_Data(nb)%Statein%prsi(ix,:) - temp3d(i,j,:, 3) = IPD_Data(nb)%Statein%prsik(ix,:) - temp3d(i,j,:, 4) = IPD_Data(nb)%Statein%phil(ix,:) - temp3d(i,j,:, 5) = IPD_Data(nb)%Statein%prsl(ix,:) - temp3d(i,j,:, 6) = IPD_Data(nb)%Statein%prslk(ix,:) - temp3d(i,j,:, 7) = IPD_Data(nb)%Statein%ugrs(ix,:) - temp3d(i,j,:, 8) = IPD_Data(nb)%Statein%vgrs(ix,:) - temp3d(i,j,:, 9) = IPD_Data(nb)%Statein%vvl(ix,:) - temp3d(i,j,:,10) = IPD_Data(nb)%Statein%tgrs(ix,:) - temp3d(i,j,:,11) = IPD_Data(nb)%Stateout%gu0(ix,:) - temp3d(i,j,:,12) = IPD_Data(nb)%Stateout%gv0(ix,:) - temp3d(i,j,:,13) = IPD_Data(nb)%Stateout%gt0(ix,:) - temp3d(i,j,:,14) = IPD_Data(nb)%Radtend%htrsw(ix,:) - temp3d(i,j,:,15) = IPD_Data(nb)%Radtend%htrlw(ix,:) - temp3d(i,j,:,16) = IPD_Data(nb)%Radtend%swhc(ix,:) - temp3d(i,j,:,17) = IPD_Data(nb)%Radtend%lwhc(ix,:) + temp3dlevsp1(i,j,:, 1) = IPD_Data(nb)%Statein%phii(ix,:) + temp3dlevsp1(i,j,:, 2) = IPD_Data(nb)%Statein%prsi(ix,:) + temp3dlevsp1(i,j,:, 3) = IPD_Data(nb)%Statein%prsik(ix,:) + + temp3d(i,j,:, 1) = IPD_Data(nb)%Statein%phil(ix,:) + temp3d(i,j,:, 2) = IPD_Data(nb)%Statein%prsl(ix,:) + temp3d(i,j,:, 3) = IPD_Data(nb)%Statein%prslk(ix,:) + temp3d(i,j,:, 4) = IPD_Data(nb)%Statein%ugrs(ix,:) + temp3d(i,j,:, 5) = IPD_Data(nb)%Statein%vgrs(ix,:) + temp3d(i,j,:, 6) = IPD_Data(nb)%Statein%vvl(ix,:) + temp3d(i,j,:, 7) = IPD_Data(nb)%Statein%tgrs(ix,:) + temp3d(i,j,:, 8) = IPD_Data(nb)%Stateout%gu0(ix,:) + temp3d(i,j,:, 9) = IPD_Data(nb)%Stateout%gv0(ix,:) + temp3d(i,j,:,10) = IPD_Data(nb)%Stateout%gt0(ix,:) + temp3d(i,j,:,11) = IPD_Data(nb)%Radtend%htrsw(ix,:) + temp3d(i,j,:,12) = IPD_Data(nb)%Radtend%htrlw(ix,:) + temp3d(i,j,:,13) = IPD_Data(nb)%Radtend%swhc(ix,:) + temp3d(i,j,:,14) = IPD_Data(nb)%Radtend%lwhc(ix,:) do l = 1,Model%ntot3d - temp3d(i,j,:,17+l) = IPD_Data(nb)%Tbd%phy_f3d(ix,:,l) + temp3d(i,j,:,14+l) = IPD_Data(nb)%Tbd%phy_f3d(ix,:,l) enddo do l = 1,ntr - temp3d(i,j,:,17+Model%ntot3d+l) = IPD_Data(nb)%Statein%qgrs(ix,:,l) - temp3d(i,j,:,17+Model%ntot3d+ntr+l) = IPD_Data(nb)%Stateout%gq0(ix,:,l) + temp3d(i,j,:,14+Model%ntot3d+l) = IPD_Data(nb)%Statein%qgrs(ix,:,l) + temp3d(i,j,:,14+Model%ntot3d+ntr+l) = IPD_Data(nb)%Stateout%gq0(ix,:,l) enddo enddo enddo @@ -433,12 +437,19 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block) write (name, '(i3.3,3x,4a)') i, ' 2d ' write(outunit,100) name, mpp_chksum(temp2d(:,:,i:i)) enddo - do i = 1,17+Model%ntot3d+2*ntr - write (name, '(i2.2,3x,4a)') i, ' 3d ' + do i = 1,3 + write (name, '(i2.2,3x,4a)') i, ' 3d levsp1' + write(outunit,100) name, mpp_chksum(temp3dlevsp1(:,:,:,i:i)) + enddo + do i = 1,14+Model%ntot3d+2*ntr + write (name, '(i2.2,3x,4a)') i, ' 3d levs' write(outunit,100) name, mpp_chksum(temp3d(:,:,:,i:i)) enddo 100 format("CHECKSUM::",A32," = ",Z20) + deallocate(temp2d) + deallocate(temp3d) + deallocate(temp3dlevsp1) end subroutine FV3GFS_IPD_checksum !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2188,8 +2199,9 @@ subroutine fv3gfs_diag_register(Diag, Time, Atm_block, Model, xlon, xlat, axes) nsoil = Model%lsoil dtp = Model%dtp imp_physics = Model%imp_physics + landsfcmdl = Model%lsm ! print *,'in fv3gfs_diag_register,ncld=',Model%ncld,Model%lsoil,Model%imp_physics, & -! ' dtp=',dtp +! ' dtp=',dtp,' landsfcmdl=',Model%lsm ! !save lon/lat for vector interpolation allocate(lon(isco:ieco,jsco:jeco)) @@ -2803,7 +2815,7 @@ subroutine fv_phys_bundle_setup(Diag, axes, phys_bundle, fcst_grid, quilting, nb call ESMF_AttributeAdd(phys_bundle(ibdl), convention="NetCDF", purpose="FV3", & attrList=(/"fhzero ", "ncld ", "nsoil ",& - "imp_physics", "dtp "/), rc=rc) + "imp_physics", "dtp ", "landsfcmdl "/), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return @@ -2828,6 +2840,10 @@ subroutine fv_phys_bundle_setup(Diag, axes, phys_bundle, fcst_grid, quilting, nb ! print *,'in fcst gfdl diag, dtp=',dtp,' ibdl=',ibdl if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + call ESMF_AttributeSet(phys_bundle(ibdl), convention="NetCDF", purpose="FV3", & + name="landsfcmdl", value=landsfcmdl, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + !end ibdl enddo ! diff --git a/io/module_write_netcdf.F90 b/io/module_write_netcdf.F90 index 270e36ec6..d15d646a6 100644 --- a/io/module_write_netcdf.F90 +++ b/io/module_write_netcdf.F90 @@ -254,6 +254,7 @@ subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, ic ! write grid_xt, grid_yt attributes if (trim(output_grid) == 'gaussian_grid' .or. & + trim(output_grid) == 'global_latlon' .or. & trim(output_grid) == 'regional_latlon') then ncerr = nf90_put_att(ncid, im_varid, "long_name", "T-cell longitude"); NC_ERR_STOP(ncerr) ncerr = nf90_put_att(ncid, im_varid, "units", "degrees_E"); NC_ERR_STOP(ncerr) @@ -281,6 +282,7 @@ subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, ic call ESMF_ArrayGather(array, arrayr8, rootPet=0, rc=rc); ESMF_ERR_RETURN(rc) if (mype==0) then if (trim(output_grid) == 'gaussian_grid' .or. & + trim(output_grid) == 'global_latlon' .or. & trim(output_grid) == 'regional_latlon') then ncerr = nf90_put_var(ncid, im_varid, values=arrayr8(:,1) ); NC_ERR_STOP(ncerr) else if (trim(output_grid) == 'rotated_latlon') then @@ -301,6 +303,7 @@ subroutine write_netcdf(fieldbundle, wrtfb, filename, mpi_comm, mype, im, jm, ic call ESMF_ArrayGather(array, arrayr8, rootPet=0, rc=rc); ESMF_ERR_RETURN(rc) if (mype==0) then if (trim(output_grid) == 'gaussian_grid' .or. & + trim(output_grid) == 'global_latlon' .or. & trim(output_grid) == 'regional_latlon') then ncerr = nf90_put_var(ncid, jm_varid, values=arrayr8(1,:) ); NC_ERR_STOP(ncerr) else if (trim(output_grid) == 'rotated_latlon') then diff --git a/io/module_write_netcdf_parallel.F90 b/io/module_write_netcdf_parallel.F90 index 7d7dbb0f7..260371ae9 100644 --- a/io/module_write_netcdf_parallel.F90 +++ b/io/module_write_netcdf_parallel.F90 @@ -277,6 +277,7 @@ subroutine write_netcdf_parallel(fieldbundle, wrtfb, filename, mpi_comm, mype, i ! write grid_xt, grid_yt attributes if (trim(output_grid) == 'gaussian_grid' .or. & + trim(output_grid) == 'global_latlon' .or. & trim(output_grid) == 'regional_latlon') then ncerr = nf90_put_att(ncid, im_varid, "long_name", "T-cell longitude"); NC_ERR_STOP(ncerr) ncerr = nf90_put_att(ncid, im_varid, "units", "degrees_E"); NC_ERR_STOP(ncerr) @@ -304,7 +305,9 @@ subroutine write_netcdf_parallel(fieldbundle, wrtfb, filename, mpi_comm, mype, i jstart = lbound(arrayr8,2); jend = ubound(arrayr8,2) !print *,'in write netcdf mpi dim 1',istart,iend,jstart,jend,shape(arrayr8),minval(arrayr8(:,jstart)),maxval(arrayr8(:,jstart)) - if (trim(output_grid) == 'gaussian_grid' .or. trim(output_grid) == 'regional_latlon') then + if (trim(output_grid) == 'gaussian_grid' .or. & + trim(output_grid) == 'global_latlon' .or. & + trim(output_grid) == 'regional_latlon') then ncerr = nf90_put_var(ncid, im_varid, values=arrayr8(:,jstart),start=(/istart/), count=(/iend-istart+1/)); NC_ERR_STOP(ncerr) else if (trim(output_grid) == 'rotated_latlon') then do i=1,im @@ -321,7 +324,9 @@ subroutine write_netcdf_parallel(fieldbundle, wrtfb, filename, mpi_comm, mype, i call ESMF_GridGetCoord(wrtGrid, coordDim=2, farrayPtr=arrayr8, rc=rc); ESMF_ERR_RETURN(rc) !print *,'in write netcdf mpi dim 2',istart,iend,jstart,jend,shape(arrayr8),minval(arrayr8(istart,:)),maxval(arrayr8(istart,:)) - if (trim(output_grid) == 'gaussian_grid' .or. trim(output_grid) == 'regional_latlon') then + if (trim(output_grid) == 'gaussian_grid' .or. & + trim(output_grid) == 'global_latlon' .or. & + trim(output_grid) == 'regional_latlon') then ncerr = nf90_put_var(ncid, jm_varid, values=arrayr8(istart,:),start=(/jstart/),count=(/jend-jstart+1/)); NC_ERR_STOP(ncerr) else if (trim(output_grid) == 'rotated_latlon') then do j=1,jm diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index a7177fe22..b0bde80b5 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -190,7 +190,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) real(ESMF_KIND_R8) :: rot_lon, rot_lat real(ESMF_KIND_R8) :: geo_lon, geo_lat real(ESMF_KIND_R8) :: lon1_r8, lat1_r8 - real(ESMF_KIND_R8) :: x1, y1, x, y + real(ESMF_KIND_R8) :: x1, y1, x, y, delat type(ESMF_TimeInterval) :: IAU_offsetTI type(ESMF_DataCopy_Flag) :: copyflag=ESMF_DATACOPY_REFERENCE ! real(8),parameter :: PI=3.14159265358979d0 @@ -403,29 +403,73 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) wrt_int_state%post_maptype = 4 deallocate(slat) - else if ( trim(output_grid) == 'latlon_grid') then - wrtgrid = ESMF_GridCreate1PeriDimUfrm(maxIndex=(/imo, jmo/), & - minCornerCoord=(/0._ESMF_KIND_R8, -80._ESMF_KIND_R8/), & - maxCornerCoord=(/360._ESMF_KIND_R8, 80._ESMF_KIND_R8/), & - staggerLocList=(/ESMF_STAGGERLOC_CENTER, ESMF_STAGGERLOC_CORNER/), rc=rc) + else if ( trim(output_grid) == 'global_latlon') then + wrtgrid = ESMF_GridCreate1PeriDim(minIndex=(/1,1/), & + maxIndex=(/imo,jmo/), regDecomp=(/1,ntasks/), & + indexflag=ESMF_INDEX_GLOBAL, name='wrt_grid',rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return -! if(wrt_int_state%mype == lead_write_task) print *,'af wrtgrd, latlon,rc=',rc, & -! 'imo=',imo,' jmo=',jmo + + call ESMF_GridAddCoord(wrtgrid, staggerLoc=ESMF_STAGGERLOC_CENTER, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + call ESMF_GridGetCoord(wrtgrid, coordDim=1, farrayPtr=lonPtr, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, file=__FILE__)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return call ESMF_GridGetCoord(wrtgrid, coordDim=2, farrayPtr=latPtr, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, file=__FILE__)) return ! bail out - - wrt_int_state%im = imo - wrt_int_state%jm = jmo + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return +! + allocate(lat(jmo), lon(imo)) + if (mod(jmo,2) == 0) then + ! if jmo even, lats do not include poles and equator + delat = 180.d0/real(jmo,8) + if(write_nemsioflip) then + do j=1,jmo + lat(j) = 90.d0 - 0.5*delat - real(j-1,8)*delat + enddo + else + do j=1,jmo + lat(j) = -90.d0 + 0.5*delat + real(j-1,8)*delat + enddo + endif + else + ! if jmo odd, lats include poles and equator + delat = 180.d0/real(jmo-1,8) + if(write_nemsioflip) then + do j=1,jmo + lat(j) = 90.d0 - real(j-1,8)*delat + enddo + else + do j=1,jmo + lat(j) = -90.d0 + real(j-1,8)*delat + enddo + endif + endif + wrt_int_state%latstart = lat(1) + wrt_int_state%latlast = lat(jmo) + do j=1,imo + lon(j) = 360.d0/real(imo,8) *real(j-1,8) + enddo + wrt_int_state%lonstart = lon(1) + wrt_int_state%lonlast = lon(imo) + do j=lbound(latPtr,2),ubound(latPtr,2) + do i=lbound(lonPtr,1),ubound(lonPtr,1) + lonPtr(i,j) = 360.d0/real(imo,8) * real(i-1,8) + latPtr(i,j) = lat(j) + enddo + enddo wrt_int_state%lat_start = lbound(latPtr,2) wrt_int_state%lat_end = ubound(latPtr,2) - wrt_int_state%lon_start = lbound(lonPtr,2) - wrt_int_state%lon_end = ubound(lonPtr,2) + wrt_int_state%lon_start = lbound(lonPtr,1) + wrt_int_state%lon_end = ubound(lonPtr,1) + allocate( wrt_int_state%lat_start_wrtgrp(wrt_int_state%petcount)) + allocate( wrt_int_state%lat_end_wrtgrp (wrt_int_state%petcount)) + call mpi_allgather(wrt_int_state%lat_start,1,MPI_INTEGER, & + wrt_int_state%lat_start_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc) + call mpi_allgather(wrt_int_state%lat_end, 1,MPI_INTEGER, & + wrt_int_state%lat_end_wrtgrp, 1, MPI_INTEGER, wrt_mpi_comm, rc) + if( lprnt ) print *,'aft wrtgrd, global_latlon, dimj_start=',wrt_int_state%lat_start_wrtgrp, & + 'dimj_end=',wrt_int_state%lat_end_wrtgrp, 'wrt_group=',n_group allocate( wrt_int_state%latPtr(wrt_int_state%lon_start:wrt_int_state%lon_end, & wrt_int_state%lat_start:wrt_int_state%lat_end)) allocate( wrt_int_state%lonPtr(wrt_int_state%lon_start:wrt_int_state%lon_end, & @@ -436,6 +480,8 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) wrt_int_state%lonPtr(i,j) = lonPtr(i,j) enddo enddo + wrt_int_state%im = imo + wrt_int_state%jm = jmo wrt_int_state%post_maptype = 0 else if ( trim(output_grid) == 'regional_latlon' .or. & @@ -758,24 +804,20 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & name="jm", value=jmo, rc=rc) - else if (trim(output_grid) == 'latlon_grid') then + else if (trim(output_grid) == 'global_latlon') then call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & name="grid", value="latlon", rc=rc) call ESMF_AttributeAdd(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - attrList=(/"lon1","lat1","lon2","lat2","dlon","dlat"/), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lon1", value=0, rc=rc) + attrList=(/"lonstart","latstart","lonlast ","latlast "/), rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lat1", value=-80, rc=rc) + name="lonstart", value=wrt_int_state%lonstart, rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lon2", value=360, rc=rc) + name="latstart", value=wrt_int_state%latstart, rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lat2", value=80, rc=rc) + name="lonlast", value=wrt_int_state%lonlast, rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="dlon", value=360.0/(imo-1), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="dlat", value=160.0/(jmo-1), rc=rc) + name="latlast", value=wrt_int_state%latlast, rc=rc) else if (trim(output_grid) == 'regional_latlon') then @@ -1113,7 +1155,8 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc) !----------------------------------------------------------------------- ! call ESMF_LogWrite("before initialize for POST", ESMF_LOGMSG_INFO, rc=rc) - if(trim(output_grid) == 'gaussian_grid' .and. wrt_int_state%write_dopost) then + if((trim(output_grid) == 'gaussian_grid' .or. & + trim(output_grid) == 'global_latlon') .and. wrt_int_state%write_dopost) then do i= 1, wrt_int_state%FBcount call post_getattr_gfs(wrt_int_state,wrt_int_state%wrtFB(i)) enddo @@ -1488,8 +1531,8 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) #endif wbeg = MPI_Wtime() call write_netcdf_parallel(file_bundle,wrt_int_state%wrtFB(nbdl), & - trim(filename), wrt_mpi_comm,wrt_int_state%mype,imo,jmo,& - ichunk2d,jchunk2d,ichunk3d,jchunk3d,kchunk3d,rc) + trim(filename), wrt_mpi_comm,wrt_int_state%mype,imo,jmo,& + ichunk2d,jchunk2d,ichunk3d,jchunk3d,kchunk3d,rc) wend = MPI_Wtime() if (lprnt) then write(*,'(A,F10.5,A,I4.2,A,I2.2)')' parallel netcdf Write Time is ',wend-wbeg & @@ -1518,6 +1561,39 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) write(*,'(A,F10.5,A,I4.2,A,I2.2)')' netcdf_esmf Write Time is ',wend-wbeg & ,' at Fcst ',NF_HOURS,':',NF_MINUTES endif + endif + + else if (trim(output_grid) == 'global_latlon') then + + if (trim(output_file(nbdl)) == 'netcdf') then + + wbeg = MPI_Wtime() + call write_netcdf(file_bundle,wrt_int_state%wrtFB(nbdl),trim(filename), & + wrt_mpi_comm,wrt_int_state%mype,imo,jmo,& + ichunk2d,jchunk2d,ichunk3d,jchunk3d,kchunk3d,rc) + wend = MPI_Wtime() + if (lprnt) then + write(*,'(A,F10.5,A,I4.2,A,I2.2)')' netcdf Write Time is ',wend-wbeg & + ,' at Fcst ',NF_HOURS,':',NF_MINUTES + endif + + else if (trim(output_file(nbdl)) == 'netcdf_parallel') then + +#ifdef NO_PARALLEL_NETCDF + rc = ESMF_RC_NOT_IMPL + print *,'netcdf_parallel not available on this machine' + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, file=__FILE__)) return +#endif + wbeg = MPI_Wtime() + call write_netcdf_parallel(file_bundle,wrt_int_state%wrtFB(nbdl), & + trim(filename), wrt_mpi_comm,wrt_int_state%mype,imo,jmo,& + ichunk2d,jchunk2d,ichunk3d,jchunk3d,kchunk3d,rc) + wend = MPI_Wtime() + if (lprnt) then + write(*,'(A,F10.5,A,I4.2,A,I2.2)')' parallel netcdf Write Time is ',wend-wbeg & + ,' at Fcst ',NF_HOURS,':',NF_MINUTES + endif else ! unknown output_file diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 85cdbf98b..829986463 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -531,11 +531,11 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc) call addLsmask2grid(fcstGrid, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return ! print *,'call addLsmask2grid after fcstGrid, rc=',rc - if( cplprint_flag ) then - call ESMF_GridWriteVTK(fcstGrid, staggerloc=ESMF_STAGGERLOC_CENTER, & - filename='fv3cap_fv3Grid', rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - endif +! if( cplprint_flag ) then +! call ESMF_GridWriteVTK(fcstGrid, staggerloc=ESMF_STAGGERLOC_CENTER, & +! filename='fv3cap_fv3Grid', rc=rc) +! if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return +! endif endif ! ! Add gridfile Attribute to the exportState