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
262 temp%type_send_srl_sts_1=mpi_datatype_null; temp%type_recv_srl_sts_1=mpi_datatype_null
263 temp%type_send_r_sts_1 =mpi_datatype_null; temp%type_recv_r_sts_1 =mpi_datatype_null
264 temp%type_send_p_sts_1 =mpi_datatype_null; temp%type_recv_p_sts_1 =mpi_datatype_null
265 temp%type_send_srl_sts_2=mpi_datatype_null; temp%type_recv_srl_sts_2=mpi_datatype_null
266 temp%type_send_r_sts_2 =mpi_datatype_null; temp%type_recv_r_sts_2 =mpi_datatype_null
267 temp%type_send_p_sts_2 =mpi_datatype_null; temp%type_recv_p_sts_2 =mpi_datatype_null
279 subroutine sts_before_first_cycle(ixI^L, ixO^L, w, x)
281 integer,
intent(in) :: ixi^
l, ixo^
l
282 double precision,
intent(in) :: x(ixi^s,1:
ndim)
283 double precision,
intent(inout) :: w(ixi^s,1:nw)
284 end subroutine sts_before_first_cycle
286 subroutine sts_after_last_cycle(ixI^L, ixO^L, w, x)
288 integer,
intent(in) :: ixi^
l, ixo^
l
289 double precision,
intent(in) :: x(ixi^s,1:
ndim)
290 double precision,
intent(inout) :: w(ixi^s,1:nw)
291 end subroutine sts_after_last_cycle
304 subroutine sts_error_handling(w, x, ixI^L, ixO^L, step)
307 integer,
intent(in) :: ixi^
l,ixo^
l
308 double precision,
intent(inout) :: w(ixi^s,1:nw)
309 double precision,
intent(in) :: x(ixi^s,1:
ndim)
310 integer,
intent(in) :: step
311 end subroutine sts_error_handling
318 function sts_get_ncycles1(dt,dtnew,dt_modified)
result(is)
319 double precision,
intent(in) :: dtnew
320 double precision,
intent(inout) :: dt
321 logical,
intent(inout) :: dt_modified
324 double precision :: ss
327 ss = dtnew*((2.d0*sts_ncycles+1)**2-9.d0)/16.d0
335 if(ss .le. 1.d0)
then
338 is=ceiling((dsqrt(9.d0+16.d0*ss)-1.d0)*0.5d0)
343 end function sts_get_ncycles1
346 function sts_get_ncycles2(dt,dtnew,dt_modified)
result(is)
347 double precision,
intent(in) :: dtnew
348 double precision,
intent(inout) :: dt
349 logical,
intent(inout) :: dt_modified
352 double precision :: ss,rr
357 ncycles = sts_ncycles
359 ss=sum_chev(nu_sts,ncycles,rr)
368 end function sts_get_ncycles2
374 double precision,
intent(inout) :: my_dt
375 double precision :: my_dt1
376 logical :: dt_modified, dt_modified1, dt_modified2
378 double precision :: dtnew,dtmin_mype
379 double precision ::
dx^
d, ss
380 integer:: iigrid, igrid, ncycles
381 type(sts_term),
pointer :: temp,oldtemp
384 dt_modified = .false.
385 do while(
associated(temp))
386 dt_modified2 = .false.
389 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
396 dtmin_mype=min(dtmin_mype, sts_dtpar * temp%sts_getdt(ps(igrid)%w,ixg^
ll,
ixm^
ll,
dx^
d,ps(igrid)%x))
399 call mpi_allreduce(dtmin_mype,dtnew,1,mpi_double_precision,mpi_min,
icomm,
ierrmpi)
400 temp%s = sts_get_ncycles(my_dt,dtnew,dt_modified2)
408 if(dt_modified2)
then
413 dt_modified1 = .false.
414 do while(.not.
associated(oldtemp,temp))
415 oldtemp%s = sts_get_ncycles(my_dt1,oldtemp%dt_expl,dt_modified1)
417 if(dt_modified1)
call mpistop(
"sts dt modified twice")
418 oldtemp=>oldtemp%next
427 pure FUNCTION chev(j,nu,N)
430 double precision,
INTENT(IN) :: nu
431 INTEGER,
INTENT(IN) :: j, n
432 double precision :: chev
434 chev = 1d0 / ((-1d0 + nu)*cos(((2d0*j - 1d0) / n)* (
dpi/2d0)) + 1d0 + nu)
438 FUNCTION sum_chev(nu,N,limMax)
439 double precision,
intent(in) :: nu,limmax
440 integer,
intent(inout) :: n
441 double precision :: sum_chev, tmp
447 do while (j < n .and. sum_chev < limmax)
448 sum_chev = sum_chev + chev(j,nu,n)
452 END FUNCTION sum_chev
456 subroutine sts_add_source2(my_dt)
463 double precision,
intent(in) :: my_dt
464 double precision,
allocatable :: bj(:)
465 double precision :: sumbj,dtj
467 integer:: iigrid, igrid, j, ixc^
l
468 logical :: stagger_flag=.false., prolong_flag=.false., coarsen_flag=.false.
469 type(sts_term),
pointer :: temp
477 do while(
associated(temp))
479 if(.not.temp%evolve_magnetic_field)
then
490 if(
associated(temp%sts_before_first_cycle))
then
495 do iigrid=1,igridstail; igrid=igrids(iigrid);
498 call temp%sts_before_first_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
502 allocate(bj(1:temp%s))
504 bj(j) = chev(j,nu_sts,sts_ncycles)
514 if(.not. temp%types_initialized)
then
516 if(temp%nflux>temp%nwbc)
then
532 temp%types_initialized = .true.
537 if(j .eq. temp%s .and. (sumbj + bj(j)) * temp%dt_expl > my_dt)
then
538 dtj = my_dt - sumbj * temp%dt_expl
540 dtj = bj(j)* temp%dt_expl
542 sumbj = sumbj + bj(j)
545 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
548 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)
549 if(temp%nflux>
ndir)
then
550 ps(igrid)%w(
ixm^t,temp%startVar)=ps(igrid)%w(
ixm^t,temp%startVar)+dtj*ps1(igrid)%w(
ixm^t,temp%startVar)
552 ps(igrid)%ws(ixc^s,1:nws)=ps(igrid)%ws(ixc^s,1:nws)+dtj*ps1(igrid)%w(ixc^s,iw_mag(1:nws))
558 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
561 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)
562 ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)=ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
563 dtj*ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
568 if(fix_conserve_at_step)
then
576 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
582 if(
associated(temp%sts_handle_errors))
then
584 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
587 call temp%sts_handle_errors(ps(igrid)%w,ps(igrid)%x,ixg^
ll,
ixm^
ll,j)
592 if(temp%nflux>temp%nwbc.and.temp%s==j)
then
606 if(
associated(temp%sts_after_last_cycle))
then
607 do iigrid=1,igridstail; igrid=igrids(iigrid);
610 call temp%sts_after_last_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
617 if(.not.temp%evolve_magnetic_field)
then
637 if(eos%eos_type ==
'PI')
then
640 do iigrid=1,igridstail; igrid=igrids(iigrid);
641 call eos%update_eos(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
646 end subroutine sts_add_source2
650 subroutine sts_add_source1(my_dt)
658 double precision,
intent(in) :: my_dt
659 double precision :: dtj
660 double precision :: omega1,cmu,cmut,cnu,cnut,one_mu_nu
661 double precision,
allocatable :: bj(:)
662 integer:: iigrid, igrid, j, ixc^
l, ixgext^
l
663 double precision :: lb_t0_tc, lb_t0_block
664 logical :: evenstep, stagger_flag=.false., prolong_flag=.false., coarsen_flag=.false., total_energy_flag=.true.
665 type(sts_term),
pointer :: temp
666 type(state),
dimension(:),
pointer :: tmpps1, tmpps2
674 do while(
associated(temp))
676 if(.not.temp%evolve_magnetic_field)
then
687 if(
associated(temp%sts_before_first_cycle))
then
695 do iigrid=1,igridstail; igrid=igrids(iigrid);
698 call temp%sts_before_first_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
699 if(.not.
allocated(ps2(igrid)%w))
allocate(ps2(igrid)%w(ixg^t,1:nw))
700 if(.not.
allocated(ps3(igrid)%w))
allocate(ps3(igrid)%w(ixg^t,1:nw))
701 if(.not.
allocated(ps4(igrid)%w))
allocate(ps4(igrid)%w(ixg^t,1:nw))
702 ps1(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
703 ps2(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
708 ixgext^
l=ixg^
ll^ladd1;
710 do iigrid=1,igridstail; igrid=igrids(iigrid);
711 if(.not.
allocated(ps2(igrid)%w))
then
714 if(.not.
allocated(ps3(igrid)%w))
allocate(ps3(igrid)%w(ixg^t,1:nw))
715 if(.not.
allocated(ps4(igrid)%w))
allocate(ps4(igrid)%w(ixg^t,1:nw))
716 ps1(igrid)%w=ps(igrid)%w
717 ps2(igrid)%w=ps(igrid)%w
718 ps1(igrid)%ws=ps(igrid)%ws
719 ps2(igrid)%ws=ps(igrid)%ws
724 do iigrid=1,igridstail; igrid=igrids(iigrid);
725 if(.not.
allocated(ps2(igrid)%w))
allocate(ps2(igrid)%w(ixg^t,1:nw))
726 if(.not.
allocated(ps3(igrid)%w))
allocate(ps3(igrid)%w(ixg^t,1:nw))
727 if(.not.
allocated(ps4(igrid)%w))
allocate(ps4(igrid)%w(ixg^t,1:nw))
728 ps1(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
729 ps2(igrid)%w(ixg^t,1:nw)=ps(igrid)%w(ixg^t,1:nw)
735 allocate(bj(0:temp%s))
739 omega1=4.d0/dble(temp%s**2+temp%s-2)
753 if(.not. temp%types_initialized)
then
755 if(temp%nflux>temp%nwbc)
then
771 temp%types_initialized = .true.
777 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
782 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)
784 ps3(igrid)%w(ixc^s,temp%startVar:temp%endVar) = my_dt * ps4(igrid)%w(ixc^s,temp%startVar:temp%endVar)
785 if(temp%nflux>
ndir)
then
786 ps1(igrid)%w(
ixm^t,temp%startVar) = ps1(igrid)%w(
ixm^t,temp%startVar) + cmut * ps3(igrid)%w(
ixm^t,temp%startVar)
788 ps1(igrid)%ws(ixc^s,1:nws) = ps1(igrid)%ws(ixc^s,1:nws) + cmut * ps3(igrid)%w(ixc^s,iw_mag(1:nws))
795 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
799 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)
801 ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar) = my_dt * ps4(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
802 ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar) = ps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar) + &
803 cmut * ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
809 if(fix_conserve_at_step)
then
817 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
824 if(
associated(temp%sts_handle_errors))
then
826 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
829 call temp%sts_handle_errors(ps1(igrid)%w,ps1(igrid)%x,ixg^
ll,
ixm^
ll,1)
833 if(temp%nflux>temp%nwbc.and.temp%s==1)
then
852 bj(j)=dble(j**2+j-2)/dble(2*j*(j+1))
853 cmu=dble(2*j-1)/dble(j)*bj(j)/bj(j-1)
855 cnu=dble(1-j)/dble(j)*bj(j)/bj(j-2)
856 cnut=(bj(j-1)-1.d0)*cmut
857 one_mu_nu=1.d0-cmu-cnu
870 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
876 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)
877 if(temp%nflux>
ndir)
then
878 tmpps2(igrid)%w(
ixm^t,temp%startVar)=cmu*tmpps1(igrid)%w(
ixm^t,temp%startVar)+&
879 cnu*tmpps2(igrid)%w(
ixm^t,temp%startVar)+one_mu_nu*ps(igrid)%w(
ixm^t,temp%startVar)+&
880 dtj*ps4(igrid)%w(
ixm^t,temp%startVar)+cnut*ps3(igrid)%w(
ixm^t,temp%startVar)
882 tmpps2(igrid)%ws(ixc^s,1:nws)=cmu*tmpps1(igrid)%ws(ixc^s,1:nws)+&
883 cnu*tmpps2(igrid)%ws(ixc^s,1:nws)+one_mu_nu*ps(igrid)%ws(ixc^s,1:nws)+&
884 dtj*ps4(igrid)%w(ixc^s,iw_mag(1:nws))+cnut*ps3(igrid)%w(ixc^s,iw_mag(1:nws))
890 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
896 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)
897 tmpps2(igrid)%w(
ixm^t,temp%startVar:temp%endVar)=cmu*tmpps1(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
898 cnu*tmpps2(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+one_mu_nu*ps(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+&
899 dtj*ps4(igrid)%w(
ixm^t,temp%startVar:temp%endVar)+cnut*ps3(igrid)%w(
ixm^t,temp%startVar:temp%endVar)
904 if(fix_conserve_at_step)
then
912 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
918 if(
associated(temp%sts_handle_errors))
then
920 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
923 call temp%sts_handle_errors(tmpps2(igrid)%w,ps(igrid)%x,ixg^
ll,
ixm^
ll,j)
928 if(temp%nflux>temp%nwbc.and.temp%s==j)
then
940 evenstep=.not.evenstep
943 if(
associated(temp%sts_after_last_cycle))
then
946 do iigrid=1,igridstail; igrid=igrids(iigrid);
949 ps(igrid)%w(ixg^t,temp%startVar:temp%endVar)=tmpps2(igrid)%w(ixg^t,temp%startVar:temp%endVar)
950 call temp%sts_after_last_cycle(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
960 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 ps(igrid)%ws=tmpps2(igrid)%ws
967 do iigrid=1,igridstail; igrid=igrids(iigrid);
968 ps(igrid)%w(ixg^t,temp%startVar:temp%endVar)=tmpps2(igrid)%w(ixg^t,temp%startVar:temp%endVar)
976 if(.not.temp%evolve_magnetic_field)
then
996 if(eos%eos_type ==
'PI')
then
999 do iigrid=1,igridstail; igrid=igrids(iigrid);
1000 call eos%update_eos(ixg^
ll,ixg^
ll,ps(igrid)%w,ps(igrid)%x)
1005 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
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