53 double precision :: sts_dtpar=0.5d0
56 double precision,
parameter :: nu_sts = 0.5d0
58 integer :: sts_ncycles=1000
59 integer :: sts_method = 1
65 logical :: fix_conserve_at_step = .true.
66 logical :: sts_initialized = .false.
71 subroutine subr1(ixI^L,ixO^L,w,x,wres,fix_conserve_at_step,my_dt,igrid,nflux)
73 integer,
intent(in) :: ixi^
l, ixo^
l, igrid, nflux
74 double precision,
intent(in) :: x(ixi^s,1:
ndim)
75 double precision,
intent(inout) :: wres(ixi^s,1:nw), w(ixi^s,1:nw)
76 double precision,
intent(in) :: my_dt
77 logical,
intent(in) :: fix_conserve_at_step
81 function subr2(w,ixG^L,ix^L,dx^D,x)
result(dtnew)
83 integer,
intent(in) :: ixg^
l, ix^
l
84 double precision,
intent(in) ::
dx^
d, x(ixg^s,1:
ndim)
85 double precision,
intent(in) :: w(ixg^s,1:nw)
86 double precision :: dtnew
90 subroutine subr_e(w, x, ixI^L, ixO^L, step)
93 integer,
intent(in) :: ixi^
l,ixo^
l
94 double precision,
intent(inout) :: w(ixi^s,1:nw)
95 double precision,
intent(in) :: x(ixi^s,1:
ndim)
96 integer,
intent(in) :: step
100 subroutine subr5(ixI^L, ixO^L, w, x)
102 integer,
intent(in) :: ixi^
l, ixo^
l
103 double precision,
intent(in) :: x(ixi^s,1:
ndim)
104 double precision,
intent(inout) :: w(ixi^s,1:nw)
111 double precision,
intent(in) :: dt
115 function subr4(dt,dtnew,dt_modified)
result(s)
116 double precision,
intent(in) :: dtnew
117 double precision,
intent(inout) :: dt
118 logical,
intent(inout) :: dt_modified
126 double precision :: dt_expl
130 integer,
dimension(-1:1^D&) :: type_send_srl_sts_1, type_recv_srl_sts_1
131 integer,
dimension(-1:1^D&) :: type_send_r_sts_1
132 integer,
dimension( 0:3^D&) :: type_recv_r_sts_1
133 integer,
dimension( 0:3^D&) :: type_recv_p_sts_1, type_send_p_sts_1
135 integer,
dimension(-1:1^D&) :: type_send_srl_sts_2, type_recv_srl_sts_2
136 integer,
dimension(-1:1^D&) :: type_send_r_sts_2
137 integer,
dimension( 0:3^D&) :: type_recv_r_sts_2
138 integer,
dimension( 0:3^D&) :: type_recv_p_sts_2, type_send_p_sts_2
146 logical :: types_initialized
147 logical :: evolve_magnetic_field
148 procedure(subr1),
pointer,
nopass :: sts_set_sources
149 procedure(subr2),
pointer,
nopass :: sts_getdt
150 procedure(subr5),
pointer,
nopass :: sts_before_first_cycle, sts_after_last_cycle
151 procedure(subr_e),
pointer,
nopass :: sts_handle_errors
152 type(sts_term),
pointer :: next
160 procedure(subr4),
pointer :: sts_get_ncycles
168 if(.not. sts_initialized)
then
171 sts_dtpar=sts_dtpar/dble(
ndim)
172 sts_initialized = .true.
173 if(sts_method .eq. 1)
then
175 sts_get_ncycles => sts_get_ncycles1
176 else if(sts_method .eq. 2)
then
178 sts_get_ncycles => sts_get_ncycles2
180 call mpistop(
"Unknown sts method")
188 if (sts_initialized)
then
196 subroutine sts_params_read(files)
198 character(len=*),
intent(in) :: files(:)
201 namelist /sts_list/ sts_dtpar,sts_ncycles,sts_method,
sourcetype_sts
203 do n = 1,
size(files)
204 open(
unitpar, file=trim(files(n)), status=
"old")
205 read(
unitpar, sts_list,
end=111)
209 end subroutine sts_params_read
218 subroutine add_sts_method(sts_getdt, sts_set_sources, startVar, nflux, startwbc, nwbc, evolve_B)
222 integer,
intent(in) :: startvar, nflux, startwbc, nwbc
223 logical,
intent(in) :: evolve_b
227 subroutine sts_set_sources(ixI^L,ixO^L,w,x,wres,fix_conserve_at_step,my_dt,igrid,nflux)
230 integer,
intent(in) :: ixi^
l, ixo^
l, igrid, nflux
231 double precision,
intent(in) :: x(ixi^s,1:
ndim)
232 double precision,
intent(inout) :: wres(ixi^s,1:nw), w(ixi^s,1:nw)
233 double precision,
intent(in) :: my_dt
234 logical,
intent(in) :: fix_conserve_at_step
235 end subroutine sts_set_sources
237 function sts_getdt(w,ixG^L,ix^L,dx^D,x)
result(dtnew)
239 integer,
intent(in) :: ixg^
l, ix^
l
240 double precision,
intent(in) ::
dx^
d, x(ixg^s,1:
ndim)
241 double precision,
intent(in) :: w(ixg^s,1:nw)
242 double precision :: dtnew
243 end function sts_getdt
247 type(sts_term),
pointer :: temp
250 temp%sts_getdt => sts_getdt
251 temp%sts_set_sources => sts_set_sources
252 temp%sts_before_first_cycle => null()
253 temp%sts_after_last_cycle => null()
254 temp%sts_handle_errors => null()
255 temp%startVar = startvar
256 temp%endVar= startvar+nflux-1
258 temp%startwbc = startwbc
260 temp%types_initialized = .false.
261 temp%evolve_magnetic_field=evolve_b
265 temp%type_send_srl_sts_1=mpi_datatype_null; temp%type_recv_srl_sts_1=mpi_datatype_null
266 temp%type_send_r_sts_1 =mpi_datatype_null; temp%type_recv_r_sts_1 =mpi_datatype_null
267 temp%type_send_p_sts_1 =mpi_datatype_null; temp%type_recv_p_sts_1 =mpi_datatype_null
268 temp%type_send_srl_sts_2=mpi_datatype_null; temp%type_recv_srl_sts_2=mpi_datatype_null
269 temp%type_send_r_sts_2 =mpi_datatype_null; temp%type_recv_r_sts_2 =mpi_datatype_null
270 temp%type_send_p_sts_2 =mpi_datatype_null; temp%type_recv_p_sts_2 =mpi_datatype_null
282 subroutine sts_before_first_cycle(ixI^L, ixO^L, w, x)
284 integer,
intent(in) :: ixi^
l, ixo^
l
285 double precision,
intent(in) :: x(ixi^s,1:
ndim)
286 double precision,
intent(inout) :: w(ixi^s,1:nw)
287 end subroutine sts_before_first_cycle
289 subroutine sts_after_last_cycle(ixI^L, ixO^L, w, x)
291 integer,
intent(in) :: ixi^
l, ixo^
l
292 double precision,
intent(in) :: x(ixi^s,1:
ndim)
293 double precision,
intent(inout) :: w(ixi^s,1:nw)
294 end subroutine sts_after_last_cycle
307 subroutine sts_error_handling(w, x, ixI^L, ixO^L, step)
310 integer,
intent(in) :: ixi^
l,ixo^
l
311 double precision,
intent(inout) :: w(ixi^s,1:nw)
312 double precision,
intent(in) :: x(ixi^s,1:
ndim)
313 integer,
intent(in) :: step
314 end subroutine sts_error_handling
321 function sts_get_ncycles1(dt,dtnew,dt_modified)
result(is)
322 double precision,
intent(in) :: dtnew
323 double precision,
intent(inout) :: dt
324 logical,
intent(inout) :: dt_modified
327 double precision :: ss
330 ss = dtnew*((2.d0*sts_ncycles+1)**2-9.d0)/16.d0
338 if(ss .le. 1.d0)
then
341 is=ceiling((dsqrt(9.d0+16.d0*ss)-1.d0)*0.5d0)
346 end function sts_get_ncycles1
349 function sts_get_ncycles2(dt,dtnew,dt_modified)
result(is)
350 double precision,
intent(in) :: dtnew
351 double precision,
intent(inout) :: dt
352 logical,
intent(inout) :: dt_modified
355 double precision :: ss,rr
360 ncycles = sts_ncycles
362 ss=sum_chev(nu_sts,ncycles,rr)
371 end function sts_get_ncycles2
377 double precision,
intent(inout) :: my_dt
378 double precision :: my_dt1
379 logical :: dt_modified, dt_modified1, dt_modified2
381 double precision :: dtnew,dtmin_mype
382 double precision ::
dx^
d, ss
383 integer:: iigrid, igrid, ncycles
384 type(sts_term),
pointer :: temp,oldtemp
387 dt_modified = .false.
388 do while(
associated(temp))
389 dt_modified2 = .false.
392 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
399 dtmin_mype=min(dtmin_mype, sts_dtpar * temp%sts_getdt(ps(igrid)%w,ixg^
ll,
ixm^
ll,
dx^
d,ps(igrid)%x))
402 call mpi_allreduce(dtmin_mype,dtnew,1,mpi_double_precision,mpi_min,
icomm,
ierrmpi)
403 temp%s = sts_get_ncycles(my_dt,dtnew,dt_modified2)
411 if(dt_modified2)
then
416 dt_modified1 = .false.
417 do while(.not.
associated(oldtemp,temp))
418 oldtemp%s = sts_get_ncycles(my_dt1,oldtemp%dt_expl,dt_modified1)
420 if(dt_modified1)
call mpistop(
"sts dt modified twice")
421 oldtemp=>oldtemp%next
430 pure FUNCTION chev(j,nu,N)
433 double precision,
INTENT(IN) :: nu
434 INTEGER,
INTENT(IN) :: j, n
435 double precision :: chev
437 chev = 1d0 / ((-1d0 + nu)*cos(((2d0*j - 1d0) / n)* (
dpi/2d0)) + 1d0 + nu)
441 FUNCTION sum_chev(nu,N,limMax)
442 double precision,
intent(in) :: nu,limmax
443 integer,
intent(inout) :: n
444 double precision :: sum_chev, tmp
450 do while (j < n .and. sum_chev < limmax)
451 sum_chev = sum_chev + chev(j,nu,n)
455 END FUNCTION sum_chev
459 subroutine sts_add_source2(my_dt)
466 double precision,
intent(in) :: my_dt
467 double precision,
allocatable :: bj(:)
468 double precision :: sumbj,dtj
470 integer:: iigrid, igrid, j, ixc^
l
471 logical :: stagger_flag=.false., prolong_flag=.false., coarsen_flag=.false.
472 type(sts_term),
pointer :: temp
480 do while(
associated(temp))
482 if(.not.temp%evolve_magnetic_field)
then
494 if(
associated(temp%sts_before_first_cycle))
then
499 do iigrid=1,igridstail; igrid=igrids(iigrid);
502 call temp%sts_before_first_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
506 allocate(bj(1:temp%s))
508 bj(j) = chev(j,nu_sts,sts_ncycles)
518 if(.not. temp%types_initialized)
then
520 if(temp%nflux>temp%nwbc)
then
536 temp%types_initialized = .true.
541 if(j .eq. temp%s .and. (sumbj + bj(j)) * temp%dt_expl > my_dt)
then
542 dtj = my_dt - sumbj * temp%dt_expl
544 dtj = bj(j)* temp%dt_expl
546 sumbj = sumbj + bj(j)
549 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
552 call temp%sts_set_sources(ixg^
ll,
ixm^
ll,ps(igrid)%w,ps(igrid)%x,ps1(igrid)%w,fix_conserve_at_step,dtj,igrid,temp%nflux)
553 if(temp%nflux>
ndir)
then
554 ps(igrid)%w(
ixm^t,temp%startVar)=ps(igrid)%w(
ixm^t,temp%startVar)+dtj*ps1(igrid)%w(
ixm^t,temp%startVar)
556 ps(igrid)%ws(ixc^s,1:nws)=ps(igrid)%ws(ixc^s,1:nws)+dtj*ps1(igrid)%w(ixc^s,iw_mag(1:nws))
562 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
565 call temp%sts_set_sources(ixg^
ll,
ixm^
ll,ps(igrid)%w,ps(igrid)%x,ps1(igrid)%w,fix_conserve_at_step,dtj,igrid,temp%nflux)
566 ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)=ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
567 dtj*ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
572 if(fix_conserve_at_step)
then
580 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
586 if(
associated(temp%sts_handle_errors))
then
588 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
591 call temp%sts_handle_errors(ps(igrid)%w,ps(igrid)%x,ixg^
ll,
ixm^
ll,j)
596 if(temp%nflux>temp%nwbc.and.temp%s==j)
then
610 if(
associated(temp%sts_after_last_cycle))
then
611 do iigrid=1,igridstail; igrid=igrids(iigrid);
614 call temp%sts_after_last_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
621 if(.not.temp%evolve_magnetic_field)
then
643 do iigrid=1,igridstail; igrid=igrids(iigrid);
644 call eos%update_eos(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
648 end subroutine sts_add_source2
652 subroutine sts_add_source1(my_dt)
660 double precision,
intent(in) :: my_dt
661 double precision :: dtj
662 double precision :: omega1,cmu,cmut,cnu,cnut,one_mu_nu
663 double precision,
allocatable :: bj(:)
664 integer:: iigrid, igrid, j, ixc^
l, ixgext^
l
665 double precision :: lb_t0_tc, lb_t0_block
666 logical :: evenstep, stagger_flag=.false., prolong_flag=.false., coarsen_flag=.false., total_energy_flag=.true.
667 type(sts_term),
pointer :: temp
668 type(state),
dimension(:),
pointer :: tmpps1, tmpps2
676 do while(
associated(temp))
678 if(.not.temp%evolve_magnetic_field)
then
690 if(
associated(temp%sts_before_first_cycle))
then
698 do iigrid=1,igridstail; igrid=igrids(iigrid);
701 call temp%sts_before_first_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
702 if(.not.
allocated(ps2(igrid)%w))
allocate(ps2(igrid)%w(ixg^t,1:nw))
703 if(.not.
allocated(ps3(igrid)%w))
allocate(ps3(igrid)%w(ixg^t,1:nw))
704 if(.not.
allocated(ps4(igrid)%w))
allocate(ps4(igrid)%w(ixg^t,1:nw))
705 ps1(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
706 ps2(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
711 ixgext^
l=ixg^
ll^ladd1;
713 do iigrid=1,igridstail; igrid=igrids(iigrid);
714 if(.not.
allocated(ps2(igrid)%w))
then
717 if(.not.
allocated(ps3(igrid)%w))
allocate(ps3(igrid)%w(ixg^t,1:nw))
718 if(.not.
allocated(ps4(igrid)%w))
allocate(ps4(igrid)%w(ixg^t,1:nw))
719 ps1(igrid)%w=ps(igrid)%w
720 ps2(igrid)%w=ps(igrid)%w
721 ps1(igrid)%ws=ps(igrid)%ws
722 ps2(igrid)%ws=ps(igrid)%ws
727 do iigrid=1,igridstail; igrid=igrids(iigrid);
728 if(.not.
allocated(ps2(igrid)%w))
allocate(ps2(igrid)%w(ixg^t,1:nw))
729 if(.not.
allocated(ps3(igrid)%w))
allocate(ps3(igrid)%w(ixg^t,1:nw))
730 if(.not.
allocated(ps4(igrid)%w))
allocate(ps4(igrid)%w(ixg^t,1:nw))
731 ps1(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
732 ps2(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
738 allocate(bj(0:temp%s))
742 omega1=4.d0/dble(temp%s**2+temp%s-2)
756 if(.not. temp%types_initialized)
then
758 if(temp%nflux>temp%nwbc)
then
774 temp%types_initialized = .true.
780 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
785 call temp%sts_set_sources(ixg^
ll,
ixm^
ll,ps(igrid)%w,ps(igrid)%x,ps4(igrid)%w,fix_conserve_at_step,dtj,igrid,temp%nflux)
787 ps3(igrid)%w(ixc^s,temp%startVar:temp%endVar) = my_dt * ps4(igrid)%w(ixc^s,temp%startVar:temp%endVar)
788 if(temp%nflux>
ndir)
then
789 ps1(igrid)%w(
ixm^t,temp%startVar) = ps1(igrid)%w(
ixm^t,temp%startVar) + cmut * ps3(igrid)%w(
ixm^t,temp%startVar)
791 ps1(igrid)%ws(ixc^s,1:nws) = ps1(igrid)%ws(ixc^s,1:nws) + cmut * ps3(igrid)%w(ixc^s,iw_mag(1:nws))
798 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
802 call temp%sts_set_sources(ixg^
ll,
ixm^
ll,ps(igrid)%w,ps(igrid)%x,ps4(igrid)%w,fix_conserve_at_step,dtj,igrid,temp%nflux)
804 ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar) = my_dt * ps4(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
805 ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar) = ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar) + &
806 cmut * ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
812 if(fix_conserve_at_step)
then
820 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
827 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
828 ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar) = &
829 (ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar) &
830 - ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar))/cmut
836 if(
associated(temp%sts_handle_errors))
then
838 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
841 call temp%sts_handle_errors(ps1(igrid)%w,ps1(igrid)%x,ixg^
ll,
ixm^
ll,1)
845 if(temp%nflux>temp%nwbc.and.temp%s==1)
then
864 bj(j)=dble(j**2+j-2)/dble(2*j*(j+1))
865 cmu=dble(2*j-1)/dble(j)*bj(j)/bj(j-1)
867 cnu=dble(1-j)/dble(j)*bj(j)/bj(j-2)
868 cnut=(bj(j-1)-1.d0)*cmut
869 one_mu_nu=1.d0-cmu-cnu
882 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
888 call temp%sts_set_sources(ixg^
ll,
ixm^
ll,tmpps1(igrid)%w,ps(igrid)%x,ps4(igrid)%w,fix_conserve_at_step,dtj,igrid,temp%nflux)
889 if(temp%nflux>
ndir)
then
890 tmpps2(igrid)%w(
ixm^t,temp%startVar)=cmu*tmpps1(igrid)%w(
ixm^t,temp%startVar)+&
891 cnu*tmpps2(igrid)%w(
ixm^t,temp%startVar)+one_mu_nu*ps(igrid)%w(
ixm^t,temp%startVar)+&
892 dtj*ps4(igrid)%w(
ixm^t,temp%startVar)+cnut*ps3(igrid)%w(
ixm^t,temp%startVar)
894 tmpps2(igrid)%ws(ixc^s,1:nws)=cmu*tmpps1(igrid)%ws(ixc^s,1:nws)+&
895 cnu*tmpps2(igrid)%ws(ixc^s,1:nws)+one_mu_nu*ps(igrid)%ws(ixc^s,1:nws)+&
896 dtj*ps4(igrid)%w(ixc^s,iw_mag(1:nws))+cnut*ps3(igrid)%w(ixc^s,iw_mag(1:nws))
902 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
908 call temp%sts_set_sources(ixg^
ll,
ixm^
ll,tmpps1(igrid)%w,ps(igrid)%x,ps4(igrid)%w,fix_conserve_at_step,dtj,igrid,temp%nflux)
909 tmpps2(igrid)%w(
ixm^t,temp%startVar:temp%endVar)=cmu*tmpps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
910 cnu*tmpps2(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+one_mu_nu*ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
911 dtj*ps4(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+cnut*ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
916 if(fix_conserve_at_step)
then
924 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
930 if(
associated(temp%sts_handle_errors))
then
932 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
935 call temp%sts_handle_errors(tmpps2(igrid)%w,ps(igrid)%x,ixg^
ll,
ixm^
ll,j)
940 if(temp%nflux>temp%nwbc.and.temp%s==j)
then
952 evenstep=.not.evenstep
955 if(
associated(temp%sts_after_last_cycle))
then
958 do iigrid=1,igridstail; igrid=igrids(iigrid);
961 ps(igrid)%w(ixg^t,temp%startVar:temp%endVar)=tmpps2(igrid)%w(ixg^t,temp%startVar:temp%endVar)
962 call temp%sts_after_last_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
972 do iigrid=1,igridstail; igrid=igrids(iigrid);
973 ps(igrid)%w(ixg^t,temp%startVar:temp%endVar)=tmpps2(igrid)%w(ixg^t,temp%startVar:temp%endVar)
974 ps(igrid)%ws=tmpps2(igrid)%ws
979 do iigrid=1,igridstail; igrid=igrids(iigrid);
980 ps(igrid)%w(ixg^t,temp%startVar:temp%endVar)=tmpps2(igrid)%w(ixg^t,temp%startVar:temp%endVar)
988 if(.not.temp%evolve_magnetic_field)
then
1010 do iigrid=1,igridstail; igrid=igrids(iigrid);
1011 call eos%update_eos(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
1015 end subroutine sts_add_source1
subroutine, public alloc_state(igrid, s, ixgl, ixgextl, alloc_once_for_ps)
allocate memory to physical state of igrid node
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
Module for physical and numeric constants.
double precision, parameter dpi
Pi.
EoS state container – the single thermodynamic authority for AMRVAC.
type(eos_container), allocatable, public eos
The single EoS state object, allocated in eos_init and shared (read-mostly) across all EoS sub-module...
Module for flux conservation near refinement boundaries.
subroutine, public init_comm_fix_conserve(idimlim, nwfluxin)
subroutine, public fix_edges(psuse, idimlim)
subroutine, public recvflux(idimlim)
subroutine, public sendflux(idimlim)
subroutine, public fix_conserve(psb, idimlim, nw0, nwfluxin)
Module with geometry-related routines (e.g., divergence, curl).
update ghost cells of all blocks including physical boundaries
integer, dimension( :^d &), pointer type_recv_r
integer, dimension(^nd, 0:3) l
subroutine getbc(time, qdt, psb, nwstart, nwbc)
do update ghost cells of all blocks including physical boundaries
integer, dimension(0:3^d &), target type_send_p_f
subroutine create_bc_mpi_datatype(nwstart, nwbc, nwfull)
integer, dimension( :^d &), pointer type_send_p
integer, dimension( :^d &), pointer type_send_srl
integer, dimension(0:3^d &), target type_recv_r_f
integer, dimension(-1:1^d &), target type_recv_srl_f
integer, dimension(-1:1^d &), target type_send_r_f
integer, dimension(-1:1^d &), target type_send_srl_f
integer, dimension( :^d &), pointer type_send_r
integer, dimension( :^d &), pointer type_recv_p
integer, dimension(0:3^d &), target type_recv_p_f
integer, dimension( :^d &), pointer type_recv_srl
This module contains definitions of global parameters and variables and some generic functions/subrou...
type(state), pointer block
Block pointer for using one block and its previous state.
logical lb_diagnose
Per-rank load-balance timing diagnostic toggle (off by default). When .true., per-rank wall times are...
integer, parameter unitpar
file handle for IO
double precision, dimension(:), allocatable block_cost
Per-step per-block (per-rank, indexed by igrid) cost accumulator. Reset at start of each advance call...
double precision global_time
The global simulation time.
integer, parameter ndim
Number of spatial dimensions for grid variables.
logical stagger_grid
True for using stagger grid.
character(len=std_len), dimension(:), allocatable par_files
Which par files are used as input.
integer icomm
The MPI communicator.
logical coarsenprimitive
coarsen primitive variables in level-jump ghost cells
integer ndir
Number of spatial dimensions (components) for vector variables.
integer ixm
the mesh range of a physical block without ghost cells
integer ierrmpi
A global MPI error return code.
double precision, dimension(:), allocatable, parameter d
logical lb_automatic
Cost-weighted automatic load balancer toggle (off by default). When .true., the SFC partitioner cuts ...
logical time_advance
do time evolving
logical prolongprimitive
prolongate primitive variables in level-jump ghost cells
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
double precision, dimension(:,:), allocatable dx
spatial steps for all dimensions at all levels
double precision, dimension(^nd) dxlevel
store unstretched cell size of current level
This module defines the procedures of a physics module. It contains function pointers for the various...
logical phys_total_energy
Solve total energy equation or not.
procedure(sub_face_to_center), pointer phys_face_to_center
Module for handling problematic values in simulations, such as negative pressures.
Generic supertimestepping method which can be used for multiple source terms in the governing equatio...
integer, public sourcetype_sts
double precision, public lb_tc_accum
Per-rank TC/STS compute accumulator for lb_diagnose. Sums the wall time spent inside the iigrid block...
pure logical function, public is_sts_initialized()
integer, parameter, public sourcetype_sts_prior
logical function, public set_dt_sts_ncycles(my_dt)
This sets the explicit dt and calculates the number of cycles for each of the terms implemented with ...
subroutine, public add_sts_method(sts_getdt, sts_set_sources, startvar, nflux, startwbc, nwbc, evolve_b)
subroutine which added programatically a term to be calculated using STS Params: sts_getdt function c...
type(sts_term), pointer head_sts_terms
integer, public sts_app_id
Counts STS applications (one per term per call of sts_add_source), so a term can tell the first stage...
subroutine, public set_conversion_methods_to_head(sts_before_first_cycle, sts_after_last_cycle)
Set the hooks called before the first cycle and after the last cycle in the STS update This method sh...
integer, parameter, public sourcetype_sts_split
subroutine, public set_error_handling_to_head(sts_error_handling)
Set the hook of error handling in the STS update. This method is called before updating the BC....
subroutine, public sts_init()
Initialize sts module.
integer, parameter, public sourcetype_sts_after
procedure(subr3), pointer, public sts_add_source