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

Set default calendar to 'gregorian' #34

Merged
merged 2 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
3 changes: 2 additions & 1 deletion fv3_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
!
CALL ESMF_ConfigGetAttribute(config=CF,value=calendar, &
label ='calendar:',rc=rc)
label ='calendar:', &
default='gregorian',rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
!
CALL ESMF_ConfigGetAttribute(config=CF,value=cpl,default=.false.,label ='cpl:',rc=rc)
Expand Down
14 changes: 8 additions & 6 deletions module_fcst_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module module_fcst_grid_comp
operator(+), operator (<), operator (>), &
operator (/=), operator (/), operator (==),&
operator (*), THIRTY_DAY_MONTHS, JULIAN, &
NOLEAP, NO_CALENDAR, date_to_string, &
get_date
GREGORIAN, NOLEAP, NO_CALENDAR, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest not change the default calendar type from Julian to Gregorian until it is fully tested in FV3 or it is confirmed by GFDL that the FV3 is working with Gregorian calendar and we can test it. So far from the previous GFDL atmosphere model driver, coupler_main.F90 we have:

    select case( uppercase(trim(calendar)) )
    case( 'JULIAN' )
        calendar_type = JULIAN
    case( 'NOLEAP' )
        calendar_type = NOLEAP
    case( 'THIRTY_DAY' )
        calendar_type = THIRTY_DAY_MONTHS
    case( 'NO_CALENDAR' )
        calendar_type = NO_CALENDAR
    case default
        call mpp_error ( FATAL, 'COUPLER_MAIN: coupler_nml entry calendar must '// &
                                'be one of JULIAN|NOLEAP|THIRTY_DAY|NO_CALENDAR.' )
    end select

It looks to me the Gregorian calendar is not supported.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is supported by FMS. GREGORIAN parameter exists in FMS, it's just not added to this select case block. All data (except for calendar attributes of course) are identical in the new baseline outputs compared to previous baselines.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we deal with GFSv15 restart files which had "Julian" specified in the coupler.res file for warming start and restart run, and it is not consistent with default "Gregorian" calendar. The fv3_cap reads calendar_type (line 461 in fv3_cap.F90) and the date, I am not sure if we can replace the calendar_type to "Gregorian" directly or we want to add some code changes to convert he Julian date to Gregrian date, or at lease add some warning message if there is any inconsistency? Please see lines 460-464 in fv3_cap.F90.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calendar type in coupler.res will be Gregorian not Julian after this change, which should be consistent. See, for example, RESTART/coupler.res in /scratch1/NCEPDEV/nems/emc.nemspara/RT/NEMSfv3gfs/ufs-public-release-20191227/fv3_gfs_v15p2_ccpp.

date_to_string, get_date

use atmos_model_mod, only: atmos_model_init, atmos_model_end, &
get_atmos_model_ungridded_dim, &
Expand Down Expand Up @@ -251,15 +251,17 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)
select case( uppercase(trim(calendar)) )
case( 'JULIAN' )
calendar_type = JULIAN
case( 'GREGORIAN' )
calendar_type = GREGORIAN
case( 'NOLEAP' )
calendar_type = NOLEAP
case( 'THIRTY_DAY' )
calendar_type = THIRTY_DAY_MONTHS
case( 'NO_CALENDAR' )
calendar_type = NO_CALENDAR
case default
call mpp_error ( FATAL, 'COUPLER_MAIN: coupler_nml entry calendar must '// &
'be one of JULIAN|NOLEAP|THIRTY_DAY|NO_CALENDAR.' )
call mpp_error ( FATAL, 'fcst_initialize: calendar must be one of '// &
'JULIAN|GREGORIAN|NOLEAP|THIRTY_DAY|NO_CALENDAR.' )
end select

endif
Expand Down Expand Up @@ -561,11 +563,11 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

call ESMF_AttributeSet(exportState, convention="NetCDF", purpose="FV3", &
name="time:calendar_type", value="JULIAN", rc=rc)
name="time:calendar_type", value=uppercase(trim(calendar)), rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

call ESMF_AttributeSet(exportState, convention="NetCDF", purpose="FV3", &
name="time:calendar", value="JULIAN", rc=rc)
name="time:calendar", value=uppercase(trim(calendar)), rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
!
! Create FieldBundle for Fields that need to be regridded bilinear
Expand Down