Skip to content

Commit

Permalink
added external parameters to jobinfo file
Browse files Browse the repository at this point in the history
  • Loading branch information
harpolea committed Mar 20, 2019
1 parent 1108b26 commit 3f9a408
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Source/MaestroPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ Maestro::WriteJobInfo (const std::string& dir) const
for (int i = 0; i < jobinfo_file_length; i++)
jobinfo_file_name[i] = FullPathJobInfoFile[i];

// runtime_pretty_print(jobinfo_file_name.dataPtr(), &jobinfo_file_length);
runtime_pretty_print(jobinfo_file_name.dataPtr(), &jobinfo_file_length);
}
}

Expand Down
8 changes: 4 additions & 4 deletions Source/Maestro_F.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extern "C"
// these are interfaces to fortran subroutines

// void runtime_pretty_print(int* jobinfo_file_name, const int* jobinfo_file_length);
void runtime_pretty_print(int* jobinfo_file_name, const int* jobinfo_file_length);

//////////////////////
// in advect_base.F90
Expand Down Expand Up @@ -223,7 +223,7 @@ extern "C"
void diag_sphr(const int* lev, const int* lo, const int* hi,
const amrex::Real* scal, const int* s_lo, const int* s_hi, const int* nc_s,
const amrex::Real* rho_Hnuc, const int* hn_lo, const int* hn_hi,
const amrex::Real* rho_Hext, const int* he_lo, const int* he_hi,
const amrex::Real* rho_Hext, const int* he_lo, const int* he_hi,
const amrex::Real* u, const int* u_lo, const int* u_hi,
const amrex::Real* w0macx, const int* x_lo, const int* x_hi,
const amrex::Real* w0macy, const int* y_lo, const int* y_hi,
Expand All @@ -235,12 +235,12 @@ extern "C"
amrex::Real* enuc_max, amrex::Real* coord_enucmax, amrex::Real* vel_enucmax,
amrex::Real* kin_ener, amrex::Real* int_ener, amrex::Real* nuc_ener,
amrex::Real* U_max, amrex::Real* Mach_max,
int* ncenter, amrex::Real* T_center, amrex::Real* vel_center,
int* ncenter, amrex::Real* T_center, amrex::Real* vel_center,
const int* mask, const int* m_lo, const int* m_hi,
const int* use_mask);

void diag_grav_energy(amrex::Real* grav_ener,
const amrex::Real* rho0,
const amrex::Real* rho0,
const amrex::Real* r_cc_loc, const amrex::Real* r_edge_loc);
//////////////////////

Expand Down
39 changes: 29 additions & 10 deletions Source/param/runtime.probin.template
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ subroutine runtime_init()
! print*, "amrex_namelist=\n", amrex_namelist
! read in the namelist
read (amrex_namelist, nml=probin, iostat=status)

! print*, "xinlong1"
! print*, status
! print*, "amrex_namelist=\n", amrex_namelist
Expand Down Expand Up @@ -103,21 +103,40 @@ end subroutine runtime_init

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

subroutine runtime_pretty_print(unit) bind(C, name="runtime_pretty_print")
subroutine runtime_pretty_print(name, namlen) bind(C, name="runtime_pretty_print")

use amrex_constants_module
use probin_module
use extern_probin_module
use amrex_constants_module
use extern_probin_module
use amrex_error_module, only: amrex_error

implicit none

integer :: unit, i

integer :: namlen
integer :: name(namlen)

logical :: ltest

integer, parameter :: maxlen = 256
character (len=maxlen) :: probin

if (namlen > maxlen) then
call amrex_error("probin file name too long")
endif

integer, intent(in) :: unit
do i = 1, namlen
probin(i:i) = char(name(i))
end do

logical :: ltest
! open the job info file in Fortran
open(newunit=unit, file=probin(1:namlen), status="old", position="append")

write (unit, *) "[*] indicates overridden default"
@@printing@@

@@printing@@
close(unit=unit)

end subroutine runtime_pretty_print
end subroutine runtime_pretty_print


end module runtime_init_module

0 comments on commit 3f9a408

Please sign in to comment.