created by: MPZinke
C++ translated version of solid.f by Dennis Milbert
As the Earth rotates the sun & moon pull on the tides and the crust. The force from these pulls and changes in ocean changes the shape of the Earth. solid.f
by Dennis Milbert calculates the change in meters of the planet. However, because it is Fortran code, maintaining it is becoming increasingly difficult, as it is an older language. This program's aim is to allow for maintainability and object oriented practices (for code modification). Additionally, variable names are (hopefully) more spelled out, to allow for convenience in understanding what is going on. For parts of the code that I am able to find resources for, but are not well commented, I have added additional comments & resources.
./Headers/
—Contains header files for C++ translated code../SolidFortranProject/
—Contains Fortran code & documentation by original author../Source
—Contains source files for C++ translated code../.gitignore
—Git Ignore file so that I don't upload a bunch of junk (you're welcome)../README.md
—This file../Makefile
—Makefile to compile all C++ code.
make
./SolidEarthFlexing
Or with input file
./SolidEarthFlexing < input.txt
git checkout Testing
make test
./Testing/SolidEarthFlexing < ./Testing/TestInput.txt
Type conversion is an important consideration when translating between these two languages, because some precision is intentionally lost in the Fortran program. To account for this, the rules of both languages are detailed below.
Fortran (mixed mode) automatically promotes a value to a type of the operand with the higher rank. EG. int
* double
is equivalent to double
* double
.
This is supported by this reference.
Double precision operators apply to only double precision operands, and any operand of lower precision is promoted to double precision.
C++ promotes based on
MAIN
| *datan
| geoxyz
| | *dsin
| | *dcos
| | *dsqrt
| | *dcos
| | *dsin
| civmjd
| mjdciv
| setjd0
| sunxyz
| | *dsin
| | *dcos
| | utc2ttt
| | | utc2tai
| | | | getutcmtai
| | | tai2tt
| | *dcos
| | *dcos
| | *dsin
| | *dsin
| | *dsin
| | *dcos
| | getghar
| | rot3
| | | *dsin
| | | *dcos
| moonxyz
| | utc2ttt
| | | utc2tai
| | | | getutcmtai
| | | tai2tt
| | *dsin
| | *dcos
| | *dsin
| | *dcos
| | rot1
| | | *dsin
| | | *dcos
| | getghar
| | rot3
| | | *dsin
| | | *dcos
| detide
| | utc2ttt
| | | utc2tai
| | | | getutcmtai
| | | tai2tt
| | *int
| | sprod
| | sprod
| | zero_vec8
| | st1idiu
| | | enorm8
| | | enorm8
| | | enorm8
| | st1isem
| | | enorm8
| | | enorm8
| | | enorm8
| | st1l1
| | | enorm8
| | | enorm8
| | | enorm8
| | step2diu
| | | *dmod
| | | *dmod
| | | *dmod
| | | *dmod
| | | *dmod
| | | *dmod
| | | *sin
| | | *cos
| | | *sin
| | | *cos
| | | *cos
| | | *sin
| | step2lon
| | | *dmod
| | | *dmod
| | | *dmod
| | | *dmod
| | | *dmod
| | | *cos
| | | *sin
| | | *cos
| | | *sin
| rge
| | *dsin
| | *dcos
| | *dsin
| | *dcos
| mjdciv
| *idnint
detide
[Subroutine]- Params:
xsta
,mjd
,fmjd
,xsun
,xmon
,dxtide
,lflag
- Altered Params:
lflag
,dxtide
- Params:
st1l1
[Subroutine]- Params:
xsta
,xsun
,xmon
,fac2sun
,fac2mon
,xcorsta
- Altered Params:
xcorsta
- Params:
step2diu
[Subroutine]- Params:
xsta
,fhr
,t
,xcorsta
- Altered Params:
xcorsta
- Params:
step2lon
[Subroutine]- Params:
xsta
,fhr
,t
,xcorsta
- Altered Params:
xcorsta
- Params:
st1idiu
[Subroutine]- Params:
xsta
,xsun
,xmon
,fac2sun
,fac2mon
,xcorsta
- Altered Params:
xcorsta
- Params:
st1isem
[Subroutine]- Params:
xsta
,xsun
,xmon
,fac2sun
,fac2mon
,xcorsta
- Altered Params:
xcorsta
- Params:
sprod
[Subroutine]- Params:
x
,y
,scal
,r1
,r2
- Altered Params:
r1
,r2
,scal
- Params:
enorm8
[Function]- Params:
a
- Params:
zero_vec8
[Subroutine]- Params:
v
- Altered Params:
v
- Params:
moonxyz
[Subroutine]- Params:
mjd
,fmjd
,rm
,lflag
- Altered Params:
lflag
- Params:
getghar
[Subroutine]- Params:
mjd
,fmjd
,ghar
- Altered Params:
ghar
- Params:
sunxyz
[Subroutine]- Params:
mjd
,fmjd
,rs
,lflag
- Altered Params:
lflag
- Params:
lhsaaz
[Subroutine]- Params:
u
,v
,w
,ra
,az
,va
- Altered Params:
ra
,az
,va
- Params:
geoxyz
[Subroutine]- Params:
gla
,glo
,eht
,x
,y
,z
- Altered Params:
x
,y
,z
- Params:
rge
[Subroutine]- Params:
gla
,glo
,u
,v
,w
,x
,y
,z
- Altered Params:
u
,v
,w
- Params:
rot1
[Subroutine]- Params:
theta
,x
,y
,z
,u
,v
,w
- Altered Params:
u
,v
,w
- Params:
rot3
[Subroutine]- Params:
theta
,x
,y
,z
,u
,v
,w
- Altered Params:
u
,v
,w
- Params:
setjd0
[Subroutine]- Params:
iyr
,imo
,idy
- Altered Params:
- Params:
civjts
[Subroutine]- Params:
iyr
,imo
,idy
,ihr
,imn
,sec
,tsec
- Altered Params:
tsec
- Params:
jtsciv
[Subroutine]- Params:
tsec
,iyr
,imo
,idy
,ihr
,imn
,sec
- Altered Params:
idy
,imo
,iyr
,ihr
,imn
,sec
- Params:
civmjd
[Subroutine]- Params:
iyr
,imo
,idy
,ihr
,imn
,sec
,mjd
,fmjd
- Altered Params:
mjd
,fmjd
- Params:
mjdciv
[Subroutine]- Params:
mjd
,fmjd
,iyr
,imo
,idy
,ihr
,imn
,sec
- Altered Params:
idy
,imo
,iyr
,ihr
,imn
,sec
- Params:
utc2ttt
[Function]- Params:
tutc
- Params:
gps2ttt
[Function]- Params:
tgps
- Params:
utc2tai
[Function]- Params:
tutc
- Params:
getutcmtai
[Function]- Params:
tsec
- Params:
tai2tt
[Function]- Params:
ttai
- Params:
gps2tai
[Function]- Params:
tgps
- Params: