1 | c*************************************************************** |
---|
2 | c BEGIN RUNTIME INITIALIZATION |
---|
3 | c*************************************************************** |
---|
4 | |
---|
5 | if(ny .eq. 0) then |
---|
6 | num_dims = 2 |
---|
7 | else |
---|
8 | num_dims = 3 |
---|
9 | endif |
---|
10 | |
---|
11 | if( myid .eq. 0 ) then |
---|
12 | write(6,*) ' ' |
---|
13 | write(6,*) ' ' |
---|
14 | write(6,*)'problem_params.h executed via include statement: flow_solve.x' |
---|
15 | endif |
---|
16 | |
---|
17 | t_write_selective=-999999*dt ! not implemented yet |
---|
18 | if(num_dims .eq. 2) then |
---|
19 | Ly=1.0 ! 2d calculation, per unit length in y [m] |
---|
20 | nyplanes=1 ! parameter ny is zero for 2d xz calcs |
---|
21 | else |
---|
22 | nyplanes=ny |
---|
23 | endif |
---|
24 | |
---|
25 | c Create specialized data structure for MPI data swaps |
---|
26 | call create_MPI_data_type(nx,ny,nz,locnx,locnz,twoslice,subslice,myid,comm) |
---|
27 | call MPI_BARRIER(comm,ierr) |
---|
28 | |
---|
29 | c Prescribe initial conditions and nondimensionalize variables |
---|
30 | istart_floats=(t_floats_on-t_start)/dt ! step to begin float tracking |
---|
31 | call initialize(u,v,w,s1,s2,ambient_density,u_cplx,v_cplx,w_cplx,s1_cplx,s2_cplx, |
---|
32 | * nx,ny,nz,num_dims,efactor, |
---|
33 | * Lx,Ly,Lz,dx,dy,dz,U0,DGRAD,s1_scale,s2_scale,rho_0,f,g,kappa_1,kappa_2,nu, |
---|
34 | * bc_flag,ifax,ifay,ifaz,trigx,trigy,trigz,wn, |
---|
35 | * wnx,wny,wnz,amp,p,T_diss,diss_flag,N,NM1,M,MM1,MM2,step_flag, |
---|
36 | * Rot,Ri,Re,Pr_1,Pr_2,istart,iend,i_all,i_selective,i_stat, |
---|
37 | * dt,t_start,t_end,t_write_selective, |
---|
38 | * t_stat,xt,work(1,1,1,1),work_cplx(1,1,1,8),myid, |
---|
39 | * numprocs,locnx,locnz,comm,twoslice,subslice,work(1,1,1,8), |
---|
40 | * netcdf_file,nyplanes,force_cplx,force_flag, |
---|
41 | * work(1,1,1,2),scalars) |
---|
42 | |
---|
43 | |
---|
44 | c Check accuracy of spectral interpolation: |
---|
45 | c (a) reproduce initial u(z) profile at x=y=0 |
---|
46 | c i=1 |
---|
47 | c j=1 |
---|
48 | c if( myid .eq. 0 ) open(1,file='output/interp_check') |
---|
49 | c do k=1,nz+1 |
---|
50 | |
---|
51 | c dimensionless positions i.e. on gridpoints |
---|
52 | c x0=(i-1.)*dx/Lz |
---|
53 | c y0=(j-1.)*dy/Lz |
---|
54 | c z0=(k-1.)*dz/Lz |
---|
55 | |
---|
56 | c interpolate to find u on grid points |
---|
57 | c fcs_flag='c' |
---|
58 | c call ds_interp(x0,y0,z0,u_cplx(1,1,1,N),wnx,wny,wnz,locnx,ny,nz, |
---|
59 | c * fcs_flag,interp_val,myid,comm) |
---|
60 | c if( myid .eq. 0 ) write(1,*) x0*Lz,y0*Lz,z0*Lz,interp_val*U0 |
---|
61 | |
---|
62 | c enddo |
---|
63 | |
---|
64 | if( myid .eq. 0 ) write(0,*) 'runtime initialization completed' |
---|
65 | if( myid .eq. 0 ) write(6,*) 'runtime initialization completed' |
---|
66 | if( myid .eq. 0 ) close(1) |
---|
67 | |
---|
68 | c*************************************************************** |
---|
69 | c END RUNTIME INITIALIZATION |
---|
70 | c*************************************************************** |
---|