From 9f85ac98028c53ae8407a909cff0114533765015 Mon Sep 17 00:00:00 2001 From: Carlisle April Wishard Date: Thu, 3 Mar 2022 16:58:11 -0500 Subject: [PATCH] Added j2 and j4 terms to NetCDF --- src/modules/swiftest_globals.f90 | 2 ++ src/netcdf/netcdf.f90 | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/modules/swiftest_globals.f90 b/src/modules/swiftest_globals.f90 index c00990571..9d13600f2 100644 --- a/src/modules/swiftest_globals.f90 +++ b/src/modules/swiftest_globals.f90 @@ -201,5 +201,7 @@ module swiftest_globals character(*), parameter :: DISCARD_VHY_VARNAME = "discard_vhy" !! NetCDF name of the heliocentric velocity of the body at the time of discard y variable character(*), parameter :: DISCARD_VHZ_VARNAME = "discard_vhz" !! NetCDF name of the heliocentric velocity of the body at the time of discard z variable character(*), parameter :: DISCARD_BODY_ID_VARNAME = "discard_body_id" !! NetCDF name of the id of the other body involved in the discard + character(*), parameter :: J2RP2_VARNAME = "j2rp2" !! NetCDF name of the j2rp2 variable + character(*), parameter :: J4RP4_VARNAME = "j4rp4" !! NetCDF name of the j4pr4 variable end module swiftest_globals diff --git a/src/netcdf/netcdf.f90 b/src/netcdf/netcdf.f90 index 6c1e05e7a..f6b804fdb 100644 --- a/src/netcdf/netcdf.f90 +++ b/src/netcdf/netcdf.f90 @@ -965,6 +965,10 @@ module subroutine netcdf_write_frame_base(self, iu, param) call check( nf90_put_var(iu%ncid, iu%Gmass_varid, self%Gmass, start=[idslot, tslot]) ) if (param%lclose) call check( nf90_put_var(iu%ncid, iu%radius_varid, self%radius, start=[idslot, tslot]) ) + if (param%loblatecb) then + call check( nf90_put_var(iu%ncid, iu%j2rp2_varid, self%j2rp2, start=[idslot, tslot])) + call check( nf90_put_var(iu%ncid, iu%j4rp4_varid, self%j4rp4, start=[idslot, tslot])) + end if if (param%lrotation) then call check( nf90_put_var(iu%ncid, iu%Ip1_varid, self%Ip(1), start=[idslot, tslot]) ) call check( nf90_put_var(iu%ncid, iu%Ip2_varid, self%Ip(2), start=[idslot, tslot]) )