Skip to content

Commit

Permalink
Stoch eos clock (#5)
Browse files Browse the repository at this point in the history
*Added a clock for the Stanley parameterization

Co-authored-by: jkenigson <[email protected]>
  • Loading branch information
jskenigson and jkenigson authored Jan 4, 2021
1 parent 3e355d8 commit a915b01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ module MOM
integer :: id_clock_other
integer :: id_clock_offline_tracer
integer :: id_clock_unit_tests
integer :: id_clock_stoch
integer :: id_clock_varT
!>@}

contains
Expand Down Expand Up @@ -992,8 +994,12 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
showCallTree = callTree_showQuery()

call cpu_clock_begin(id_clock_dynamics)
call cpu_clock_begin(id_clock_stoch)
if (CS%stoch_eos_CS%use_stoch_eos) call MOM_stoch_eos_run(G,u,v,dt_thermo,Time_local,CS%stoch_eos_CS,CS%diag)
call cpu_clock_end(id_clock_stoch)
call cpu_clock_begin(id_clock_varT)
call MOM_calc_varT(G,GV,h,CS%tv,CS%stoch_eos_CS)
call cpu_clock_end(id_clock_varT)

if ((CS%t_dyn_rel_adv == 0.0) .and. CS%thickness_diffuse .and. CS%thickness_diffuse_first) then

Expand Down Expand Up @@ -2893,6 +2899,8 @@ subroutine MOM_timing_init(CS)
if (CS%offline_tracer_mode) then
id_clock_offline_tracer = cpu_clock_id('Ocean offline tracers', grain=CLOCK_SUBCOMPONENT)
endif
id_clock_stoch = cpu_clock_id('(Stochastic EOS)', grain=CLOCK_MODULE)
id_clock_varT = cpu_clock_id('(SGS Temperature Variance)', grain=CLOCK_MODULE)

end subroutine MOM_timing_init

Expand Down
2 changes: 2 additions & 0 deletions src/core/MOM_stoch_eos.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module MOM_stoch_eos
!integer(8) :: npts
!real :: pi
logical first_time

type, public :: MOM_stoch_eos_CS
real,public ALLOCABLE_, dimension(NIMEM_,NJMEM_) :: pattern
!< Random pattern for stochastic EOS
Expand Down Expand Up @@ -121,6 +122,7 @@ subroutine MOM_stoch_eos_run(G,u,v,delt,Time,stoch_eos_CS,diag)
stoch_eos_CS%phi(i,j)=phi
enddo
enddo

!print*,'stoch_run ubar',minval(u),maxval(u),minval(v),maxval(v)
!print*,'stoch_run rp',minval(random_pattern),maxval(random_pattern),minval(rgauss),maxval(rgauss)
!print*,'stoch_run phi',minval(phi_out),maxval(phi_out),minval(rgauss),maxval(rgauss)
Expand Down

0 comments on commit a915b01

Please sign in to comment.