Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chsp physics update, global latlon grid, post changes and CCN-IN followup bugfix #104

Merged
merged 20 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6416bca
point to ccpp branch chsp_latlon_post
junwang-noaa Apr 17, 2020
77e08fc
add chsp code changes from Jongil
junwang-noaa Apr 17, 2020
8e1a061
add landsfcmdl variable to model sfc history file meta data
junwang-noaa Apr 17, 2020
c39ce10
add global latlon grid on write grid component, code changes from Jef…
junwang-noaa Apr 17, 2020
8da1f47
add chsp code changes in ccpp-physics
junwang-noaa Apr 18, 2020
146171c
remove support for legacy Intel compilers in CCPP gmake build
junwang-noaa Apr 18, 2020
642a96a
fix syntax error
junwang-noaa Apr 20, 2020
85691b2
fix syntax error
junwang-noaa Apr 20, 2020
2eca23f
update ccpp physics, fix syntax error
junwang-noaa Apr 20, 2020
556c882
update sflx.f in ccpp physics
junwang-noaa Apr 21, 2020
1d2ff50
CCN-IN followup bugfix
junwang-noaa Apr 21, 2020
af3836f
Bugfix for GNU compiler in io/module_wrt_grid_comp.F90; bugfix in gfs…
climbfuji Apr 21, 2020
df9ea91
Merge pull request #2 from climbfuji/chsp_latlon_post_dom_ccpp_mods
junwang-noaa Apr 22, 2020
42fd5f9
merge fv3 dycore ccpp framework and physics to the latest repoes
junwang-noaa Apr 24, 2020
389db45
Merge remote-tracking branch 'upstream/develop' into chsp_latlon_post
junwang-noaa Apr 24, 2020
8ea431d
cmeps integration changes
junwang-noaa Apr 24, 2020
e32c3bf
update CCPP with tsfcl change
junwang-noaa Apr 24, 2020
173b86f
fix timestr in module_cap_cpl.F90
junwang-noaa Apr 25, 2020
1a9f0ad
fix syntax error in ugwp_driver_v0.F
junwang-noaa Apr 25, 2020
827a276
point ccpp/physics back to NCAR master
junwang-noaa Apr 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
branch = master
[submodule "ccpp/physics"]
path = ccpp/physics
url = https://github.com/NCAR/ccpp-physics
branch = master
url = https://github.com/junwang-noaa/ccpp-physics
branch = chsp_latlon_post
4 changes: 2 additions & 2 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 3 additions & 9 deletions ccpp/build_ccpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
47 changes: 27 additions & 20 deletions cpl/module_cap_cpl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cpl/module_cplfields.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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 ", &
Expand Down
17 changes: 14 additions & 3 deletions fv3_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading