50 double precision :: sts_dtpar=0.5d0
53 double precision,
parameter :: nu_sts = 0.5d0
55 integer :: sts_ncycles=1000
56 integer :: sts_method = 1
62 logical :: fix_conserve_at_step = .true.
63 logical :: sts_initialized = .false.
68 subroutine subr1(ixI^L,ixO^L,w,x,wres,fix_conserve_at_step,my_dt,igrid,nflux)
70 integer,
intent(in) :: ixi^
l, ixo^
l, igrid, nflux
71 double precision,
intent(in) :: x(ixi^s,1:
ndim)
72 double precision,
intent(inout) :: wres(ixi^s,1:nw), w(ixi^s,1:nw)
73 double precision,
intent(in) :: my_dt
74 logical,
intent(in) :: fix_conserve_at_step
78 function subr2(w,ixG^L,ix^L,dx^D,x)
result(dtnew)
80 integer,
intent(in) :: ixg^
l, ix^
l
81 double precision,
intent(in) ::
dx^
d, x(ixg^s,1:
ndim)
82 double precision,
intent(in) :: w(ixg^s,1:nw)
83 double precision :: dtnew
87 subroutine subr_e(w, x, ixI^L, ixO^L, step)
90 integer,
intent(in) :: ixi^
l,ixo^
l
91 double precision,
intent(inout) :: w(ixi^s,1:nw)
92 double precision,
intent(in) :: x(ixi^s,1:
ndim)
93 integer,
intent(in) :: step
97 subroutine subr5(ixI^L, ixO^L, w, x)
99 integer,
intent(in) :: ixi^
l, ixo^
l
100 double precision,
intent(in) :: x(ixi^s,1:
ndim)
101 double precision,
intent(inout) :: w(ixi^s,1:nw)
108 double precision,
intent(in) :: dt
112 function subr4(dt,dtnew,dt_modified)
result(s)
113 double precision,
intent(in) :: dtnew
114 double precision,
intent(inout) :: dt
115 logical,
intent(inout) :: dt_modified
123 double precision :: dt_expl
127 integer,
dimension(-1:1^D&) :: type_send_srl_sts_1, type_recv_srl_sts_1
128 integer,
dimension(-1:1^D&) :: type_send_r_sts_1
129 integer,
dimension( 0:3^D&) :: type_recv_r_sts_1
130 integer,
dimension( 0:3^D&) :: type_recv_p_sts_1, type_send_p_sts_1
132 integer,
dimension(-1:1^D&) :: type_send_srl_sts_2, type_recv_srl_sts_2
133 integer,
dimension(-1:1^D&) :: type_send_r_sts_2
134 integer,
dimension( 0:3^D&) :: type_recv_r_sts_2
135 integer,
dimension( 0:3^D&) :: type_recv_p_sts_2, type_send_p_sts_2
143 logical :: types_initialized
144 logical :: evolve_magnetic_field
145 procedure(subr1),
pointer,
nopass :: sts_set_sources
146 procedure(subr2),
pointer,
nopass :: sts_getdt
147 procedure(subr5),
pointer,
nopass :: sts_before_first_cycle, sts_after_last_cycle
148 procedure(subr_e),
pointer,
nopass :: sts_handle_errors
149 type(sts_term),
pointer :: next
157 procedure(subr4),
pointer :: sts_get_ncycles
165 if(.not. sts_initialized)
then
168 sts_dtpar=sts_dtpar/dble(
ndim)
169 sts_initialized = .true.
170 if(sts_method .eq. 1)
then
172 sts_get_ncycles => sts_get_ncycles1
173 else if(sts_method .eq. 2)
then
175 sts_get_ncycles => sts_get_ncycles2
177 call mpistop(
"Unknown sts method")
185 if (sts_initialized)
then
193 subroutine sts_params_read(files)
195 character(len=*),
intent(in) :: files(:)
198 namelist /sts_list/ sts_dtpar,sts_ncycles,sts_method,
sourcetype_sts
200 do n = 1,
size(files)
201 open(
unitpar, file=trim(files(n)), status=
"old")
202 read(
unitpar, sts_list,
end=111)
206 end subroutine sts_params_read
215 subroutine add_sts_method(sts_getdt, sts_set_sources, startVar, nflux, startwbc, nwbc, evolve_B)
219 integer,
intent(in) :: startvar, nflux, startwbc, nwbc
220 logical,
intent(in) :: evolve_b
224 subroutine sts_set_sources(ixI^L,ixO^L,w,x,wres,fix_conserve_at_step,my_dt,igrid,nflux)
227 integer,
intent(in) :: ixi^
l, ixo^
l, igrid, nflux
228 double precision,
intent(in) :: x(ixi^s,1:
ndim)
229 double precision,
intent(inout) :: wres(ixi^s,1:nw), w(ixi^s,1:nw)
230 double precision,
intent(in) :: my_dt
231 logical,
intent(in) :: fix_conserve_at_step
232 end subroutine sts_set_sources
234 function sts_getdt(w,ixG^L,ix^L,dx^D,x)
result(dtnew)
236 integer,
intent(in) :: ixg^
l, ix^
l
237 double precision,
intent(in) ::
dx^
d, x(ixg^s,1:
ndim)
238 double precision,
intent(in) :: w(ixg^s,1:nw)
239 double precision :: dtnew
240 end function sts_getdt
244 type(sts_term),
pointer :: temp
247 temp%sts_getdt => sts_getdt
248 temp%sts_set_sources => sts_set_sources
249 temp%sts_before_first_cycle => null()
250 temp%sts_after_last_cycle => null()
251 temp%sts_handle_errors => null()
252 temp%startVar = startvar
253 temp%endVar= startvar+nflux-1
255 temp%startwbc = startwbc
257 temp%types_initialized = .false.
258 temp%evolve_magnetic_field=evolve_b
270 subroutine sts_before_first_cycle(ixI^L, ixO^L, w, x)
272 integer,
intent(in) :: ixi^
l, ixo^
l
273 double precision,
intent(in) :: x(ixi^s,1:
ndim)
274 double precision,
intent(inout) :: w(ixi^s,1:nw)
275 end subroutine sts_before_first_cycle
277 subroutine sts_after_last_cycle(ixI^L, ixO^L, w, x)
279 integer,
intent(in) :: ixi^
l, ixo^
l
280 double precision,
intent(in) :: x(ixi^s,1:
ndim)
281 double precision,
intent(inout) :: w(ixi^s,1:nw)
282 end subroutine sts_after_last_cycle
295 subroutine sts_error_handling(w, x, ixI^L, ixO^L, step)
298 integer,
intent(in) :: ixi^
l,ixo^
l
299 double precision,
intent(inout) :: w(ixi^s,1:nw)
300 double precision,
intent(in) :: x(ixi^s,1:
ndim)
301 integer,
intent(in) :: step
302 end subroutine sts_error_handling
309 function sts_get_ncycles1(dt,dtnew,dt_modified)
result(is)
310 double precision,
intent(in) :: dtnew
311 double precision,
intent(inout) :: dt
312 logical,
intent(inout) :: dt_modified
315 double precision :: ss
318 ss = dtnew*((2.d0*sts_ncycles+1)**2-9.d0)/16.d0
326 if(ss .le. 1.d0)
then
329 is=ceiling((dsqrt(9.d0+16.d0*ss)-1.d0)*0.5d0)
334 end function sts_get_ncycles1
337 function sts_get_ncycles2(dt,dtnew,dt_modified)
result(is)
338 double precision,
intent(in) :: dtnew
339 double precision,
intent(inout) :: dt
340 logical,
intent(inout) :: dt_modified
343 double precision :: ss,rr
348 ncycles = sts_ncycles
350 ss=sum_chev(nu_sts,ncycles,rr)
359 end function sts_get_ncycles2
365 double precision,
intent(inout) :: my_dt
366 double precision :: my_dt1
367 logical :: dt_modified, dt_modified1, dt_modified2
369 double precision :: dtnew,dtmin_mype
370 double precision ::
dx^
d, ss
371 integer:: iigrid, igrid, ncycles
372 type(sts_term),
pointer :: temp,oldtemp
375 dt_modified = .false.
376 do while(
associated(temp))
377 dt_modified2 = .false.
380 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
387 dtmin_mype=min(dtmin_mype, sts_dtpar * temp%sts_getdt(ps(igrid)%w,ixg^
ll,
ixm^
ll,
dx^
d,ps(igrid)%x))
390 call mpi_allreduce(dtmin_mype,dtnew,1,mpi_double_precision,mpi_min,
icomm,
ierrmpi)
391 temp%s = sts_get_ncycles(my_dt,dtnew,dt_modified2)
399 if(dt_modified2)
then
404 dt_modified1 = .false.
405 do while(.not.
associated(oldtemp,temp))
406 oldtemp%s = sts_get_ncycles(my_dt1,oldtemp%dt_expl,dt_modified1)
408 if(dt_modified1)
call mpistop(
"sts dt modified twice")
409 oldtemp=>oldtemp%next
418 pure FUNCTION chev(j,nu,N)
421 double precision,
INTENT(IN) :: nu
422 INTEGER,
INTENT(IN) :: j, n
423 double precision :: chev
425 chev = 1d0 / ((-1d0 + nu)*cos(((2d0*j - 1d0) / n)* (
dpi/2d0)) + 1d0 + nu)
429 FUNCTION sum_chev(nu,N,limMax)
430 double precision,
intent(in) :: nu,limmax
431 integer,
intent(inout) :: n
432 double precision :: sum_chev, tmp
438 do while (j < n .and. sum_chev < limmax)
439 sum_chev = sum_chev + chev(j,nu,n)
443 END FUNCTION sum_chev
447 subroutine sts_add_source2(my_dt)
454 double precision,
intent(in) :: my_dt
455 double precision,
allocatable :: bj(:)
456 double precision :: sumbj,dtj
458 integer:: iigrid, igrid, j, ixc^
l
459 logical :: stagger_flag=.false., prolong_flag=.false., coarsen_flag=.false.
460 type(sts_term),
pointer :: temp
468 do while(
associated(temp))
470 if(.not.temp%evolve_magnetic_field)
then
481 if(
associated(temp%sts_before_first_cycle))
then
486 do iigrid=1,igridstail; igrid=igrids(iigrid);
489 call temp%sts_before_first_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
493 allocate(bj(1:temp%s))
495 bj(j) = chev(j,nu_sts,sts_ncycles)
505 if(.not. temp%types_initialized)
then
507 if(temp%nflux>temp%nwbc)
then
523 temp%types_initialized = .true.
528 if(j .eq. temp%s .and. (sumbj + bj(j)) * temp%dt_expl > my_dt)
then
529 dtj = my_dt - sumbj * temp%dt_expl
531 dtj = bj(j)* temp%dt_expl
533 sumbj = sumbj + bj(j)
536 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
539 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)
540 if(temp%nflux>
ndir)
then
541 ps(igrid)%w(
ixm^t,temp%startVar)=ps(igrid)%w(
ixm^t,temp%startVar)+dtj*ps1(igrid)%w(
ixm^t,temp%startVar)
543 ps(igrid)%ws(ixc^s,1:nws)=ps(igrid)%ws(ixc^s,1:nws)+dtj*ps1(igrid)%w(ixc^s,iw_mag(1:nws))
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 ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)=ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
554 dtj*ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
559 if(fix_conserve_at_step)
then
567 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
573 if(
associated(temp%sts_handle_errors))
then
575 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
578 call temp%sts_handle_errors(ps(igrid)%w,ps(igrid)%x,ixg^
ll,
ixm^
ll,j)
583 if(temp%nflux>temp%nwbc.and.temp%s==j)
then
597 if(
associated(temp%sts_after_last_cycle))
then
598 do iigrid=1,igridstail; igrid=igrids(iigrid);
601 call temp%sts_after_last_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
608 if(.not.temp%evolve_magnetic_field)
then
628 if(eos%eos_type ==
'PI')
then
631 do iigrid=1,igridstail; igrid=igrids(iigrid);
632 call eos%update_eos(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
637 end subroutine sts_add_source2
641 subroutine sts_add_source1(my_dt)
649 double precision,
intent(in) :: my_dt
650 double precision :: dtj
651 double precision :: omega1,cmu,cmut,cnu,cnut,one_mu_nu
652 double precision,
allocatable :: bj(:)
653 integer:: iigrid, igrid, j, ixc^
l, ixgext^
l
654 double precision :: lb_t0_tc, lb_t0_block
655 logical :: evenstep, stagger_flag=.false., prolong_flag=.false., coarsen_flag=.false., total_energy_flag=.true.
656 type(sts_term),
pointer :: temp
657 type(state),
dimension(:),
pointer :: tmpps1, tmpps2
665 do while(
associated(temp))
667 if(.not.temp%evolve_magnetic_field)
then
678 if(
associated(temp%sts_before_first_cycle))
then
686 do iigrid=1,igridstail; igrid=igrids(iigrid);
689 call temp%sts_before_first_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
690 if(.not.
allocated(ps2(igrid)%w))
allocate(ps2(igrid)%w(ixg^t,1:nw))
691 if(.not.
allocated(ps3(igrid)%w))
allocate(ps3(igrid)%w(ixg^t,1:nw))
692 if(.not.
allocated(ps4(igrid)%w))
allocate(ps4(igrid)%w(ixg^t,1:nw))
693 ps1(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
694 ps2(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
699 ixgext^
l=ixg^
ll^ladd1;
701 do iigrid=1,igridstail; igrid=igrids(iigrid);
702 if(.not.
allocated(ps2(igrid)%w))
then
705 if(.not.
allocated(ps3(igrid)%w))
allocate(ps3(igrid)%w(ixg^t,1:nw))
706 if(.not.
allocated(ps4(igrid)%w))
allocate(ps4(igrid)%w(ixg^t,1:nw))
707 ps1(igrid)%w=ps(igrid)%w
708 ps2(igrid)%w=ps(igrid)%w
709 ps1(igrid)%ws=ps(igrid)%ws
710 ps2(igrid)%ws=ps(igrid)%ws
715 do iigrid=1,igridstail; igrid=igrids(iigrid);
716 if(.not.
allocated(ps2(igrid)%w))
allocate(ps2(igrid)%w(ixg^t,1:nw))
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(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
720 ps2(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
726 allocate(bj(0:temp%s))
730 omega1=4.d0/dble(temp%s**2+temp%s-2)
744 if(.not. temp%types_initialized)
then
746 if(temp%nflux>temp%nwbc)
then
762 temp%types_initialized = .true.
768 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
773 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)
775 ps3(igrid)%w(ixc^s,temp%startVar:temp%endVar) = my_dt * ps4(igrid)%w(ixc^s,temp%startVar:temp%endVar)
776 if(temp%nflux>
ndir)
then
777 ps1(igrid)%w(
ixm^t,temp%startVar) = ps1(igrid)%w(
ixm^t,temp%startVar) + cmut * ps3(igrid)%w(
ixm^t,temp%startVar)
779 ps1(igrid)%ws(ixc^s,1:nws) = ps1(igrid)%ws(ixc^s,1:nws) + cmut * ps3(igrid)%w(ixc^s,iw_mag(1:nws))
786 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
790 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)
792 ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar) = my_dt * ps4(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
793 ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar) = ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar) + &
794 cmut * ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
800 if(fix_conserve_at_step)
then
808 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
815 if(
associated(temp%sts_handle_errors))
then
817 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
820 call temp%sts_handle_errors(ps1(igrid)%w,ps1(igrid)%x,ixg^
ll,
ixm^
ll,1)
824 if(temp%nflux>temp%nwbc.and.temp%s==1)
then
843 bj(j)=dble(j**2+j-2)/dble(2*j*(j+1))
844 cmu=dble(2*j-1)/dble(j)*bj(j)/bj(j-1)
846 cnu=dble(1-j)/dble(j)*bj(j)/bj(j-2)
847 cnut=(bj(j-1)-1.d0)*cmut
848 one_mu_nu=1.d0-cmu-cnu
861 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
867 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)
868 if(temp%nflux>
ndir)
then
869 tmpps2(igrid)%w(
ixm^t,temp%startVar)=cmu*tmpps1(igrid)%w(
ixm^t,temp%startVar)+&
870 cnu*tmpps2(igrid)%w(
ixm^t,temp%startVar)+one_mu_nu*ps(igrid)%w(
ixm^t,temp%startVar)+&
871 dtj*ps4(igrid)%w(
ixm^t,temp%startVar)+cnut*ps3(igrid)%w(
ixm^t,temp%startVar)
873 tmpps2(igrid)%ws(ixc^s,1:nws)=cmu*tmpps1(igrid)%ws(ixc^s,1:nws)+&
874 cnu*tmpps2(igrid)%ws(ixc^s,1:nws)+one_mu_nu*ps(igrid)%ws(ixc^s,1:nws)+&
875 dtj*ps4(igrid)%w(ixc^s,iw_mag(1:nws))+cnut*ps3(igrid)%w(ixc^s,iw_mag(1:nws))
881 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
887 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)
888 tmpps2(igrid)%w(
ixm^t,temp%startVar:temp%endVar)=cmu*tmpps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
889 cnu*tmpps2(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+one_mu_nu*ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
890 dtj*ps4(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+cnut*ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
895 if(fix_conserve_at_step)
then
903 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
909 if(
associated(temp%sts_handle_errors))
then
911 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
914 call temp%sts_handle_errors(tmpps2(igrid)%w,ps(igrid)%x,ixg^
ll,
ixm^
ll,j)
919 if(temp%nflux>temp%nwbc.and.temp%s==j)
then
931 evenstep=.not.evenstep
934 if(
associated(temp%sts_after_last_cycle))
then
937 do iigrid=1,igridstail; igrid=igrids(iigrid);
940 ps(igrid)%w(ixg^t,temp%startVar:temp%endVar)=tmpps2(igrid)%w(ixg^t,temp%startVar:temp%endVar)
941 call temp%sts_after_last_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
951 do iigrid=1,igridstail; igrid=igrids(iigrid);
952 ps(igrid)%w(ixg^t,temp%startVar:temp%endVar)=tmpps2(igrid)%w(ixg^t,temp%startVar:temp%endVar)
953 ps(igrid)%ws=tmpps2(igrid)%ws
958 do iigrid=1,igridstail; igrid=igrids(iigrid);
959 ps(igrid)%w(ixg^t,temp%startVar:temp%endVar)=tmpps2(igrid)%w(ixg^t,temp%startVar:temp%endVar)
967 if(.not.temp%evolve_magnetic_field)
then
987 if(eos%eos_type ==
'PI')
then
990 do iigrid=1,igridstail; igrid=igrids(iigrid);
991 call eos%update_eos(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
996 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
integer, dimension( :^d &), pointer type_send_p
integer, dimension( :^d &), pointer type_send_srl
subroutine create_bc_mpi_datatype(nwstart, nwbc)
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
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