Skip to content

Commit

Permalink
fix undefined values, and also add standalone testing capability
Browse files Browse the repository at this point in the history
  • Loading branch information
pjpegion committed Nov 25, 2019
1 parent 1ea200f commit f938910
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions compns_stochy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ subroutine compns_stochy (me,sz_nml,input_nml_file,fn_nml,nlunit,deltim,iret)
! mg, sfcperts
do_sfcperts = .false.
sppt_land = .false.
nsfcpert = 0
! for sfcperts random patterns
sfc_lscale = -999. ! length scales
sfc_tau = -999. ! time scales
Expand Down
1 change: 0 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ endif

LIBRARY = libstochastic_physics.a

#FFLAGS += -I./include -I../FV3/gfsphysics/ -I../FV3/atmos_cubed_sphere -I$(FMS_DIR) -I../FV3/namphysics
FFLAGS += -I../FV3/gfsphysics/ -I../FV3/atmos_cubed_sphere -I$(FMS_DIR) -I../FV3/namphysics

SRCS_F =
Expand Down
8 changes: 4 additions & 4 deletions stochastic_physics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ subroutine init_stochastic_physics(Model, Init_parm, ntasks, nthreads)
! update remaining model configuration parameters from namelist
Model%use_zmtnblck=use_zmtnblck
Model%skeb_npass=skeb_npass
Model%nsfcpert=nsfcpert ! mg, sfc-perts
Model%pertz0=pertz0 ! mg, sfc-perts
Model%pertzt=pertzt ! mg, sfc-perts
Model%pertshc=pertshc ! mg, sfc-perts
Model%pertlai=pertlai ! mg, sfc-perts
Model%pertalb=pertalb ! mg, sfc-perts
Model%pertvegf=pertvegf ! mg, sfc-perts
!if ( (.NOT. do_sppt) .AND. (.NOT. do_shum) .AND. (.NOT. do_skeb) .AND. (.NOT. do_sfcperts) ) return
if ( (.NOT. do_sppt) .AND. (.NOT. do_shum) .AND. (.NOT. do_skeb) .AND. (.NOT. do_sfcperts) ) return
allocate(sl(Model%levs))
do k=1,Model%levs
sl(k)= 0.5*(Init_parm%ak(k)/101300.+Init_parm%bk(k)+Init_parm%ak(k+1)/101300.0+Init_parm%bk(k+1)) ! si are now sigmas
Expand Down Expand Up @@ -220,8 +221,7 @@ subroutine run_stochastic_physics(Model, Grid, Coupling, nthreads)
character*120 :: sfile
character*6 :: STRFH

!if ( (.NOT. Model%do_sppt) .AND. (.NOT. Model%do_shum) .AND. (.NOT. Model%do_skeb) ) return
!if ( (.NOT. Model%do_sppt) .AND. (.NOT. Model%do_shum) .AND. (.NOT. Model%do_skeb) .AND. (.NOT. Model%do_sfcperts) ) return
if ( (.NOT. Model%do_sppt) .AND. (.NOT. Model%do_shum) .AND. (.NOT. Model%do_skeb) ) return

! Update number of threads in shared variables in spectral_layout_mod and set block-related variables
ompthreads = nthreads
Expand Down Expand Up @@ -317,7 +317,7 @@ subroutine run_stochastic_physics_sfc(Model, Grid, Coupling)
integer :: nblks, blk, len, maxlen
character*120 :: sfile
character*6 :: STRFH
!if (.NOT. Model%do_sfcperts) return
if (.NOT. Model%do_sfcperts) return

! Set block-related variables
nblks = size(Model%blksz)
Expand Down
2 changes: 1 addition & 1 deletion stochy_data_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ subroutine init_stochdata(nlevs,delt,input_nml_file,fn_nml,nlunit,iret)
iret=0
if(is_master()) print*,'in init stochdata'
call compns_stochy (me,size(input_nml_file,1),input_nml_file(:),fn_nml,nlunit,delt,iret)
! if ( (.NOT. do_sppt) .AND. (.NOT. do_shum) .AND. (.NOT. do_skeb) .AND. (.NOT. do_sfcperts) ) return
if ( (.NOT. do_sppt) .AND. (.NOT. do_shum) .AND. (.NOT. do_skeb) .AND. (.NOT. do_sfcperts) ) return
if (nodes.GE.lat_s/2) then
lat_s=(int(nodes/12)+1)*24
lon_s=lat_s*2
Expand Down

0 comments on commit f938910

Please sign in to comment.