Skip to content

Commit

Permalink
Set default calendar to 'gregorian' (See NOAA-EMC#34)
Browse files Browse the repository at this point in the history
* set default calendar to gregorian
* set default values of write_nemsioflip and write_fsyncflag to .true.
  • Loading branch information
DusanJovic-NOAA committed May 5, 2020
1 parent 57bce37 commit 0ea6ce6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
7 changes: 4 additions & 3 deletions fv3_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if(mype == 0) print *,'af nems config,restart_interval=',restart_interval
!
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 Expand Up @@ -403,8 +404,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
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)
call ESMF_ConfigGetAttribute(config=CF, value=write_fsyncflag, label ='write_fsyncflag:',rc=rc)
call ESMF_ConfigGetAttribute(config=CF, value=write_nemsioflip, label ='write_nemsioflip:', default=.true., rc=rc)
call ESMF_ConfigGetAttribute(config=CF, value=write_fsyncflag, label ='write_fsyncflag:', default=.true., rc=rc)
if (mype == 0) then
print *,'imo=',imo,'jmo=',jmo
print *,'write_nemsioflip=',write_nemsioflip,'write_fsyncflag=',write_fsyncflag
Expand Down
16 changes: 9 additions & 7 deletions module_fcst_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ module module_fcst_grid_comp
operator(+), operator(-), operator (<), &
operator (>), operator (/=), operator (/), &
operator (==), operator (*), &
THIRTY_DAY_MONTHS, JULIAN, NOLEAP, &
NO_CALENDAR, date_to_string, get_date, &
get_time
THIRTY_DAY_MONTHS, JULIAN, GREGORIAN, &
NOLEAP, NO_CALENDAR, &
date_to_string, get_date, get_time

use atmos_model_mod, only: atmos_model_init, atmos_model_end, &
get_atmos_model_ungridded_dim, &
Expand Down Expand Up @@ -255,15 +255,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 @@ -596,11 +598,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

0 comments on commit 0ea6ce6

Please sign in to comment.