diff --git a/cat/dat/sim_0051.nl b/cat/dat/sim_0051.nl index 96bf11243f8e87ef1f5efa3adb84b6e0e07afe18..570a43075997bcc4429a2736c064c9c6274a75f9 100644 --- a/cat/dat/sim_0051.nl +++ b/cat/dat/sim_0051.nl @@ -1,9 +1,12 @@ $sim_nl - ysim = "fjet01" - w1 = 8 - w2 = 2 - scl = 1 - qmax = 0.0001 - snforc = 1 - snpert = 3 + ysim = "fjet01" + w1 = 8 + w2 = 2 + scl = 1 + qmax = 0.00001 + snsteps = 2000000 + sdt = 1.0d-3 + sngui = 250 + snforc = 1 + snpert = 1 / diff --git a/cat/dat/sim_0052.nl b/cat/dat/sim_0052.nl index 524789f5852b18107177ab35ad016735a12ad1e2..cbdc90412c6791a64dd601be13dda16af7daf748 100644 --- a/cat/dat/sim_0052.nl +++ b/cat/dat/sim_0052.nl @@ -1,9 +1,12 @@ $sim_nl - ysim = "fjet01" - w1 = 8 - w2 = 2 - scl = 1 - qmax = 0.00001 - snforc = 1 - snpert = 2 + ysim = "fjet01" + w1 = 8 + w2 = 2 + scl = 1 + qmax = 0.00001 + snsteps = 2000000 + sdt = 1.0d-3 + sngui = 250 + snforc = 1 + snpert = 4 / diff --git a/cat/dat/sim_0061.nl b/cat/dat/sim_0061.nl new file mode 100644 index 0000000000000000000000000000000000000000..8307319c494fd2ed7eaa888f0ade10016619a71d --- /dev/null +++ b/cat/dat/sim_0061.nl @@ -0,0 +1,12 @@ + $sim_nl + ysim = "fjet02" + w1 = 8 + w2 = 2 + scl = 1 + qmax = 0.00001 + snsteps = 2000000 + sdt = 1.0d-3 + sngui = 250 + snforc = 1 + snpert = 1 + / diff --git a/cat/dat/sim_0062.nl b/cat/dat/sim_0062.nl new file mode 100644 index 0000000000000000000000000000000000000000..0ac6730db1e99307445ecda34b291a4c8f75f825 --- /dev/null +++ b/cat/dat/sim_0062.nl @@ -0,0 +1,12 @@ + $sim_nl + ysim = "fjet02" + w1 = 8 + w2 = 2 + scl = 1 + qmax = 0.00001 + snsteps = 2000000 + sdt = 1.0d-3 + sngui = 250 + snforc = 1 + snpert = 4 + / diff --git a/cat/src/cat.f90 b/cat/src/cat.f90 index 197b8c162a215347931790fc72c24bfd09385317..93a45bd682542b3e9880ea9164e9747a9db9e29f 100644 --- a/cat/src/cat.f90 +++ b/cat/src/cat.f90 @@ -246,6 +246,13 @@ integer :: npert = 0 ! initial perturbation switch ! 3 = white noise anti-symmetricy perturbation about ! the axis y = pi (zero mean vorticity in the upper ! and lower power separately) + ! 4 = white noise symmetric perturbation about the axis + ! x = pi (zero mean vorticity in the upper and + ! lower part of the fluid domain separately) + ! 5 = white noise anti-symmetricy perturbation about + ! the axis x = pi (zero mean vorticity in the upper + ! and lower power separately) + real(8) :: apert = 0.015d-4 ! amplitude of perturbation @@ -382,7 +389,12 @@ complex(8), allocatable :: cli(:,:) ! linear time propagation ! ******************* !--- gui communication (guimod) -integer :: ngui = 1 ! global switch 1 = on +integer :: ngui = 1 ! global switch and parameter + ! ngui > 0 GUI = on + ! ngui specifies moreover the number of + ! time-steps between two calls of gui_transfer + ! which exchanges data between GUI and CAT + integer :: nguidbg = 0 ! GUI debug mode integer :: ndatim(6) = 1 ! date/time display @@ -397,11 +409,17 @@ integer :: nsim = 0 ! 0 no predefined simulation is specified ! ----------------------------------------------- ! code name ! - ! 1 decaying_jet01 + ! 1 decaying_jet01 + ! 51 top-hat wind-forcing + ! 52 top-hat wind-forcing ! ----------------------------------------------- ! - ! Predefined simulations are specified in - ! <sim_namelist> of simmod. + ! Predefined simulations are given in the dat + ! directory as sim_XXXX.nl with XXXX the code + ! To activate a given simulation one has to copy + ! a given sim_XXXX.nl to sim_namelist in the run + ! directory. + ! ----------------------------------------------- !--- usermod (usermod) integer :: nuser = 0 ! 1/0 user mode is switched on/off. @@ -608,7 +626,7 @@ inquire(file=cat_namelist,exist=lcatnl) if (lcatnl) then open(nucatnl,file=cat_namelist,iostat=ios_catnl) - read(nucatnl,cat_nl) + read(nucatnl,cat_nl) endif return @@ -1076,6 +1094,8 @@ endif print *, "the forcing ring contains ",nk," wavevectors." return + + end subroutine init_forc @@ -1116,10 +1136,11 @@ use catmod implicit none -integer :: jj ! loop index +integer :: jx,jy ! loop index real(8) :: gqpert(1:ngx,1:ngy) ! vorticity perturbation [1/s] -real(8) :: randtmp(1:ngx) ! temporary random vector +real(8) :: randxtmp(1:ngx) ! temporary random vector (x-dir) +real(8) :: randytmp(1:ngy) ! temporary random vector (y-dir) complex(8) :: cqpert(0:nkx,0:nfy) ! spectral vorticiy perturbation [1/s] @@ -1139,22 +1160,44 @@ select case(npert) cq = cq + cqpert case(2) !--- symmetric about channel center - do jj = 1,ngy/2 - call random_number(randtmp) - randtmp = 2.0*apert*(randtmp - sum(randtmp)*rnx) - gqpert(:,jj) = randtmp(:) - gqpert(:,ngy+1-jj) = randtmp(:) + do jy = 1,ngy/2 + call random_number(randxtmp) + randxtmp = 2.0*apert*(randxtmp - sum(randxtmp)*rnx) + gqpert(:,jy) = randxtmp(:) + gqpert(:,ngy+1-jy) = randxtmp(:) enddo call grid_to_fourier(gqpert,cqpert,nfx,nfy,ngx,ngy) cqpert(0,0) = (0.0,0.0) cq = cq + cqpert case(3) !--- anti-symmetric about channel center - do jj = 1,ngy/2 - call random_number(randtmp) - randtmp = 2.0*apert*(randtmp - sum(randtmp)*rnx) - gqpert(:,jj) = randtmp(:) - gqpert(:,ngy+1-jj) = -randtmp(:) + do jy = 1,ngy/2 + call random_number(randxtmp) + randxtmp = 2.0*apert*(randxtmp - sum(randxtmp)*rnx) + gqpert(:,jy) = randxtmp(:) + gqpert(:,ngy+1-jy) = -randxtmp(:) + enddo + call grid_to_fourier(gqpert,cqpert,nfx,nfy,ngx,ngy) + cqpert(0,0) = (0.0,0.0) + cq = cq + cqpert + case(4) + !--- symmetric about x = pi + do jx = 1,ngx/2 + call random_number(randytmp) + randytmp = 2.0*apert*(randytmp - sum(randytmp)*rny) + gqpert(jx,:) = randytmp(:) + gqpert(ngx+1-jx,:) = randytmp(:) + enddo + call grid_to_fourier(gqpert,cqpert,nfx,nfy,ngx,ngy) + cqpert(0,0) = (0.0,0.0) + cq = cq + cqpert + case(5) + !--- symmetric about x = pi + do jx = 1,ngx/2 + call random_number(randytmp) + randytmp = 2.0*apert*(randytmp - sum(randytmp)*rny) + gqpert(jx,:) = randytmp(:) + gqpert(ngx+1-jx,:) = -randytmp(:) enddo call grid_to_fourier(gqpert,cqpert,nfx,nfy,ngx,ngy) cqpert(0,0) = (0.0,0.0) diff --git a/cat/src/simmod.f90 b/cat/src/simmod.f90 index ae802fc5343cb8a44935f6f5db86a2bb7f844cc0..74d9ac01b5a1cd8e63f394c45bdc5e3afe1a9bd5 100644 --- a/cat/src/simmod.f90 +++ b/cat/src/simmod.f90 @@ -49,9 +49,13 @@ real(8) :: qmax = 1.0 ! amplitude of vortex sheets ! parameter. ! !---------------------------------------------------------------! -integer :: snforc = -1 ! type of forcing -integer :: snpert = -1 ! type of perturbation -integer :: snpost = -1 ! type of post processing +real(8) :: sdt = -1.0 ! length of time step [s] + +integer :: snsteps = -1 ! total number of time steps +integer :: sngui = -1 ! time steps between GUI calls +integer :: snforc = -1 ! type of forcing +integer :: snpert = -1 ! type of perturbation +integer :: snpost = -1 ! type of post processing end module simmod @@ -78,9 +82,10 @@ use simmod implicit none !--- define sim_namelist -namelist /sim_nl/ ysim , & - qmax ,w1 ,w2 ,scl ,& - snpert ,snforc ,snpost +namelist /sim_nl/ ysim , & + qmax ,w1 ,w2 ,scl ,& + sdt ,snsteps ,sngui , & + snpert ,snforc ,snpost !--- check if sim_namelist is present inquire(file=sim_namelist,exist=lsimnl) @@ -94,9 +99,12 @@ else endif !--- overwrite cat_namelist parameters -if (snpert .ge. 0) npert = snpert -if (snforc .ge. 0) nforc = snforc -if (snpost .ge. 0) npost = snpost +if (sdt .ge. 0) dt = sdt +if (snsteps .ge. 0) nsteps = snsteps +if (sngui .ge. 0) ngui = sngui +if (snpert .ge. 0) npert = snpert +if (snforc .ge. 0) nforc = snforc +if (snpost .ge. 0) npost = snpost return end subroutine sim_readnl @@ -153,6 +161,19 @@ select case(ysim) enddo call sim_wrtgp(gpvar,qfrccde,1) + case("fjet02") + gpvar(:,:) = 0.0 + do jx = 1, ngx + if ( jx .ge. ngx/2+1-scl*(w1+w2) .and. & + jx .le. ngx/2-scl*w1 ) then + gpvar(jx,:) = -qmax + endif + if ( jx .ge. ngx/2+1+scl*w1 .and. & + jx .le. ngx/2+scl*(w1+w2) ) then + gpvar(jx,:) = qmax + endif + enddo + call sim_wrtgp(gpvar,qfrccde,1) case default end select