Skip to content

Commit

Permalink
Set default calendar to 'gregorian' (#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 Jan 9, 2020
1 parent b48b640 commit 284a5f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions 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 Expand Up @@ -360,8 +361,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if(trim(output_grid) == 'gaussian_grid') 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
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, &
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

0 comments on commit 284a5f4

Please sign in to comment.