Skip to content

Commit

Permalink
add write_stoch_restart_ocn to MOM_stochastics
Browse files Browse the repository at this point in the history
  • Loading branch information
pjpegion committed Jul 26, 2021
1 parent bdf2dc7 commit c5f2b72
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module MOM_cap_mod
use NUOPC_Model, only: model_label_Finalize => label_Finalize
use NUOPC_Model, only: SetVM

use get_stochy_pattern_mod, only: write_stoch_restart_ocn
use MOM_stochastics, only : write_mom_restart_stoch
!$use omp_lib , only : omp_set_num_threads

implicit none; private
Expand Down Expand Up @@ -1746,7 +1746,7 @@ subroutine ModelAdvance(gcomp, rc)
endif
call ESMF_LogWrite("MOM_cap: Writing stoch restart : "//trim(restartname), &
ESMF_LOGMSG_INFO)
call write_stoch_restart_ocn('RESTART/'//trim(restartname))
call write_mom_restart_stoch('RESTART/'//trim(restartname))
endif
endif

Expand Down
18 changes: 15 additions & 3 deletions config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ module MOM_stochastics
use MOM_domains, only : root_PE,num_PEs
use MOM_coms, only : Get_PElist
use stochastic_physics, only : init_stochastic_physics_ocn, run_stochastic_physics_ocn
use get_stochy_pattern_mod, only: write_stoch_restart_ocn

#include <MOM_memory.h>

implicit none ; private

public stochastics_init, update_stochastics
public stochastics_init, update_stochastics, write_mom_restart_stoch

!> This control structure holds parameters for the MOM_stochastics module
type, public:: stochastic_CS
Expand Down Expand Up @@ -146,10 +147,21 @@ subroutine update_stochastics(CS)
call callTree_enter("update_stochastics(), MOM_stochastics.F90")

! update stochastic physics patterns before running next time-step
call run_stochastic_physics_ocn(CS%sppt_wts,CS%epbl1_wts,CS%epbl2_wts)
print*,'in update_stoch',minval(CS%sppt_wts),maxval(CS%sppt_wts),minval(CS%epbl1_wts),maxval(CS%epbl1_wts)
call run_stochastic_physics_ocn(CS%sppt_wts,CS%epbl1_wts,CS%epbl2_wts)

return
end subroutine update_stochastics

!< wrapper to write ocean stochastic restarts
subroutine write_mom_restart_stoch(filename)
character(len=*) :: filename

call callTree_enter("write_mom_restart_stoch(), MOM_stochastics.F90")

call write_stoch_restart_ocn(filename)

return
end subroutine write_mom_restart_stoch

end module MOM_stochastics

0 comments on commit c5f2b72

Please sign in to comment.