Commit 571c0095 authored by Ralf Greve's avatar Ralf Greve
Browse files

Parameter YEAR_SEC in run-specs headers now optional.

If undefined, the default value 1 a = 31556925.445 s
(IUPAC-IUGS year for epoch 2000.0) is used.
Value stored in global variable year2sec (previously a parameter).
New global variable sec2year = 1/year2sec introduced.
parent 3cc42056
......@@ -5,7 +5,7 @@
!
#define MODEL_SICOPOLIS
#define VERSION '5-dev'
#define DATE '2022-05-30'
#define DATE '2022-06-06'
!
!> @mainpage
!!
......
......@@ -90,7 +90,7 @@ integer(i4b) :: ios
real(dp), dimension(0:JMAX,0:IMAX) :: z_sl_old
real(dp) :: z_sl_old_mean
real(dp) :: z_sl_min, t1, t2, t3, t4, t5, t6
real(dp) :: sec2year, time_in_years
real(dp) :: time_in_years
real(dp) :: rho_inv
real(dp) :: time_gr, time_kl
real(dp) :: z_sle_present, z_sle_help
......@@ -169,7 +169,6 @@ integer(i4b) :: i_time_in_years
real(dp) :: temp_val
#endif /* OpenAD */
sec2year = 1.0_dp/year2sec
time_in_years = time*sec2year
n_year_CE = floor((time_in_years+YEAR_ZERO)+eps_sp_dp)
......
......@@ -265,6 +265,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -207,6 +207,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -200,6 +200,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -62,7 +62,7 @@ real(dp), intent(in) :: dzeta_c, dzeta_r
integer(i4b) :: i, j
integer(i4b) :: n_year_CE
integer(i4b) :: n_ocean, n_float
real(dp) :: sec2year, time_in_years
real(dp) :: time_in_years
real(dp) :: rhow_rho_ratio
real(dp) :: aqbm1, aqbm2, aqbm3a, aqbm3b, aqbm4
real(dp) :: z_abyssal
......@@ -73,7 +73,6 @@ real(dp) :: H_w_now, Q_bm_scaling_factor
!-------- Term abbreviations --------
sec2year = 1.0_dp/year2sec
time_in_years = time*sec2year
n_year_CE = floor((time_in_years+YEAR_ZERO)+eps_sp_dp)
......@@ -300,7 +299,7 @@ do j=1, JMAX-1
#elif (FLOATING_ICE_BASAL_MELTING==4 || FLOATING_ICE_BASAL_MELTING==5)
if ( zl(j,i) > z_abyssal ) then ! floating ice over continental shelf
call sub_ice_shelf_melting_param_1(time, sec2year, time_in_years, &
call sub_ice_shelf_melting_param_1(time, time_in_years, &
rhow_rho_ratio, &
i, j, Q_bm_floating)
Q_bm(j,i) = Q_bm_floating
......@@ -333,7 +332,7 @@ end do
#if (FLOATING_ICE_BASAL_MELTING==6)
call sub_ice_shelf_melting_param_2(time, sec2year, time_in_years, &
call sub_ice_shelf_melting_param_2(time, time_in_years, &
rhow_rho_ratio, z_abyssal, &
n_year_CE)
......@@ -412,7 +411,7 @@ end subroutine calc_qbm
!-------------------------------------------------------------------------------
!> Local sub-ice-shelf melting parameterization.
!<------------------------------------------------------------------------------
subroutine sub_ice_shelf_melting_param_1(time, sec2year, time_in_years, &
subroutine sub_ice_shelf_melting_param_1(time, time_in_years, &
rhow_rho_ratio, &
i, j, Q_bm_floating)
......@@ -428,7 +427,7 @@ integer(i4b), intent(in) :: i, j
integer(i4b), intent(inout) :: i, j
#endif /* Normal vs. OpenAD */
real(dp), intent(in) :: time
real(dp), intent(in) :: sec2year, time_in_years
real(dp), intent(in) :: time_in_years
real(dp), intent(in) :: rhow_rho_ratio
real(dp), intent(out) :: Q_bm_floating
......@@ -665,7 +664,7 @@ end subroutine sub_ice_shelf_melting_param_1
!-------------------------------------------------------------------------------
!> Non-local sub-ice-shelf melting parameterization by ISMIP6.
!<------------------------------------------------------------------------------
subroutine sub_ice_shelf_melting_param_2(time, sec2year, time_in_years, &
subroutine sub_ice_shelf_melting_param_2(time, time_in_years, &
rhow_rho_ratio, z_abyssal, &
n_year_CE)
......@@ -683,7 +682,7 @@ subroutine sub_ice_shelf_melting_param_2(time, sec2year, time_in_years, &
implicit none
real(dp) , intent(in) :: time
real(dp) , intent(in) :: sec2year, time_in_years
real(dp) , intent(in) :: time_in_years
real(dp) , intent(in) :: rhow_rho_ratio, z_abyssal
integer(i4b), intent(in) :: n_year_CE
......
......@@ -42,8 +42,6 @@ module output_m
implicit none
real(dp), parameter :: sec2year = 1.0_dp/year2sec
private
public :: output1, output2, output4, borehole
#if (defined(ASF))
......
......@@ -748,7 +748,10 @@ save
!-------- Further quantities --------
!> year2sec: 1 year (1 a) in seconds
real(dp), parameter :: year2sec = YEAR_SEC
real(dp) :: year2sec
!> sec2year: 1 second in years
real(dp) :: sec2year
!> year_zero: SICOPOLIS year zero in astronomical year numbering
!> [ = signed year CE (AD) ]
......
......@@ -94,7 +94,7 @@ integer(i4b) :: ios
real(dp), dimension(0:JMAX,0:IMAX) :: z_sl_old
real(dp) :: z_sl_old_mean
real(dp) :: z_sl_min, t1, t2, t3, t4, t5, t6
real(dp) :: sec2year, time_in_years
real(dp) :: time_in_years
real(dp) :: rho_inv
real(dp) :: time_gr, time_kl
real(dp) :: z_sle_present, z_sle_help
......@@ -170,7 +170,6 @@ integer(i4b) :: i_time_in_years
real(dp) :: temp_val
#endif /* OpenAD */
sec2year = 1.0_dp/year2sec
time_in_years = time*sec2year
n_year_CE = floor((time_in_years+YEAR_ZERO)+eps_sp_dp)
......
......@@ -259,6 +259,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -203,6 +203,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -202,6 +202,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10, RHO_I, RHO_C, KAPPA_C, C_C)
......
......@@ -203,6 +203,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -202,6 +202,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10, RHO_I, RHO_C, KAPPA_C, C_C)
......
......@@ -203,6 +203,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -200,6 +200,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -213,6 +213,16 @@ time_output = 0.0_dp
!-------- Read physical parameters --------
#if (defined(YEAR_SEC))
year2sec = YEAR_SEC
#else
year2sec = 3.1556925445e+07_dp
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
#endif
sec2year = 1.0_dp/year2sec
call read_phys_para()
call ice_mat_eqs_pars(RF, R_T, KAPPA, C, -190, 10)
......
......@@ -9,7 +9,7 @@
!!
!! @section Date
!!
!! 2022-05-20
!! 2022-06-06
!!
!! @section Copyright
!!
......@@ -552,7 +552,9 @@ ierr1 = nf90_inq_varid(ncid, 'year2sec', ncv)
if (ierr1 == nf90_noerr) then
call check( nf90_get_var(ncid, ncv, year2sec_erg) )
else
year2sec_erg = 31556926.0_dp ! default value
year2sec_erg = 3.1556925445e+07_dp ! default value
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
end if
call check( nf90_inq_varid(ncid, 'time', ncv) )
......@@ -702,7 +704,9 @@ ierr1 = nf90_inq_varid(ncid, 'year2sec', ncv)
if (ierr1 == nf90_noerr) then
call check( nf90_get_var(ncid, ncv, year2sec_erg) )
else
year2sec_erg = 31556926.0_dp ! default value
year2sec_erg = 3.1556925445e+07_dp ! default value
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
end if
call check( nf90_inq_varid(ncid, 't', ncv) )
......
......@@ -9,7 +9,7 @@
!!
!! @section Date
!!
!! 2022-05-20
!! 2022-06-06
!!
!! @section Copyright
!!
......@@ -359,7 +359,9 @@ call check( nf90_get_att(ncid, ncv, 'false_northing', mapping_false_N_erg) )
if ( nf90_inq_varid(ncid, 'year2sec', ncv) == nf90_noerr ) then
call check( nf90_get_var(ncid, ncv, year2sec_erg) )
else
year2sec_erg = 0.0_dp
year2sec_erg = 3.1556925445e+07_dp ! default value
! IUPAC-IUGS year for epoch 2000.0
! (Holden et al., 2011, PAC, doi:10.1351/PAC-REC-09-01-22)
end if
call check( nf90_inq_varid(ncid, 'time', ncv) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment