diff --git a/cellular_automata_global.F90 b/cellular_automata_global.F90 index fb45182b..469db85b 100644 --- a/cellular_automata_global.F90 +++ b/cellular_automata_global.F90 @@ -167,7 +167,7 @@ subroutine cellular_automata_global(kstep,restart,first_time_step,ca1_cpl,ca2_cp else ! don't rely on compiler to truncate integer(8) to integer(4) on ! overflow, do wrap around explicitly. - count4 = mod(((iseed_ca+7)*mytile)*(i1+nx_full*(j1-1))+ 2147483648, 4294967296) - 2147483648 + count4 = mod(((iseed_ca+7)*mytile)*(i1+nx_full*(j1-1))+ 2147483648_8, 4294967296_8) - 2147483648_8 endif ct=1 do nf=1,nca diff --git a/cellular_automata_sgs.F90 b/cellular_automata_sgs.F90 index 3f7920ed..dbfee821 100644 --- a/cellular_automata_sgs.F90 +++ b/cellular_automata_sgs.F90 @@ -296,7 +296,7 @@ subroutine cellular_automata_sgs(kstep,dtf,restart,first_time_step,sst,lsmsk,lak else ! don't rely on compiler to truncate integer(8) to integer(4) on ! overflow, do wrap around explicitly. - count4 = mod((iseed_ca+mytile)*(i1+nx_full*(j1-1))+ 2147483648, 4294967296) - 2147483648 + count4 = mod((iseed_ca+mytile)*(i1+nx_full*(j1-1))+ 2147483648_8, 4294967296_8) - 2147483648_8 endif ct=1 do nf=1,nca diff --git a/plumes.F90 b/plumes.F90 index 80b301fe..7f0cbdf0 100644 --- a/plumes.F90 +++ b/plumes.F90 @@ -1,3 +1,6 @@ +module plumes_mod + +contains subroutine plumes(V,L,AG,a,row,col,kend) implicit none @@ -165,3 +168,5 @@ subroutine plumes(V,L,AG,a,row,col,kend) end subroutine plumes + +end module plumes_mod diff --git a/spectral_transforms.F90 b/spectral_transforms.F90 index 4b542923..33afd619 100644 --- a/spectral_transforms.F90 +++ b/spectral_transforms.F90 @@ -723,11 +723,13 @@ SUBROUTINE RADB5_STOCHY (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) END SUBROUTINE RADBG_STOCHY (IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) - implicit real(kind=kind_dbl_prec) (A-H) - implicit real(kind=kind_dbl_prec) (O-Z) + implicit none + INTEGER :: IDO,IP,L1,IDL1 REAL(kind_dbl_prec) :: CH(IDO,L1,IP), CC(IDO,IP,L1), C1(IDO,L1,IP), C2(IDL1,IP), & CH2(IDL1,IP) , WA(*) REAL(kind_dbl_prec), parameter :: TPI=6.28318530717959 + REAL(kind_dbl_prec) :: ARG, DCP, DSP, AI1, AI2, AR1, AR1H, DC2, DS2, AR2, AR2H + INTEGER :: I,J,K,IK, IDP2, IPP2, IPPH, JC, J2, IC, L, IS, IDIJ, NBD, LC ARG = TPI/FLOAT(IP) DCP = COS(ARG) DSP = SIN(ARG) @@ -1474,7 +1476,6 @@ subroutine stochy_la2ga(regin,imxin,jmxin,rinlon,rinlat,rlon,rlat, & i2 = iindx2(i) if(wrk(i) .eq. 0.0) then write(6,*) ' la2ga: error' - call sleep(2) stop endif enddo diff --git a/stochy_data_mod.F90 b/stochy_data_mod.F90 index 907172b2..676cb57a 100644 --- a/stochy_data_mod.F90 +++ b/stochy_data_mod.F90 @@ -485,11 +485,9 @@ subroutine init_stochdata_ocn(nlevs,delt,iret) integer :: nn,nm,stochlun,n,jcapin integer :: l,jbasev,jbasod - integer :: indev,indod,indlsod,indlsev,varid1,varid2,varid3,varid4,ierr + integer :: indev,indod,varid1,varid2,varid3,varid4,ierr real(kind_phys),allocatable :: noise_e(:,:),noise_o(:,:) - include 'function_indlsod' - include 'function_indlsev' include 'netcdf.inc' stochlun=99 levs=nlevs diff --git a/stochy_patterngenerator.F90 b/stochy_patterngenerator.F90 index c1d2ffb7..bb025b40 100644 --- a/stochy_patterngenerator.F90 +++ b/stochy_patterngenerator.F90 @@ -158,8 +158,8 @@ subroutine patterngenerator_init(lscale, delt, tscale, stdev, iseed, rpattern,& !count4 = iseed(np) + member_id ! don't rely on compiler to truncate integer(8) to integer(4) on ! overflow, do wrap around explicitly. - !count4 = mod(iseed(np) + member_id + 2147483648, 4294967296) - 2147483648 - count4 = mod(iseed(np) + 2147483648, 4294967296) - 2147483648 + !count4 = mod(iseed(np) + member_id + 2147483648_8, 4294967296_8) - 2147483648_8 + count4 = mod(iseed(np) + 2147483648_8, 4294967296_8) - 2147483648_8 print *,'using seed',count4,iseed(np)!,member_id endif endif diff --git a/update_ca.F90 b/update_ca.F90 index dc85e806..caaa0514 100644 --- a/update_ca.F90 +++ b/update_ca.F90 @@ -289,6 +289,8 @@ subroutine update_cells_sgs(kstep,halo,dt,initialize_ca,iseed_ca,first_flag,rest CA,ca_plumes,iini,ilives_in,uhigh,vhigh,dxhigh,nlives, & nfracseed,nseed,nspinup,nf,nca_plumes,ncells,mytile) +use plumes_mod + implicit none integer, intent(in) :: kstep,nxc,nyc,nlon,nlat,nxch,nych,nca,isc,iec,jsc,jec,npx,npy @@ -395,7 +397,7 @@ subroutine update_cells_sgs(kstep,halo,dt,initialize_ca,iseed_ca,first_flag,rest count_trunc = iscale*(count/iscale) count4 = count - count_trunc + mytile *( i1+nx_full*(j1-1)) ! no need to multply by 7 since time will be different in sgs else - count4 = mod((iseed_ca*nf+mytile)*(i1+nx_full*(j1-1))+ 2147483648, 4294967296) - 2147483648 + count4 = mod((iseed_ca*nf+mytile)*(i1+nx_full*(j1-1))+ 2147483648_8, 4294967296_8) - 2147483648_8 endif noise_b(i,j)=real(random_01_CB(kstep,count4),kind=8) enddo @@ -706,7 +708,7 @@ subroutine update_cells_global(kstep,halo,first_time_step,iseed_ca,restart,nca,n count_trunc = iscale*(count/iscale) count4 = count - count_trunc + mytile *( i1+nx_full*(j1-1)) ! no need to multply by 7 since time will be different in sgs else - count4 = mod(iseed_ca*nf+(7*mytile)*(i1+nx_full*(j1-1))+ 2147483648, 4294967296) - 2147483648 + count4 = mod(iseed_ca*nf+(7*mytile)*(i1+nx_full*(j1-1))+ 2147483648_8, 4294967296_8) - 2147483648_8 endif noise_b(i,j)=real(random_01_CB(kstep,count4),kind=8) enddo