Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' into remove_unused_routines
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallward authored Oct 30, 2023
2 parents e25b2c1 + 615e57f commit 3a095a7
Show file tree
Hide file tree
Showing 48 changed files with 3,755 additions and 2,194 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/coupled-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,3 @@ jobs:
- name: Compile MOM6 for the NUOPC driver
shell: bash
run: make check_mom6_api_nuopc -j

- name: Compile MOM6 for the MCT driver
shell: bash
run: make check_mom6_api_mct -j
7 changes: 0 additions & 7 deletions .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ build/opt/Makefile: MOM_ENV=$(PATH_FMS) $(OPT_FCFLAGS) $(MOM_LDFLAGS)
build/opt_target/Makefile: MOM_ENV=$(PATH_FMS) $(OPT_FCFLAGS) $(MOM_LDFLAGS)
build/coupled/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(MOM_LDFLAGS)
build/nuopc/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(MOM_LDFLAGS)
build/mct/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(MOM_LDFLAGS)
build/cov/Makefile: MOM_ENV=$(PATH_FMS) $(COV_FCFLAGS) $(COV_LDFLAGS)
build/unit/Makefile: MOM_ENV=$(PATH_FMS) $(COV_FCFLAGS) $(COV_LDFLAGS)

Expand All @@ -269,7 +268,6 @@ build/opt/Makefile: MOM_ACFLAGS=
build/opt_target/Makefile: MOM_ACFLAGS=
build/coupled/Makefile: MOM_ACFLAGS=--with-driver=FMS_cap
build/nuopc/Makefile: MOM_ACFLAGS=--with-driver=nuopc_cap
build/mct/Makefile: MOM_ACFLAGS=--with-driver=mct_cap
build/cov/Makefile: MOM_ACFLAGS=
build/unit/Makefile: MOM_ACFLAGS=--with-driver=unit_tests

Expand Down Expand Up @@ -370,11 +368,6 @@ build/coupled/ocean_model_MOM.o: build/coupled/Makefile
cd $(@D) && make $(@F)
check_mom6_api_coupled: build/coupled/ocean_model_MOM.o

# MCT driver
build/mct/mom_ocean_model_mct.o: build/mct/Makefile
cd $(@D) && make $(@F)
check_mom6_api_mct: build/mct/mom_ocean_model_mct.o


#---
# Testing
Expand Down
File renamed without changes.
48 changes: 38 additions & 10 deletions config_src/drivers/ice_solo_driver/ice_shelf_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ program Shelf_main
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT
use MOM_debugging, only : MOM_debugging_init
use MOM_diag_mediator, only : diag_mediator_init, diag_mediator_infrastructure_init
use MOM_diag_mediator, only : diag_mediator_init, diag_mediator_infrastructure_init, set_axes_info
use MOM_diag_mediator, only : diag_mediator_end, diag_ctrl, diag_mediator_close_registration
use MOM_domains, only : MOM_infra_init, MOM_infra_end
use MOM_domains, only : MOM_domains_init, clone_MOM_domain, pass_var
Expand Down Expand Up @@ -54,6 +54,8 @@ program Shelf_main
use MOM_verticalGrid, only : verticalGrid_type, verticalGridInit, verticalGridEnd
use MOM_write_cputime, only : write_cputime, MOM_write_cputime_init
use MOM_write_cputime, only : write_cputime_start_clock, write_cputime_CS
use MOM_forcing_type, only : forcing
use MOM_ice_shelf_initialize, only : initialize_ice_SMB

use MOM_ice_shelf, only : initialize_ice_shelf, ice_shelf_end, ice_shelf_CS
use MOM_ice_shelf, only : ice_shelf_save_restart, solo_step_ice_shelf
Expand All @@ -75,7 +77,9 @@ program Shelf_main
! CPU time limit. nmax is determined by evaluating the CPU time used between successive calls to
! write_cputime. Initially it is set to be very large.
integer :: nmax=2000000000

! A structure containing pointers to the thermodynamic forcing fields
! at the ocean surface.
type(forcing) :: fluxes
! A structure containing several relevant directory paths.
type(directories) :: dirs

Expand Down Expand Up @@ -104,7 +108,7 @@ program Shelf_main
real :: time_step ! The time step [T ~> s]

! A pointer to a structure containing metrics and related information.
type(ocean_grid_type), pointer :: ocn_grid
type(ocean_grid_type), pointer :: ocn_grid => NULL()

type(dyn_horgrid_type), pointer :: dG => NULL() ! A dynamic version of the horizontal grid
type(hor_index_type), pointer :: HI => NULL() ! A hor_index_type for array extents
Expand All @@ -114,7 +118,7 @@ program Shelf_main
type(ocean_OBC_type), pointer :: OBC => NULL()

! A pointer to a structure containing dimensional unit scaling factors.
type(unit_scale_type), pointer :: US
type(unit_scale_type), pointer :: US => NULL()

type(diag_ctrl), pointer :: &
diag => NULL() ! A pointer to the diagnostic regulatory structure
Expand All @@ -138,8 +142,9 @@ program Shelf_main
integer :: yr, mon, day, hr, mins, sec ! Temp variables for writing the date.
type(param_file_type) :: param_file ! The structure indicating the file(s)
! containing all run-time parameters.
real :: smb !A constant surface mass balance that can be specified in the param_file
character(len=9) :: month
character(len=16) :: calendar = 'julian'
character(len=16) :: calendar = 'noleap'
integer :: calendar_type=-1

integer :: unit, io_status, ierr
Expand Down Expand Up @@ -184,6 +189,8 @@ program Shelf_main
endif
endif

! Get the names of the I/O directories and initialization file.
! Also calls the subroutine that opens run-time parameter files.
call Get_MOM_Input(param_file, dirs)

! Read ocean_solo restart, which can override settings from the namelist.
Expand Down Expand Up @@ -252,8 +259,11 @@ program Shelf_main
! Set up the ocean model domain and grid; the ice model grid is set in initialize_ice_shelf,
! but the grids have strong commonalities in this configuration, and the ocean grid is required
! to set up the diag mediator control structure.
call MOM_domains_init(ocn_grid%domain, param_file)
allocate(ocn_grid)
call MOM_domains_init(ocn_grid%domain, param_file) !, domain_name='MOM')
allocate(HI)
call hor_index_init(ocn_grid%Domain, HI, param_file)
allocate(dG)
call create_dyn_horgrid(dG, HI)
call clone_MOM_domain(ocn_grid%Domain, dG%Domain)

Expand All @@ -266,11 +276,16 @@ program Shelf_main
! Initialize the diag mediator. The ocean's vertical grid is not really used here, but at
! present the interface to diag_mediator_init assumes the presence of ocean-specific information.
call verticalGridInit(param_file, GV, US)
allocate(diag)
call diag_mediator_init(ocn_grid, GV, US, GV%ke, param_file, diag, doc_file_dir=dirs%output_directory)

call callTree_waypoint("returned from diag_mediator_init()")

call initialize_ice_shelf(param_file, ocn_grid, Time, ice_shelf_CSp, diag)
call set_axes_info(ocn_grid, GV, US, param_file, diag)

call initialize_ice_shelf(param_file, ocn_grid, Time, ice_shelf_CSp, diag, fluxes_in=fluxes, solo_ice_sheet_in=.true.)

call initialize_ice_SMB(fluxes%shelf_sfc_mass_flux, ocn_grid, US, param_file)

! This is the end of the code that is the counterpart of MOM_initialization.
call callTree_waypoint("End of ice shelf initialization.")
Expand Down Expand Up @@ -378,7 +393,7 @@ program Shelf_main

! This call steps the model over a time time_step.
Time1 = Master_Time ; Time = Master_Time
call solo_step_ice_shelf(ice_shelf_CSp, Time_step_shelf, ns_ice, Time)
call solo_step_ice_shelf(ice_shelf_CSp, Time_step_shelf, ns_ice, Time, fluxes_in=fluxes)

! Time = Time + Time_step_shelf
! This is here to enable fractional-second time steps.
Expand Down Expand Up @@ -412,6 +427,20 @@ program Shelf_main
if (BTEST(Restart_control,0)) then
call ice_shelf_save_restart(ice_shelf_CSp, Time, dirs%restart_output_dir)
endif
! Write ice shelf solo restart file.
if (is_root_pe())then
call open_ASCII_file(unit, trim(dirs%restart_output_dir)//'shelf.res')
write(unit, '(i6,8x,a)') calendar_type, &
'(Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)'

call get_date(Start_time, yr, mon, day, hr, mins, sec)
write(unit, '(6i6,8x,a)') yr, mon, day, hr, mins, sec, &
'Model start time: year, month, day, hour, minute, second'
call get_date(Time, yr, mon, day, hr, mins, sec)
write(unit, '(6i6,8x,a)') yr, mon, day, hr, mins, sec, &
'Current model time: year, month, day, hour, minute, second'
call close_file(unit)
endif
restart_time = restart_time + restint
endif

Expand Down Expand Up @@ -456,12 +485,11 @@ program Shelf_main
endif

call callTree_waypoint("End Shelf_main")
call ice_shelf_end(ice_shelf_CSp)
call diag_mediator_end(Time, diag, end_diag_manager=.true.)
if (cpu_steps > 0) call write_cputime(Time, ns-1, write_CPU_CSp, call_end=.true.)
call cpu_clock_end(termClock)

call io_infra_end ; call MOM_infra_end

call ice_shelf_end(ice_shelf_CSp)

end program Shelf_main
Loading

0 comments on commit 3a095a7

Please sign in to comment.