@@ -43,15 +43,15 @@ module MOM_ocean_model_nuopc
4343use MOM_tracer_flow_control, only : call_tracer_register, tracer_flow_control_init
4444use MOM_tracer_flow_control, only : call_tracer_flux_init
4545use MOM_unit_scaling, only : unit_scale_type
46- use MOM_variables, only : surface, stochastic_pattern
46+ use MOM_variables, only : surface
4747use MOM_verticalGrid, only : verticalGrid_type
4848use MOM_ice_shelf, only : initialize_ice_shelf, shelf_calc_flux, ice_shelf_CS
4949use MOM_ice_shelf, only : add_shelf_forces, ice_shelf_end, ice_shelf_save_restart
5050use coupler_types_mod, only : coupler_1d_bc_type, coupler_2d_bc_type
5151use coupler_types_mod, only : coupler_type_spawn, coupler_type_write_chksums
5252use coupler_types_mod, only : coupler_type_initialized, coupler_type_copy_data
5353use coupler_types_mod, only : coupler_type_set_diags, coupler_type_send_data
54- use mpp_domains_mod, only : domain2d, mpp_get_layout, mpp_get_global_domain
54+ use mpp_domains_mod, only : domain2d, mpp_get_layout, mpp_get_global_domain,mpp_get_pelist
5555use mpp_domains_mod, only : mpp_define_domains, mpp_get_compute_domain, mpp_get_data_domain
5656use fms_mod, only : stdout
5757use mpp_mod, only : mpp_chksum
@@ -62,7 +62,7 @@ module MOM_ocean_model_nuopc
6262use MOM_surface_forcing_nuopc, only : convert_IOB_to_forces, ice_ocn_bnd_type_chksum
6363use MOM_surface_forcing_nuopc, only : ice_ocean_boundary_type, surface_forcing_CS
6464use MOM_surface_forcing_nuopc, only : forcing_save_restart
65- use MOM_domains, only : root_PE,PE_here,Get_PElist, num_PEs
65+ use MOM_domains, only : root_PE,PE_here,num_PEs
6666use stochastic_physics, only : init_stochastic_physics_ocn, run_stochastic_physics_ocn
6767
6868#include < MOM_memory.h>
@@ -191,7 +191,6 @@ module MOM_ocean_model_nuopc
191191 ! ! timesteps are taken per thermodynamic step.
192192 type (surface) :: sfc_state ! < A structure containing pointers to
193193 ! ! the ocean surface state fields.
194- type (stochastic_pattern) :: stochastics ! < A structure containing pointers to
195194 type (ocean_grid_type), pointer :: &
196195 grid = > NULL () ! < A pointer to a grid structure containing metrics
197196 ! ! and related information.
@@ -254,7 +253,6 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
254253 ! ! If HFrz <= 0 (default), melt potential will not be computed.
255254 logical :: use_melt_pot! < If true, allocate melt_potential array
256255! stochastic physics
257- integer ,allocatable :: pelist(:) ! list of pes for this instance of the ocean
258256 integer :: mom_comm ! list of pes for this instance of the ocean
259257 integer :: num_procs ! number of processors to pass to stochastic physics
260258 integer :: iret ! return code from stochastic physics
@@ -441,8 +439,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
441439 default= .false. )
442440 if (OS% do_sppt .OR. OS% pert_epbl) then
443441 num_procs= num_PEs()
444- allocate (pelist(num_procs))
445- call Get_PElist(pelist,commID = mom_comm)
442+ call mpp_get_pelist(Ocean_sfc% domain, mom_comm)
446443 me= PE_here()
447444 master= root_PE()
448445
@@ -455,10 +452,10 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
455452 return
456453 endif
457454
458- if (OS% do_sppt) allocate (OS% stochastics % sppt_wts(OS% grid% isd:OS% grid% ied,OS% grid% jsd:OS% grid% jed))
455+ if (OS% do_sppt) allocate (OS% fluxes % sppt_wts(OS% grid% isd:OS% grid% ied,OS% grid% jsd:OS% grid% jed))
459456 if (OS% pert_epbl) then
460- allocate (OS% stochastics % t_rp1 (OS% grid% isd:OS% grid% ied,OS% grid% jsd:OS% grid% jed))
461- allocate (OS% stochastics % t_rp2 (OS% grid% isd:OS% grid% ied,OS% grid% jsd:OS% grid% jed))
457+ allocate (OS% fluxes % epbl1_wts (OS% grid% isd:OS% grid% ied,OS% grid% jsd:OS% grid% jed))
458+ allocate (OS% fluxes % epbl2_wts (OS% grid% isd:OS% grid% ied,OS% grid% jsd:OS% grid% jed))
462459 endif
463460 endif
464461 call close_param_file(param_file)
@@ -632,7 +629,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
632629
633630! update stochastic physics patterns before running next time-step
634631 if (OS% do_sppt .OR. OS% pert_epbl ) then
635- call run_stochastic_physics_ocn(OS% stochastics % sppt_wts,OS% stochastics % t_rp1 ,OS% stochastics % t_rp2 )
632+ call run_stochastic_physics_ocn(OS% fluxes % sppt_wts,OS% fluxes % epbl1_wts ,OS% fluxes % epbl2_wts )
636633 endif
637634
638635 if (OS% offline_tracer_mode) then
@@ -641,12 +638,11 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
641638 ! The call sequence is being orchestrated from outside of update_ocean_model.
642639 call step_MOM(OS% forces, OS% fluxes, OS% sfc_state, Time1, dt_coupling, OS% MOM_CSp, &
643640 Waves= OS% Waves, do_dynamics= do_thermo, do_thermodynamics= do_dyn, &
644- reset_therm= Ocn_fluxes_used, stochastics = OS % stochastics )
641+ reset_therm= Ocn_fluxes_used)
645642 ! ### What to do with these? , start_cycle=(n==1), end_cycle=.false., cycle_length=dt_coupling)
646643
647644 elseif (OS% single_step_call) then
648- call step_MOM(OS% forces, OS% fluxes, OS% sfc_state, Time1, dt_coupling, OS% MOM_CSp, Waves= OS% Waves, &
649- stochastics= OS% stochastics)
645+ call step_MOM(OS% forces, OS% fluxes, OS% sfc_state, Time1, dt_coupling, OS% MOM_CSp, Waves= OS% Waves)
650646 else
651647 n_max = 1 ; if (dt_coupling > OS% dt) n_max = ceiling (dt_coupling/ OS% dt - 0.001 )
652648 dt_dyn = dt_coupling / real (n_max)
@@ -671,19 +667,16 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
671667 dtdia = dt_dyn* min (nts,n_max- (n-1 ))
672668 call step_MOM(OS% forces, OS% fluxes, OS% sfc_state, Time2, dtdia, OS% MOM_CSp, &
673669 Waves= OS% Waves, do_dynamics= .false. , do_thermodynamics= .true. , &
674- start_cycle= (n== 1 ), end_cycle= .false. , cycle_length= dt_coupling, &
675- stochastics= OS% stochastics)
670+ start_cycle= (n== 1 ), end_cycle= .false. , cycle_length= dt_coupling)
676671 endif
677672
678673 call step_MOM(OS% forces, OS% fluxes, OS% sfc_state, Time2, dt_dyn, OS% MOM_CSp, &
679674 Waves= OS% Waves, do_dynamics= .true. , do_thermodynamics= .false. , &
680- start_cycle= .false. , end_cycle= (n== n_max), cycle_length= dt_coupling, &
681- stochastics= OS% stochastics)
675+ start_cycle= .false. , end_cycle= (n== n_max), cycle_length= dt_coupling)
682676 else
683677 call step_MOM(OS% forces, OS% fluxes, OS% sfc_state, Time2, dt_dyn, OS% MOM_CSp, &
684678 Waves= OS% Waves, do_dynamics= .true. , do_thermodynamics= .false. , &
685- start_cycle= (n== 1 ), end_cycle= .false. , cycle_length= dt_coupling, &
686- stochastics= OS% stochastics)
679+ start_cycle= (n== 1 ), end_cycle= .false. , cycle_length= dt_coupling)
687680
688681 step_thermo = .false.
689682 if (thermo_does_span_coupling) then
@@ -700,8 +693,8 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
700693 Time2 = Time2 - set_time(int (floor ((dtdia - dt_dyn) + 0.5 )))
701694 call step_MOM(OS% forces, OS% fluxes, OS% sfc_state, Time2, dtdia, OS% MOM_CSp, &
702695 Waves= OS% Waves, do_dynamics= .false. , do_thermodynamics= .true. , &
703- start_cycle= .false. , end_cycle= (n== n_max), cycle_length= dt_coupling, &
704- stochastics = OS % stochastics)
696+ start_cycle= .false. , end_cycle= (n== n_max), cycle_length= dt_coupling)
697+
705698 endif
706699 endif
707700
0 commit comments