Skip to content
Snippets Groups Projects
Commit 57a18ad5 authored by Georgiy Faikin's avatar Georgiy Faikin
Browse files

Add more algorithm to constructor, model SOCS and RothC

parent 64a87c48
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ module carbon_core
integer, parameter :: nflux_default = 20 !< макс число потоков
integer, parameter :: nmult_default = 10 !< макс число множителей в выражении для потока
integer, parameter :: narg_default = 1 !< макс число аргументов функций в множителях
integer, parameter :: npar_default = 5 !< макс число параметров функций в множителях
integer, parameter :: npar_default = 5!8 !< макс число параметров функций в множителях
! производные типы данных
! ---------------------------------------------------------------------------------
......
......@@ -43,6 +43,8 @@ contains
fun_kit%fun => fun_step
case('spline')
fun_kit%fun => fun_spline
! case('inter')
! fun_kit%fun => fun_inter
case default
stop "check failed : unknown funtype at set_fun"
end select
......@@ -70,6 +72,9 @@ contains
! pars(3) - k
! pars(4) - a
! pars(5) - amp
! pars(6) - c
! pars(7) - c1
! pars(8) - c2
!> Constant function: y = c
function fun_const(args, pars) result(y)
......@@ -126,7 +131,7 @@ contains
y = pars(5) * pars(4)**( pars(3) * (args(1) - pars(2)) ) + pars(1)
end function fun_exp
!> Spline function: y = (a+k)*x + (y0+c)/2 + (a-k)/2*|x-x0|
!> Spline (piecewise1) function: y = (a+k)*x + (y0+c)/2 + (a-k)/2*|x-x0|
function fun_spline(args, pars) result(y)
implicit none
real, intent(in) :: args(narg_default)
......@@ -135,5 +140,27 @@ contains
y = (pars(4)+pars(3))*args(1) + (pars(1)+pars(5))/2 + (pars(4)-pars(3))/2*abs(args(1)-pars(2))
end function fun_spline
! !> Inerpolation function: y = (k+amp)*x + b + (a-k)/2*|x-x0| + (amp-a)*|x-y0|
! function fun_inter(args, pars) result(y)
! implicit none
! real, intent(in) :: args(narg_default)
! real, intent(in) :: pars(npar_default)
! real :: y
! y = (pars(3)+pars(5))*args(1) + ___ + (pars(4)-pars(3))/2*abs(args(1)-pars(2)) + &
! & + (pars(5)-pars(4))/2*abs(args(1)-pars(1))
! end function fun_inter
! args(1) - x
! pars(1) - y0
! pars(2) - x0
! pars(3) - k
! pars(4) - a
! pars(5) - amp
! pars(6) - c
! pars(7) - c1
! pars(8) - c2
end module
......@@ -61,7 +61,11 @@ module carbon_model_rothc
! to atmosphere
call set_flux(fid = n_F, pid_out = n_CDPM, pid_in = n_Catm, name = 'RDPM')
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(1))
......@@ -74,21 +78,33 @@ module carbon_model_rothc
call set_flux(fid = n_F, pid_out = n_CRPM, pid_in = n_Catm, name = 'RRPM')
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(2))
call set_mult(n_F, 'lin', x_ijn = CRPM)
call set_flux(fid = n_F, pid_out = n_CBIO, pid_in = n_Catm, name = 'RBIO')
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(3))
call set_mult(n_F, 'lin', x_ijn = CBIO)
call set_flux(fid = n_F, pid_out = n_CHUM, pid_in = n_Catm, name = 'RHUM')
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(4))
......@@ -97,7 +113,11 @@ module carbon_model_rothc
! atmosphere fall
call set_flux(fid = n_F, pid_out = n_Catm, pid_in = n_CBIO, name = 'BIO_prop*RDPM')
call set_mult(n_F, 'lin', x_ij = BIO_prop)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(1))
......@@ -105,7 +125,11 @@ module carbon_model_rothc
call set_flux(fid = n_F, pid_out = n_Catm, pid_in = n_CBIO, name = 'BIO_prop*RRPM')
call set_mult(n_F, 'lin', x_ij = BIO_prop)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(2))
......@@ -113,7 +137,11 @@ module carbon_model_rothc
call set_flux(fid = n_F, pid_out = n_Catm, pid_in = n_CBIO, name = 'BIO_prop*RBIO')
call set_mult(n_F, 'lin', x_ij = BIO_prop)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(3))
......@@ -121,7 +149,11 @@ module carbon_model_rothc
call set_flux(fid = n_F, pid_out = n_Catm, pid_in = n_CBIO, name = 'BIO_prop*RHUM')
call set_mult(n_F, 'lin', x_ij = BIO_prop)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(4))
......@@ -130,7 +162,11 @@ module carbon_model_rothc
call set_flux(fid = n_F, pid_out = n_Catm, pid_in = n_CHUM, name = 'HUM_prop*RDPM')
call set_mult(n_F, 'lin', x_ij = HUM_prop)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(1))
......@@ -138,7 +174,11 @@ module carbon_model_rothc
call set_flux(fid = n_F, pid_out = n_Catm, pid_in = n_CHUM, name = 'HUM_prop*RRPM')
call set_mult(n_F, 'lin', x_ij = HUM_prop)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(2))
......@@ -146,7 +186,11 @@ module carbon_model_rothc
call set_flux(fid = n_F, pid_out = n_Catm, pid_in = n_CHUM, name = 'HUM_prop*RBIO')
call set_mult(n_F, 'lin', x_ij = HUM_prop)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(3))
......@@ -154,7 +198,11 @@ module carbon_model_rothc
call set_flux(fid = n_F, pid_out = n_Catm, pid_in = n_CHUM, name = 'HUM_prop*RHUM')
call set_mult(n_F, 'lin', x_ij = HUM_prop)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = ks(4))
......
......@@ -25,8 +25,8 @@ module carbon_model_socs
call set_pool(pid = n_Catm, name = 'catm')
call set_pool(pid = n_Cveg, name = 'cveg')
call set_pool(pid = n_Csoil1, name = 'csoil1',initial_value = 0.060888, alias = C1)
call set_pool(pid = n_Csoil2, name = 'csoil2',initial_value = 2.983512, alias = C2)
call set_pool(pid = n_Csoil1, name = 'csoil1',initial_value = 0.178176, alias = C1)
call set_pool(pid = n_Csoil2, name = 'csoil2',initial_value = 8.730624, alias = C2)
! station: opt: С1: С2:
! DAO4 1 0.061994 3.037706
......@@ -52,12 +52,26 @@ module carbon_model_socs
call set_flux(fid = n_F, pid_out = n_Csoil1, pid_in = n_Csoil2, name = 'mineralization')
call set_mult(n_F, 'lin', x_ijn = C2, k = -1./Cm, y0 = 1.)
call set_mult(n_F, 'const', c = rare)
call set_mult(n_F, 'lin', x = kirk)
call set_mult(n_F, 'lin', x_ijn = C1)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
! piecewise of Fs
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = 7.5/yrs)
call set_flux(fid = n_F, pid_out = n_Csoil1, pid_in = n_Catm, name = 'microbal_respiration')
call set_mult(n_F, 'lin', x_ijn = C1, k = (1. - rare))
call set_mult(n_F, 'lin', x = kirk)
! piecewise of Ft
call set_mult(n_F, 'lin', x = Ft)
call set_mult(n_F, 'step', x_ij = Tsoil(:,:,1), x0 = -5., k = 1.0)
! piecewise of Fs
call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', x = 7.5/yrs)
end subroutine carbon_model_assembly
......
......@@ -83,20 +83,19 @@ contains
Fs = 0.2
end if
if (Tsoil(ii,jj,1) >= -18.27) then
! if (Tsoil(ii,jj,1) >= -18.27) then
! Ft = 47.91/(1. + exp(106.06/(Tsoil(ii,jj,1) + 18.27)))
! else
! Ft = 0
! end if
Ft = 47.91/(1. + exp(106.06/(Tsoil(ii,jj,1) + 18.27)))
else
Ft = 0
end if
!kirk = 7.5/yrs
kirk = Ft*Fs*7.5/yrs !7.5
!print*, kirk
!call set_mult(n_F, 'spline', x_ij = Wsoil - smin, a = 0.8/(s0-smin), k = 0., y0 = 0.2, amp = 0.2, x0 = smin)
end subroutine
subroutine carbon_model_postprocessing()
use grid, only : date_c
......
......@@ -12,7 +12,7 @@
! -----------------------------------------------------------------
!> Углеродная модель:
carbon_model_type = 'rothc'
carbon_model_type = 'socs'
!
! 'inmcm' - модель inmc [1,2]
! 'socs' - модель SOCS [3]
......@@ -41,7 +41,7 @@
! 'Rostov' - Станция ФАНЦ
!
!> Тип подачи удобрения:
station_opt = '2'
station_opt = '3'
! '1' - контрольный случай, без дополнительных удобрений
! '2' - 2 способ подачи удобрений
! '3' - 3 способ подачи удобрений
......@@ -104,7 +104,7 @@
!
! 'auto' - получить из входного файла (для lsm_offline)
! 'manual' - задать вручную [yyyy-mm-dd hh:mm:ss]
datetime_init = '1956-01-01 00:00:00'
datetime_init = '1975-01-01 00:00:00'
!> Продолжительность расчета:
ntime_mode = 'datetime_last'
!
......@@ -133,7 +133,7 @@
testing_log_mode = 'read' ! none, write, read
nv_singlecolumn = 1 ! Для модели INMCM нужно поставить 12, для rothc и SOCS 1
nv_singlecolumn = 1 ! Для модели INMCM нужно поставить 12, для RothC и SOCS 1
environment_model_type = 'inmcm' ! inmcm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment