Skip to content

Commit

Permalink
Merge pull request mom-ocean#1453 from MJHarrison-GFDL/SPEAR_ECDA
Browse files Browse the repository at this point in the history
Spear ecda
  • Loading branch information
marshallward authored Sep 1, 2021
2 parents ebd0393 + 88da4c9 commit f98b76d
Show file tree
Hide file tree
Showing 4 changed files with 340 additions and 114 deletions.
13 changes: 10 additions & 3 deletions config_src/infra/FMS1/MOM_interp_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ end subroutine time_interp_extern_3d

!> initialize an external field
integer function init_extern_field(file, fieldname, MOM_domain, domain, verbose, &
threading, ierr, ignore_axis_atts )
threading, ierr, ignore_axis_atts, correct_leap_year_inconsistency )

character(len=*), intent(in) :: file !< The name of the file to read
character(len=*), intent(in) :: fieldname !< The name of the field in the file
Expand All @@ -246,13 +246,20 @@ integer function init_extern_field(file, fieldname, MOM_domain, domain, verbose,
logical, optional, intent(in) :: ignore_axis_atts !< If present and true, do not issue a
!! fatal error if the axis Cartesian attribute is
!! not set to a recognized value.
logical, optional, intent(in) :: correct_leap_year_inconsistency !< If present and true,
!! then if, (1) a calendar containing leap years
!! is in use, and (2) the modulo time period of the
!! data is an integer number of years, then map
!! a model date of Feb 29. onto a common year on Feb. 28.

if (present(MOM_Domain)) then
init_extern_field = init_external_field(file, fieldname, domain=MOM_domain%mpp_domain, &
verbose=verbose, threading=threading, ierr=ierr, ignore_axis_atts=ignore_axis_atts)
verbose=verbose, threading=threading, ierr=ierr, ignore_axis_atts=ignore_axis_atts, &
correct_leap_year_inconsistency=correct_leap_year_inconsistency)
else
init_extern_field = init_external_field(file, fieldname, domain=domain, &
verbose=verbose, threading=threading, ierr=ierr, ignore_axis_atts=ignore_axis_atts)
verbose=verbose, threading=threading, ierr=ierr, ignore_axis_atts=ignore_axis_atts, &
correct_leap_year_inconsistency=correct_leap_year_inconsistency)
endif

end function init_extern_field
Expand Down
15 changes: 12 additions & 3 deletions config_src/infra/FMS2/MOM_interp_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ end subroutine time_interp_extern_3d

!> initialize an external field
integer function init_extern_field(file, fieldname, MOM_domain, domain, verbose, &
threading, ierr, ignore_axis_atts )
threading, ierr, ignore_axis_atts, correct_leap_year_inconsistency )

character(len=*), intent(in) :: file !< The name of the file to read
character(len=*), intent(in) :: fieldname !< The name of the field in the file
Expand All @@ -246,13 +246,22 @@ integer function init_extern_field(file, fieldname, MOM_domain, domain, verbose,
logical, optional, intent(in) :: ignore_axis_atts !< If present and true, do not issue a
!! fatal error if the axis Cartesian attribute is
!! not set to a recognized value.
logical, optional, intent(in) :: correct_leap_year_inconsistency !< If present and true,
!! then if, (1) a calendar containing leap years
!! is in use, and (2) the modulo time period of the
!! data is an integer number of years, then map
!! a model date of Feb 29. onto a common year on Feb. 28.



if (present(MOM_Domain)) then
init_extern_field = init_external_field(file, fieldname, domain=MOM_domain%mpp_domain, &
verbose=verbose, threading=threading, ierr=ierr, ignore_axis_atts=ignore_axis_atts)
verbose=verbose, threading=threading, ierr=ierr, ignore_axis_atts=ignore_axis_atts, &
correct_leap_year_inconsistency=correct_leap_year_inconsistency)
else
init_extern_field = init_external_field(file, fieldname, domain=domain, &
verbose=verbose, threading=threading, ierr=ierr, ignore_axis_atts=ignore_axis_atts)
verbose=verbose, threading=threading, ierr=ierr, ignore_axis_atts=ignore_axis_atts, &
correct_leap_year_inconsistency=correct_leap_year_inconsistency)
endif

end function init_extern_field
Expand Down
10 changes: 8 additions & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,13 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
call enable_averages(dtdia, Time_end_thermo, CS%diag)

if (associated(CS%odaCS)) then
call apply_oda_tracer_increments(US%T_to_s*dtdia, G, GV, tv, h, CS%odaCS)
if (CS%debug) then
call MOM_thermo_chksum("Pre-oda ", tv, G, US, haloshift=0)
endif
call apply_oda_tracer_increments(US%T_to_s*dtdia, Time_end_thermo, G, GV, tv, h, CS%odaCS)
if (CS%debug) then
call MOM_thermo_chksum("Post-oda ", tv, G, US, haloshift=0)
endif
endif

if (associated(fluxes%p_surf) .or. associated(fluxes%p_surf_full)) then
Expand Down Expand Up @@ -2807,7 +2813,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
(LEN_TRIM(dirs%input_filename) == 1))

if (CS%ensemble_ocean) then
call init_oda(Time, G, GV, CS%odaCS)
call init_oda(Time, G, GV, CS%diag, CS%odaCS)
endif

!### This could perhaps go here instead of in finish_MOM_initialization?
Expand Down
Loading

0 comments on commit f98b76d

Please sign in to comment.