Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' of https://github.com/NOAA-GFDL/MOM6 into off…
Browse files Browse the repository at this point in the history
…line_tracer_updates

# Conflicts:
#	src/core/MOM.F90
  • Loading branch information
Andrew Shao committed Jun 16, 2017
2 parents 53d03a7 + d20e897 commit d8627bc
Show file tree
Hide file tree
Showing 18 changed files with 384 additions and 369 deletions.
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ setup:
- ln -sf $MOM6_SRC/{config_src,src,pkg} .
- test -d tests || (git clone --recursive http://gitlab.gfdl.noaa.gov/ogrp/Gaea_c3-stats-MOM6-examples.git tests)
- cd tests
- git checkout dev/gfdl
- git checkout . && git pull
- git checkout . && git checkout dev/gfdl
- git pull
- git status
- bash Gitlab/before_script.sh
- (cd MOM6-examples/src/mkmf && git pull https://github.com/adcroft/mkmf.git add_coverage_mode)
Expand Down Expand Up @@ -73,7 +73,7 @@ run:
tags:
- ncrc3
script:
- rm MOM6-examples/*.tar
- rm -f MOM6-examples/*.tar
- bash Gitlab/run_stage.sh

# Tests
Expand Down
64 changes: 33 additions & 31 deletions config_src/coupled_driver/ocean_model_MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &

! See if it is time to write out the energy.
if ((OS%Time + ((Ocean_coupling_time_step)/2) > OS%write_energy_time) .and. &
(OS%MOM_CSp%dt_trans==0.0)) then
(OS%MOM_CSp%t_dyn_rel_adv==0.0)) then
call write_energy(OS%MOM_CSp%u, OS%MOM_CSp%v, OS%MOM_CSp%h, OS%MOM_CSp%tv, &
OS%Time, OS%nstep, OS%grid, OS%GV, OS%sum_output_CSp, &
OS%MOM_CSp%tracer_flow_CSp)
Expand Down Expand Up @@ -616,33 +616,34 @@ subroutine add_berg_flux_to_shelf(G, fluxes, use_ice_shelf, density_ice, kv_ice,
end subroutine add_berg_flux_to_shelf

subroutine ocean_model_restart(OS, timestamp)
type(ocean_state_type), pointer :: OS
character(len=*), intent(in), optional :: timestamp

if (OS%MOM_CSp%dt_trans > 0.0) call MOM_error(WARNING, "ocean_model_restart "//&
"called with a non-zero dt_trans. Additional restart fields are required.")
if (.not.OS%fluxes%fluxes_used) call MOM_error(FATAL, "ocean_model_restart "//&
"was called with unused buoyancy fluxes. For conservation, the ocean "//&
"restart files can only be created after the buoyancy forcing is applied.")

if (BTEST(OS%Restart_control,1)) then
call save_restart(OS%dirs%restart_output_dir, OS%Time, OS%grid, &
OS%MOM_CSp%restart_CSp, .true., GV=OS%GV)
call forcing_save_restart(OS%forcing_CSp, OS%grid, OS%Time, &
OS%dirs%restart_output_dir, .true.)
if (OS%use_ice_shelf) then
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, OS%dirs%restart_output_dir, .true.)
endif
endif
if (BTEST(OS%Restart_control,0)) then
call save_restart(OS%dirs%restart_output_dir, OS%Time, OS%grid, &
OS%MOM_CSp%restart_CSp, GV=OS%GV)
call forcing_save_restart(OS%forcing_CSp, OS%grid, OS%Time, &
OS%dirs%restart_output_dir)
if (OS%use_ice_shelf) then
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, OS%dirs%restart_output_dir)
endif
endif
type(ocean_state_type), pointer :: OS
character(len=*), intent(in), optional :: timestamp

if (OS%MOM_CSp%t_dyn_rel_adv > 0.0) call MOM_error(WARNING, "End of MOM_main reached "//&
"with inconsistent dynamics and advective times. Additional restart fields "//&
"that have not been coded yet would be required for reproducibility.")
if (.not.OS%fluxes%fluxes_used) call MOM_error(FATAL, "ocean_model_restart "//&
"was called with unused buoyancy fluxes. For conservation, the ocean "//&
"restart files can only be created after the buoyancy forcing is applied.")

if (BTEST(OS%Restart_control,1)) then
call save_restart(OS%dirs%restart_output_dir, OS%Time, OS%grid, &
OS%MOM_CSp%restart_CSp, .true., GV=OS%GV)
call forcing_save_restart(OS%forcing_CSp, OS%grid, OS%Time, &
OS%dirs%restart_output_dir, .true.)
if (OS%use_ice_shelf) then
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, OS%dirs%restart_output_dir, .true.)
endif
endif
if (BTEST(OS%Restart_control,0)) then
call save_restart(OS%dirs%restart_output_dir, OS%Time, OS%grid, &
OS%MOM_CSp%restart_CSp, GV=OS%GV)
call forcing_save_restart(OS%forcing_CSp, OS%grid, OS%Time, &
OS%dirs%restart_output_dir)
if (OS%use_ice_shelf) then
call ice_shelf_save_restart(OS%Ice_shelf_CSp, OS%Time, OS%dirs%restart_output_dir)
endif
endif

end subroutine ocean_model_restart
! </SUBROUTINE> NAME="ocean_model_restart"
Expand Down Expand Up @@ -692,9 +693,10 @@ subroutine ocean_model_save_restart(OS, Time, directory, filename_suffix)
! restart behavior as now in FMS.
character(len=200) :: restart_dir

if (OS%MOM_CSp%dt_trans > 0.0) call MOM_error(WARNING, "ocean_model_save_restart "//&
"called with a non-zero dt_trans. Additional restart fields are required.")
if (.not.OS%fluxes%fluxes_used) call MOM_error(FATAL, "ocean_model_save_restart "//&
if (OS%MOM_CSp%t_dyn_rel_adv > 0.0) call MOM_error(WARNING, "End of MOM_main reached "//&
"with inconsistent dynamics and advective times. Additional restart fields "//&
"that have not been coded yet would be required for reproducibility.")
if (.not.OS%fluxes%fluxes_used) call MOM_error(FATAL, "ocean_model_save_restart "//&
"was called with unused buoyancy fluxes. For conservation, the ocean "//&
"restart files can only be created after the buoyancy forcing is applied.")

Expand Down
15 changes: 8 additions & 7 deletions config_src/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ program MOM_main

! See if it is time to write out the energy.
if ((Time + (Time_step_ocean/2) > write_energy_time) .and. &
(MOM_CSp%dt_trans == 0.0)) then
(MOM_CSp%t_dyn_rel_adv == 0.0)) then
call write_energy(MOM_CSp%u, MOM_CSp%v, MOM_CSp%h, &
MOM_CSp%tv, Time, n+ntstep-1, grid, GV, sum_output_CSp, &
MOM_CSp%tracer_flow_CSp)
Expand Down Expand Up @@ -546,12 +546,13 @@ program MOM_main
call cpu_clock_end(mainClock)
call cpu_clock_begin(termClock)
if (Restart_control>=0) then
if (MOM_CSp%dt_trans > 0.0) call MOM_error(WARNING, "End of MOM_main reached "//&
"with a non-zero dt_trans. Additional restart fields are required.")
if (.not.fluxes%fluxes_used .and. .not. offline_tracer_mode) call MOM_error(FATAL, &
"End of MOM_main reached "//&
"with unused buoyancy fluxes. For conservation, the ocean restart "//&
"files can only be created after the buoyancy forcing is applied.")
if (MOM_CSp%t_dyn_rel_adv > 0.0) call MOM_error(WARNING, "End of MOM_main reached "//&
"with inconsistent dynamics and advective times. Additional restart fields "//&
"that have not been coded yet would be required for reproducibility.")
if (.not.fluxes%fluxes_used .and. .not.offline_tracer_mode) call MOM_error(FATAL, &
"End of MOM_main reached with unused buoyancy fluxes. "//&
"For conservation, the ocean restart files can only be "//&
"created after the buoyancy forcing is applied.")

call save_restart(dirs%restart_output_dir, Time, grid, MOM_CSp%restart_CSp, GV=GV)
if (use_ice_shelf) call ice_shelf_save_restart(ice_shelf_CSp, Time, &
Expand Down
Loading

0 comments on commit d8627bc

Please sign in to comment.