Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jwy/integer step #35

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions src/neptuneClass.f90
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ module neptuneClass
! Variables
!
!-----------------------------------------------------------------------
integer :: output_step ! output time step in seconds, 5 mins as default
!integer :: output_step ! output time step in seconds, 5 mins as default
zurdala marked this conversation as resolved.
Show resolved Hide resolved
real(dp) :: output_step ! output time step that can touch double precision
zurdala marked this conversation as resolved.
Show resolved Hide resolved
integer, public :: input_type_cov ! input type for covariance matrix

logical, dimension(2), public :: flag_init_tolerances ! rel. and abs. tolerance initialization for numerical integration
Expand Down Expand Up @@ -286,7 +287,7 @@ type(Neptune_class) function constructor()
constructor%reduction = Reduction_type()
constructor%correlation_model = Correlation_class()

constructor%output_step = 300 ! output time step in seconds, 5 mins as default
constructor%output_step = 300.0 ! output time step in seconds, 5 mins as default
constructor%input_type_cov = INPUT_UNDEFINED ! input type for covariance matrix

constructor%flag_init_tolerances = (/.false.,.false./) ! rel. and abs. tolerance initialization for numerical integration
Expand Down Expand Up @@ -463,7 +464,7 @@ subroutine initialize_input_array(this)
! INTEGER parameters
call this%set_input(parName=C_GEOPOTENTIAL, valType='integer', initFlag=.true.)
call this%set_input(parName=C_OPT_SAT_PROPERTIES, valType='integer', initFlag=.true.)
call this%set_input(parName=C_OUTPUT_STEP, valType='integer', initFlag=.true.)
!call this%set_input(parName=C_OUTPUT_STEP, valType='integer', initFlag=.true.)
zurdala marked this conversation as resolved.
Show resolved Hide resolved
call this%set_input(parName=C_PAR_INT_COV_METHOD, valType='integer', initFlag=.true.)
call this%set_input(parName=C_OPT_GEO_MODEL, valType='integer', initFlag=.true.)
call this%set_input(parName=C_OPT_AP_FORECAST, valType='integer', initFlag=.true.)
Expand All @@ -483,6 +484,7 @@ subroutine initialize_input_array(this)
call this%set_input(parName=C_PAR_INT_COV_STEP, valType='double', initFlag=.true.)
call this%set_input(parName=C_PAR_EARTH_RADIUS, valType='double', initFlag=.true.)
call this%set_input(parName=C_OPT_SOL_FORECAST, valType='double', initFlag=.true.)
call this%set_input(parName=C_OUTPUT_STEP, valType='double', initFlag=.true.) ! this should be double for the fix

! ON/OFF parameters (also set default values, if available)
do i = 1, this%derivatives_model%get_neptune_perturbation_number()
Expand Down Expand Up @@ -1713,7 +1715,7 @@ integer function setNeptuneVar_char( &
! CASE for INTEGER parameters
!
!------------------------
case(C_GEOPOTENTIAL, C_OPT_SAT_PROPERTIES, C_OUTPUT_STEP, C_PAR_INT_COV_METHOD, &
case(C_GEOPOTENTIAL, C_OPT_SAT_PROPERTIES, C_PAR_INT_COV_METHOD, & ! remove C_OUTPUT_STEP
zurdala marked this conversation as resolved.
Show resolved Hide resolved
C_OPT_GEO_MODEL, C_OPT_AP_FORECAST, C_OPT_STORE_DATA, C_COV_GEOPOTENTIAL, &
C_PAR_INT_METHOD, C_OPT_ATMOSPHERE_MODEL)

Expand Down Expand Up @@ -1761,12 +1763,6 @@ integer function setNeptuneVar_char( &
call this%set_input(parName=C_OPT_STORE_DATA, val=val, set=.true.)
call this%setStep(itemp)

!** Output
case(C_OUTPUT_STEP)
call this%set_input(parName=C_OUTPUT_STEP, val=val, set=.true.)
call this%output%write_to_output(C_OUTPUT_STEP, itemp)
this%output_step = itemp

!** state vector integration method
case(C_PAR_INT_METHOD)
call this%set_input(parName=C_PAR_INT_METHOD, val=val, set=.true.)
Expand All @@ -1791,7 +1787,7 @@ integer function setNeptuneVar_char( &
! CASE for REAL parameters
!
!-------------------------
case(C_PAR_MASS, C_PAR_CROSS_SECTION, C_PAR_CDRAG, &
case(C_PAR_MASS, C_PAR_CROSS_SECTION, C_PAR_CDRAG, C_OUTPUT_STEP, & ! add C_OUTPUT_STEP
zurdala marked this conversation as resolved.
Show resolved Hide resolved
C_PAR_CREFL, C_PAR_REENTRY, C_PAR_INT_RELEPS, C_PAR_INT_ABSEPS, &
C_PAR_INT_COV_STEP, C_PAR_EARTH_RADIUS, &
C_OPT_SOL_FORECAST)
Expand Down Expand Up @@ -1860,6 +1856,12 @@ integer function setNeptuneVar_char( &
call this%set_input(parName=C_OPT_SOL_FORECAST, val=val, set=.true.)
call this%atmosphere_model%setSolarFluxForecast(dtemp)

!** Output
case(C_OUTPUT_STEP)
call this%set_input(parName=C_OUTPUT_STEP, val=val, set=.true.)
call this%output%write_to_output(C_OUTPUT_STEP, itemp)
this%output_step = dtemp

end select

end if
Expand Down Expand Up @@ -2736,7 +2738,7 @@ subroutine initializeInputArray(this)
! INTEGER parameters
call this%set_input(parName=C_GEOPOTENTIAL, valType='integer', initFlag=.true.)
call this%set_input(parName=C_OPT_SAT_PROPERTIES, valType='integer', initFlag=.true.)
call this%set_input(parName=C_OUTPUT_STEP, valType='integer', initFlag=.true.)
! call this%set_input(parName=C_OUTPUT_STEP, valType='integer', initFlag=.true.)
zurdala marked this conversation as resolved.
Show resolved Hide resolved
call this%set_input(parName=C_PAR_INT_COV_METHOD, valType='integer', initFlag=.true.)
call this%set_input(parName=C_OPT_GEO_MODEL, valType='integer', initFlag=.true.)
call this%set_input(parName=C_OPT_AP_FORECAST, valType='integer', initFlag=.true.)
Expand All @@ -2756,6 +2758,8 @@ subroutine initializeInputArray(this)
call this%set_input(parName=C_PAR_INT_COV_STEP, valType='double', initFlag=.true.)
call this%set_input(parName=C_PAR_EARTH_RADIUS, valType='double', initFlag=.true.)
call this%set_input(parName=C_OPT_SOL_FORECAST, valType='double', initFlag=.true.)
call this%set_input(parName=C_OUTPUT_STEP, valType='double', initFlag=.true.) ! this should be double


! ON/OFF parameters (also set default values, if available)
do i = 1, this%derivatives_model%get_neptune_perturbation_number()
Expand Down
6 changes: 5 additions & 1 deletion src/rdinp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ subroutine rdinp( &
integer :: input_type_cov
integer :: b_left, b_right ! indices for version string parsing

real(dp) :: dch_inp ! input file channel
zurdala marked this conversation as resolved.
Show resolved Hide resolved
real(dp) :: dtemp ! temporary
real(dp) :: derr ! error flag

integer, dimension(100) :: distinctHarmonics

real(dp), dimension(3) :: dtmp3
Expand Down Expand Up @@ -671,7 +675,7 @@ subroutine rdinp( &

call nxtbuf('#', 0, ich_inp, cbuf)
read(cbuf,*) ctemp
ierr = neptune%setNeptuneVar("OUTPUT_STEP", ctemp)
derr = neptune%setNeptuneVar("OUTPUT_STEP", ctemp)
zurdala marked this conversation as resolved.
Show resolved Hide resolved

call nxtbuf('#', 0, ich_inp, cbuf)
read(cbuf,*) ctemp
Expand Down
2 changes: 1 addition & 1 deletion work/input/neptune.inp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
#
# Output time step (in seconds)
#
60
2.5
zurdala marked this conversation as resolved.
Show resolved Hide resolved
#
# Time step for ephemerides in internal array (available via 'getNeptuneData' API)
# (in seconds - IF not '0' then output time step (above) will be overwritten by this
Expand Down