Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config_src/drivers/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ program MOM_main
"The default value is given by DT.", units="s", default=dt)
if (offline_tracer_mode) then
call get_param(param_file, mod_name, "DT_OFFLINE", dt_forcing, &
"Time step for the offline time step")
"Length of time between reading in of input fields", &
units='s', fail_if_missing=.true.)
dt = dt_forcing
endif
ntstep = MAX(1,ceiling(dt_forcing/dt - 0.001))
Expand Down
16 changes: 8 additions & 8 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -459,21 +459,21 @@ subroutine ALE_offline_inputs(CS, G, GV, h, tv, Reg, uhtr, vhtr, Kd, debug, OBC)
type(ALE_CS), pointer :: CS !< Regridding parameters and options
type(ocean_grid_type), intent(in ) :: G !< Ocean grid informations
type(verticalGrid_type), intent(in ) :: GV !< Ocean vertical grid structure
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(inout) :: h !< Layer thicknesses
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(inout) :: h !< Layer thicknesses [H ~> m or kg m-2]
type(thermo_var_ptrs), intent(inout) :: tv !< Thermodynamic variable structure
type(tracer_registry_type), pointer :: Reg !< Tracer registry structure
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), intent(inout) :: uhtr !< Zonal mass fluxes
real, dimension(SZI_(G),SZJB_(G),SZK_(GV)), intent(inout) :: vhtr !< Meridional mass fluxes
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1), intent(inout) :: Kd !< Input diffusivites
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), intent(inout) :: uhtr !< Zonal mass fluxes [H L2 ~> m3 or kg]
real, dimension(SZI_(G),SZJB_(G),SZK_(GV)), intent(inout) :: vhtr !< Meridional mass fluxes [H L2 ~> m3 or kg]
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1), intent(inout) :: Kd !< Input diffusivites [Z2 T-1 ~> m2 s-1]
logical, intent(in ) :: debug !< If true, then turn checksums
type(ocean_OBC_type), pointer :: OBC !< Open boundary structure
! Local variables
integer :: nk, i, j, k, isc, iec, jsc, jec
real, dimension(SZI_(G), SZJ_(G), SZK_(GV)) :: h_new ! Layer thicknesses after regridding
real, dimension(SZI_(G), SZJ_(G), SZK_(GV)) :: h_new ! Layer thicknesses after regridding [H ~> m or kg m-2]
real, dimension(SZI_(G), SZJ_(G), SZK_(GV)+1) :: dzRegrid ! The change in grid interface positions
real, dimension(SZK_(GV)) :: h_src
real, dimension(SZK_(GV)) :: h_dest, uh_dest
real, dimension(SZK_(GV)) :: temp_vec
real, dimension(SZK_(GV)) :: h_src ! Source grid thicknesses at velocity points [H ~> m or kg m-2]
real, dimension(SZK_(GV)) :: h_dest ! Destination grid thicknesses at velocity points [H ~> m or kg m-2]
real, dimension(SZK_(GV)) :: temp_vec ! Transports on the destination grid [H L2 ~> m3 or kg]

nk = GV%ke; isc = G%isc; iec = G%iec; jsc = G%jsc; jec = G%jec
dzRegrid(:,:,:) = 0.0
Expand Down
43 changes: 22 additions & 21 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ subroutine step_MOM_tracer_dyn(CS, G, GV, US, h, Time_local)
if (associated(CS%tv%T)) call hchksum(CS%tv%T, "Pre-advection T", G%HI, haloshift=1)
if (associated(CS%tv%S)) call hchksum(CS%tv%S, "Pre-advection S", G%HI, haloshift=1)
if (associated(CS%tv%frazil)) call hchksum(CS%tv%frazil, "Pre-advection frazil", G%HI, haloshift=0, &
scale=G%US%Q_to_J_kg*G%US%RZ_to_kg_m2)
scale=US%Q_to_J_kg*US%RZ_to_kg_m2)
if (associated(CS%tv%salt_deficit)) call hchksum(CS%tv%salt_deficit, &
"Pre-advection salt deficit", G%HI, haloshift=0, scale=US%RZ_to_kg_m2)
! call MOM_thermo_chksum("Pre-advection ", CS%tv, G, US)
Expand Down Expand Up @@ -1445,7 +1445,7 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
if (associated(tv%T)) call hchksum(tv%T, "Post-diabatic T", G%HI, haloshift=1)
if (associated(tv%S)) call hchksum(tv%S, "Post-diabatic S", G%HI, haloshift=1)
if (associated(tv%frazil)) call hchksum(tv%frazil, "Post-diabatic frazil", G%HI, haloshift=0, &
scale=G%US%Q_to_J_kg*G%US%RZ_to_kg_m2)
scale=US%Q_to_J_kg*US%RZ_to_kg_m2)
if (associated(tv%salt_deficit)) call hchksum(tv%salt_deficit, &
"Post-diabatic salt deficit", G%HI, haloshift=0, scale=US%RZ_to_kg_m2)
! call MOM_thermo_chksum("Post-diabatic ", tv, G, US)
Expand Down Expand Up @@ -1490,7 +1490,7 @@ subroutine step_offline(forces, fluxes, sfc_state, Time_start, time_interval, CS
type(forcing), intent(inout) :: fluxes !< pointers to forcing fields
type(surface), intent(inout) :: sfc_state !< surface ocean state
type(time_type), intent(in) :: Time_start !< starting time of a segment, as a time type
real, intent(in) :: time_interval !< time interval
real, intent(in) :: time_interval !< time interval [s]
type(MOM_control_struct), intent(inout) :: CS !< control structure from initialize_MOM

! Local pointers
Expand Down Expand Up @@ -1568,17 +1568,17 @@ subroutine step_offline(forces, fluxes, sfc_state, Time_start, time_interval, CS
! call update_transport_from_files(G, GV, CS%offline_CSp, h_end, eatr, ebtr, uhtr, vhtr, &
! CS%tv%T, CS%tv%S, fluxes, CS%use_ALE_algorithm)
! call update_transport_from_arrays(CS%offline_CSp)
call update_offline_fields(CS%offline_CSp, CS%h, fluxes, CS%use_ALE_algorithm)
call update_offline_fields(CS%offline_CSp, G, GV, US, CS%h, fluxes, CS%use_ALE_algorithm)

! Apply any fluxes into the ocean
call offline_fw_fluxes_into_ocean(G, GV, CS%offline_CSp, fluxes, CS%h)

if (.not.CS%diabatic_first) then
call offline_advection_ale(fluxes, Time_start, time_interval, CS%offline_CSp, id_clock_ALE, &
CS%h, uhtr, vhtr, converged=adv_converged)
call offline_advection_ale(fluxes, Time_start, time_interval, G, GV, US, CS%offline_CSp, &
id_clock_ALE, CS%h, uhtr, vhtr, converged=adv_converged)

! Redistribute any remaining transport
call offline_redistribute_residual(CS%offline_CSp, CS%h, uhtr, vhtr, adv_converged)
call offline_redistribute_residual(CS%offline_CSp, G, GV, US, CS%h, uhtr, vhtr, adv_converged)

! Perform offline diffusion if requested
if (.not. skip_diffusion) then
Expand All @@ -1589,23 +1589,24 @@ subroutine step_offline(forces, fluxes, sfc_state, Time_start, time_interval, CS
call calc_slope_functions(CS%h, CS%tv, dt_offline, G, GV, US, CS%VarMix, OBC=CS%OBC)
endif
call tracer_hordiff(CS%h, dt_offline, CS%MEKE, CS%VarMix, G, GV, US, &
CS%tracer_diff_CSp, CS%tracer_Reg, CS%tv)
CS%tracer_diff_CSp, CS%tracer_Reg, CS%tv)
endif
endif
endif
! The functions related to column physics of tracers is performed separately in ALE mode
if (do_vertical) then
call offline_diabatic_ale(fluxes, Time_start, Time_end, CS%offline_CSp, CS%h, eatr, ebtr)
call offline_diabatic_ale(fluxes, Time_start, Time_end, G, GV, US, CS%offline_CSp, &
CS%h, eatr, ebtr)
endif

! Last thing that needs to be done is the final ALE remapping
if (last_iter) then
if (CS%diabatic_first) then
call offline_advection_ale(fluxes, Time_start, time_interval, CS%offline_CSp, id_clock_ALE, &
CS%h, uhtr, vhtr, converged=adv_converged)
call offline_advection_ale(fluxes, Time_start, time_interval, G, GV, US, CS%offline_CSp, &
id_clock_ALE, CS%h, uhtr, vhtr, converged=adv_converged)

! Redistribute any remaining transport and perform the remaining advection
call offline_redistribute_residual(CS%offline_CSp, CS%h, uhtr, vhtr, adv_converged)
call offline_redistribute_residual(CS%offline_CSp, G, GV, US, CS%h, uhtr, vhtr, adv_converged)
! Perform offline diffusion if requested
if (.not. skip_diffusion) then
if (CS%VarMix%use_variable_mixing) then
Expand All @@ -1625,7 +1626,7 @@ subroutine step_offline(forces, fluxes, sfc_state, Time_start, time_interval, CS
call offline_fw_fluxes_out_ocean(G, GV, CS%offline_CSp, fluxes, CS%h)
! These diagnostic can be used to identify which grid points did not converge within
! the specified number of advection sub iterations
call post_offline_convergence_diags(CS%offline_CSp, CS%h, h_end, uhtr, vhtr)
call post_offline_convergence_diags(G, GV, CS%offline_CSp, CS%h, h_end, uhtr, vhtr)

! Call ALE one last time to make sure that tracers are remapped onto the layer thicknesses
! stored from the forward run
Expand All @@ -1644,9 +1645,9 @@ subroutine step_offline(forces, fluxes, sfc_state, Time_start, time_interval, CS
call MOM_error(FATAL, &
"For offline tracer mode in a non-ALE configuration, dt_offline must equal time_interval")
endif
call update_offline_fields(CS%offline_CSp, CS%h, fluxes, CS%use_ALE_algorithm)
call offline_advection_layer(fluxes, Time_start, time_interval, CS%offline_CSp, &
CS%h, eatr, ebtr, uhtr, vhtr)
call update_offline_fields(CS%offline_CSp, G, GV, US, CS%h, fluxes, CS%use_ALE_algorithm)
call offline_advection_layer(fluxes, Time_start, time_interval, G, GV, US, CS%offline_CSp, &
CS%h, eatr, ebtr, uhtr, vhtr)
! Perform offline diffusion if requested
if (.not. skip_diffusion) then
call tracer_hordiff(h_end, dt_offline, CS%MEKE, CS%VarMix, G, GV, US, &
Expand Down Expand Up @@ -2791,10 +2792,10 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
! Setup some initial parameterizations and also assign some of the subtypes
call offline_transport_init(param_file, CS%offline_CSp, CS%diabatic_CSp, G, GV, US)
call insert_offline_main( CS=CS%offline_CSp, ALE_CSp=CS%ALE_CSp, diabatic_CSp=CS%diabatic_CSp, &
diag=CS%diag, OBC=CS%OBC, tracer_adv_CSp=CS%tracer_adv_CSp, &
tracer_flow_CSp=CS%tracer_flow_CSp, tracer_Reg=CS%tracer_Reg, &
diag=CS%diag, OBC=CS%OBC, tracer_adv_CSp=CS%tracer_adv_CSp, &
tracer_flow_CSp=CS%tracer_flow_CSp, tracer_Reg=CS%tracer_Reg, &
tv=CS%tv, x_before_y=(MODULO(first_direction,2)==0), debug=CS%debug )
call register_diags_offline_transport(Time, CS%diag, CS%offline_CSp)
call register_diags_offline_transport(Time, CS%diag, CS%offline_CSp, GV, US)
endif

!--- set up group pass for u,v,T,S and h. pass_uv_T_S_h also is used in step_MOM
Expand Down Expand Up @@ -3506,7 +3507,7 @@ subroutine extract_surface_state(CS, sfc_state_in)
'Extreme surface sfc_state detected: i=',ig,'j=',jg, &
'lon=',G%geoLonT(i,j), 'lat=',G%geoLatT(i,j), &
'x=',G%gridLonT(ig), 'y=',G%gridLatT(jg), &
'D=',CS%US%Z_to_m*(G%bathyT(i,j)+G%Z_ref), 'SSH=',CS%US%Z_to_m*sfc_state%sea_lev(i,j), &
'D=',US%Z_to_m*(G%bathyT(i,j)+G%Z_ref), 'SSH=',US%Z_to_m*sfc_state%sea_lev(i,j), &
'SST=',sfc_state%SST(i,j), 'SSS=',sfc_state%SSS(i,j), &
'U-=',US%L_T_to_m_s*sfc_state%u(I-1,j), 'U+=',US%L_T_to_m_s*sfc_state%u(I,j), &
'V-=',US%L_T_to_m_s*sfc_state%v(i,J-1), 'V+=',US%L_T_to_m_s*sfc_state%v(i,J)
Expand All @@ -3515,7 +3516,7 @@ subroutine extract_surface_state(CS, sfc_state_in)
'Extreme surface sfc_state detected: i=',ig,'j=',jg, &
'lon=',G%geoLonT(i,j), 'lat=',G%geoLatT(i,j), &
'x=',G%gridLonT(i), 'y=',G%gridLatT(j), &
'D=',CS%US%Z_to_m*(G%bathyT(i,j)+G%Z_ref), 'SSH=',CS%US%Z_to_m*sfc_state%sea_lev(i,j), &
'D=',US%Z_to_m*(G%bathyT(i,j)+G%Z_ref), 'SSH=',US%Z_to_m*sfc_state%sea_lev(i,j), &
'U-=',US%L_T_to_m_s*sfc_state%u(I-1,j), 'U+=',US%L_T_to_m_s*sfc_state%u(I,j), &
'V-=',US%L_T_to_m_s*sfc_state%v(i,J-1), 'V+=',US%L_T_to_m_s*sfc_state%v(i,J)
endif
Expand Down
2 changes: 1 addition & 1 deletion src/core/MOM_CoriolisAdv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ module MOM_CoriolisAdv

!> Calculates the Coriolis and momentum advection contributions to the acceleration.
subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, US, CS, pbv)
type(ocean_grid_type), intent(in) :: G !< Ocen grid structure
type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), intent(in) :: u !< Zonal velocity [L T-1 ~> m s-1]
real, dimension(SZI_(G),SZJB_(G),SZK_(GV)), intent(in) :: v !< Meridional velocity [L T-1 ~> m s-1]
Expand Down
7 changes: 4 additions & 3 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end, &

! local variables
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1) :: &
eta ! Interface heights before diapycnal mixing [m].
eta ! Interface heights before diapycnal mixing [Z ~> m]
real, dimension(SZI_(G),SZJ_(G),CS%nMode) :: &
cn_IGW ! baroclinic internal gravity wave speeds [L T-1 ~> m s-1]
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: temp_diag ! Previous temperature for diagnostics [degC]
Expand Down Expand Up @@ -326,7 +326,7 @@ subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end, &
if (CS%id_T_predia > 0) call post_data(CS%id_T_predia, tv%T, CS%diag)
if (CS%id_S_predia > 0) call post_data(CS%id_S_predia, tv%S, CS%diag)
if (CS%id_e_predia > 0) then
call find_eta(h, tv, G, GV, US, eta, eta_to_m=1.0, dZref=G%Z_ref)
call find_eta(h, tv, G, GV, US, eta, dZref=G%Z_ref)
call post_data(CS%id_e_predia, eta, CS%diag)
endif

Expand Down Expand Up @@ -2536,6 +2536,7 @@ subroutine extract_diabatic_member(CS, opacity_CSp, optics_CSp, evap_CFL_limit,
if (present(optics_CSp)) optics_CSp => CS%optics
if (present(KPP_CSp)) KPP_CSp => CS%KPP_CSp
if (present(energetic_PBL_CSp)) energetic_PBL_CSp => CS%energetic_PBL
if (present(diabatic_aux_CSp)) diabatic_aux_CSp => CS%diabatic_aux_CSp

! Constants within diabatic_CS
if (present(evap_CFL_limit)) evap_CFL_limit = CS%evap_CFL_limit
Expand Down Expand Up @@ -3175,7 +3176,7 @@ subroutine diabatic_driver_init(Time, G, GV, US, param_file, useALEalgorithm, di
'Layer Thickness before diabatic forcing', &
trim(thickness_units), conversion=GV%H_to_MKS, v_extensive=.true.)
CS%id_e_predia = register_diag_field('ocean_model', 'e_predia', diag%axesTi, Time, &
'Interface Heights before diabatic forcing', 'm')
'Interface Heights before diabatic forcing', 'm', conversion=US%Z_to_m)
if (use_temperature) then
CS%id_T_predia = register_diag_field('ocean_model', 'temp_predia', diag%axesTL, Time, &
'Potential Temperature', 'degC')
Expand Down
Loading