Skip to content

Commit

Permalink
changes to iseed_ type
Browse files Browse the repository at this point in the history
  • Loading branch information
pjpegion committed Sep 24, 2021
1 parent 7d15a66 commit c9510bb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
4 changes: 1 addition & 3 deletions cellular_automata_global.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ subroutine cellular_automata_global(kstep,restart,first_time_step,ca1_cpl,ca2_cp
!This program evolves a cellular automaton uniform over the globe

integer, intent(in) :: kstep,ncells,nca,nlives,nseed,nspinup,nsmooth,mpiroot,mpicomm
integer*8, intent(in) :: iseed_ca
integer(kind=kind_dbl_prec), intent(in) :: iseed_ca
integer, intent(in) :: mytile
real(kind=kind_dbl_prec), intent(in) :: nfracseed,ca_amplitude
logical, intent(in) :: ca_smooth,first_time_step, restart
Expand Down Expand Up @@ -253,7 +253,6 @@ subroutine cellular_automata_global(kstep,restart,first_time_step,ca1_cpl,ca2_cp
sq_diff= mpp_global_sum (domain_global, CAprime, flags=BITWISE_EXACT_SUM)

CAstdv = sqrt(sq_diff/csum)
print*,'in rescale',psum,sq_diff,csum

!Transform to mean of 1 and ca_amplitude standard deviation

Expand Down Expand Up @@ -282,7 +281,6 @@ subroutine cellular_automata_global(kstep,restart,first_time_step,ca1_cpl,ca2_cp
enddo !nf

do blk = 1, Atm_block%nblks
print*,'in ca_global',Atm_block%nblks,Atm_block%blksz(blk)
do ix = 1,Atm_block%blksz(blk)
i = Atm_block%index(blk)%ii(ix) - isc + 1
j = Atm_block%index(blk)%jj(ix) - jsc + 1
Expand Down
6 changes: 3 additions & 3 deletions cellular_automata_sgs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ subroutine cellular_automata_sgs(kstep,dtf,restart,first_time_step,sst,lsmsk,lak
nca,scells,tlives,nfracseed,nseed,iseed_ca, &
nspinup,ca_trigger,blocksize,mpiroot,mpicomm)

use kinddef, only: kind_phys
use kinddef, only: kind_phys,kind_dbl_prec
use update_ca, only: update_cells_sgs, define_ca_domain
use random_numbers, only: random_01_CB
use mpp_domains_mod, only: domain2D,mpp_get_global_domain,CENTER, mpp_get_data_domain, mpp_get_compute_domain,&
Expand Down Expand Up @@ -42,7 +42,7 @@ subroutine cellular_automata_sgs(kstep,dtf,restart,first_time_step,sst,lsmsk,lak
!area fraction (nca_plumes=false)

integer,intent(in) :: kstep,scells,nca,tlives,nseed,nspinup,mpiroot,mpicomm,mytile
integer*8, intent(in) :: iseed_ca
integer(kind=kind_dbl_prec), intent(in) :: iseed_ca
real(kind=kind_phys), intent(in) :: nfracseed,dtf,rcell
logical,intent(in) :: restart,ca_trigger,first_time_step
integer, intent(in) :: nblks,isc,iec,jsc,jec,npx,npy,nlev,blocksize
Expand Down Expand Up @@ -300,7 +300,7 @@ subroutine cellular_automata_sgs(kstep,dtf,restart,first_time_step,sst,lsmsk,lak
else
livesmax=maxval(ilives_in)
call mp_reduce_max(livesmax)
livesmaxinv=1.0/real(livesmax,kind=4)
livesmaxinv=1.0/livesmax
do j=1,nlat
do i=1,nlon
CA_DEEP(i,j)=CA(i,j)*livesmaxinv
Expand Down
4 changes: 2 additions & 2 deletions stochy_namelist_def.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ module stochy_namelist_def
real(kind=kind_dbl_prec), dimension(5) :: epbl,epbl_lscale,epbl_tau
real(kind=kind_dbl_prec), dimension(5) :: ocnsppt,ocnsppt_lscale,ocnsppt_tau
integer,dimension(5) ::skeb_vfilt
integer(8),dimension(5) ::iseed_sppt,iseed_shum,iseed_skeb,iseed_epbl,iseed_ocnsppt,iseed_epbl2
integer(kind=kind_dbl_prec),dimension(5) ::iseed_sppt,iseed_shum,iseed_skeb,iseed_epbl,iseed_ocnsppt,iseed_epbl2
logical stochini,sppt_logit,new_lscale
logical use_zmtnblck
logical do_shum,do_sppt,do_skeb,pert_epbl,do_ocnsppt

real(kind=kind_dbl_prec), dimension(5) :: lndp_lscale,lndp_tau
integer n_var_lndp
integer(8),dimension(5) ::iseed_lndp
integer(kind=kind_dbl_prec),dimension(5) ::iseed_lndp
integer lndp_type
character(len=3), dimension(max_n_var_lndp) :: lndp_var_list
real(kind=kind_dbl_prec), dimension(max_n_var_lndp) :: lndp_prt_list
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/compile_standalone_ca.hera.gnu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
compile_all=0
compile_all=1
DEBUG=YES
#DEBUG=NO
source ./module-setup.sh
Expand Down
6 changes: 2 additions & 4 deletions update_ca.F90
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ subroutine update_cells_sgs(kstep,initialize_ca,iseed_ca,first_flag,restart,firs
implicit none

integer, intent(in) :: kstep,nxc,nyc,nlon,nlat,nxch,nych,nca,isc,iec,jsc,jec,npx,npy
integer*8, intent(in) :: iseed_ca
integer(kind=kind_dbl_prec), intent(in) :: iseed_ca
integer, intent(in) :: iini(nxc,nyc,nca),initialize_ca,ilives_in(nxc,nyc,nca)
integer, intent(in) :: mytile
real, intent(out) :: CA(nlon,nlat)
Expand Down Expand Up @@ -580,7 +580,7 @@ subroutine update_cells_global(kstep,first_time_step,iseed_ca,restart,nca,nxc,ny

integer, intent(in) :: kstep,nxc,nyc,nlon,nlat,nxch,nych,nca,isc,iec,jsc,jec,npx,npy
integer, intent(in) :: iini_g(nxc,nyc,nca), ilives_g(nxc,nyc)
integer*8, intent(in) :: iseed_ca
integer(kind=kind_dbl_prec), intent(in) :: iseed_ca
real, intent(out) :: CA(nlon,nlat)
logical, intent(in) :: first_time_step
logical, intent(in) :: restart
Expand Down Expand Up @@ -665,9 +665,7 @@ subroutine update_cells_global(kstep,first_time_step,iseed_ca,restart,nca,nxc,ny
neighbours=0
birth=0
newcell=0

CA=0
newcell=0
board_halo=0

!The input to scalar_field_halo needs to be 1D.
Expand Down

0 comments on commit c9510bb

Please sign in to comment.