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

Automation for date selection

parent b85b1027
No related branches found
No related tags found
No related merge requests found
......@@ -72,8 +72,6 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = ks(1))
call set_mult(n_F, 'lin', x_ijn = CDPM)
......@@ -89,7 +87,6 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = ks(2))
call set_mult(n_F, 'lin', x_ijn = CRPM)
......@@ -105,7 +102,6 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = ks(3))
call set_mult(n_F, 'lin', x_ijn = CBIO)
......@@ -121,13 +117,11 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = ks(4))
call set_mult(n_F, 'lin', x_ijn = CHUM)
! 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)
......@@ -141,13 +135,11 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = ks(1))
call set_mult(n_F, 'lin', x_ijn = CDPM)
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)
......@@ -160,13 +152,11 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
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_Catm, pid_in = n_CBIO, name = 'BIO_prop*RBIO')
call set_mult(n_F, 'lin', x_ij = BIO_prop)
......@@ -179,13 +169,11 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
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_Catm, pid_in = n_CBIO, name = 'BIO_prop*RHUM')
call set_mult(n_F, 'lin', x_ij = BIO_prop)
......@@ -198,7 +186,6 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = ks(4))
call set_mult(n_F, 'lin', x_ijn = CHUM)
......@@ -216,13 +203,11 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = ks(1))
call set_mult(n_F, 'lin', x_ijn = CDPM)
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)
......@@ -235,13 +220,11 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
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_Catm, pid_in = n_CHUM, name = 'HUM_prop*RBIO')
call set_mult(n_F, 'lin', x_ij = HUM_prop)
......@@ -254,13 +237,11 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
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_Catm, pid_in = n_CHUM, name = 'HUM_prop*RHUM')
call set_mult(n_F, 'lin', x_ij = HUM_prop)
......@@ -273,7 +254,6 @@ module carbon_model_rothc
& a_ij = 0.8/(s0(:,:,1) - smin(:,:,1)), amp = -0.8, c01 = 0.2, &
& c02_ij = 0.2 - 0.8*smin(:,:,1)/(s0(:,:,1) - smin(:,:,1)), c_ij = 1 + 0.8*s0(:,:,1))
!call set_mult(n_F, 'lin', x = Fs)
call set_mult(n_F, 'lin', y0 = 0.6, k = -0.4, x_ij = veg, x0 = 1.)
call set_mult(n_F, 'lin', x = ks(4))
call set_mult(n_F, 'lin', x_ijn = CHUM)
......
......@@ -83,8 +83,8 @@ contains
allocate(BIO_prop(i0:i1,j0:j1))
allocate(HUM_prop(i0:i1,j0:j1))
! init of TPMD
!! расчёт через осадки и эвотранспирацию
! init of TPMD
! allocate(TSMD(i0:i1,j0:j1))
! allocate(SMD(i0:i1,j0:j1))
! allocate(bSMD(i0:i1,j0:j1))
......@@ -158,17 +158,6 @@ contains
! main part of rothc_calc_at_cell
! if (Wsoil(ii,jj,1) >= s0(ii,jj,1)) then
! Fs = 1. - 0.8*(Wsoil(ii,jj,1) - s0(ii,jj,1))
! cas = 3.
! else if (smin(ii,jj,1) < Wsoil(ii,jj,1) .and. Wsoil(ii,jj,1) < s0(ii,jj,1)) then
! Fs = 0.2 + 0.8*(Wsoil(ii,jj,1) - smin(ii,jj,1))/(s0(ii,jj,1) - smin(ii,jj,1))
! cas = 2.
! else if (Wsoil(ii,jj,1) <= smin(ii,jj,1)) then
! Fs = 0.2
! cas = 1.
! end if
Ft = 47.91/(1. + exp(106.06/(Tsoil(ii,jj,1) + 18.27)))
! ---- Initialization ------
......
......@@ -6,6 +6,7 @@ module config
public
private :: config_check
! конфигурация
character(len_default) :: carbon_model_type
......@@ -13,9 +14,9 @@ module config
character(len_default) :: environment_data_type
character(len_default) :: lsm_datafile
character(len_default) :: lsm_dataformat
character(len_default) :: station_name
character(len_default) :: station_opt
! пространственная сетка
character(len_default) :: spatial_grid_mode
real :: spatial_grid_res(2)
......@@ -24,6 +25,7 @@ module config
integer :: ich
real :: point(2)
real :: polygon(4)
! продолжительность расчета
character(len_default) :: dt_mode
integer :: dt
......@@ -33,6 +35,7 @@ module config
integer :: ntime
character(len_default) :: datetime_last
integer :: UTC = 0
! продвинутые настройки
logical :: if_datafile_read_at_first
logical :: if_out_yearly
......@@ -42,7 +45,17 @@ module config
integer :: nv_singlecolumn
character(len_default) :: environment_model_type
! Данные для станций наблюдения за климатом
character(len_default) :: datetime_init_1
character(len_default) :: datetime_last_1
character(len_default) :: datetime_init_2
character(len_default) :: datetime_last_2
character(len_default) :: datetime_init_3
character(len_default) :: datetime_last_3
character(len_default) :: datetime_init_4
character(len_default) :: datetime_last_4
character(len_default) :: datetime_init_5
character(len_default) :: datetime_last_5
namelist /config_namelist/ &
& carbon_model_type, &
......@@ -74,6 +87,19 @@ module config
& nv_singlecolumn, &
& environment_model_type
namelist /station_config_namelist/ &
& datetime_init_1, &
& datetime_last_1, &
& datetime_init_2, &
& datetime_last_2, &
& datetime_init_3, &
& datetime_last_3, &
& datetime_init_4, &
& datetime_last_4, &
& datetime_init_5, &
& datetime_last_5
type namespace_type
character(len_default) :: lon
character(len_default) :: lat
......@@ -106,6 +132,10 @@ module config
read(1, nml=config_namelist)
close(1)
open(1, file='station_config.nml', status='old')
read(1, nml=station_config_namelist)
close(1)
call config_check()
select case (lsm_dataformat)
......@@ -167,8 +197,6 @@ module config
stop "check failed : unknown station_opt"
end select
select case(lsm_dataformat)
case('inmcm')
case('era5')
......
......@@ -4,7 +4,7 @@ module grid
! интерфейс
! ---------------------------------------------------------------------------------
use const, only : miss_v, pi, r_earth, deg2rad, day2sec
use const, only : miss_v, pi, r_earth, deg2rad, day2sec, len_default
use datetime, only : date_type
use netcdf
use netcdf_kit, only : nc_errhand
......@@ -52,6 +52,8 @@ module grid
integer :: nt_nc
integer :: dt_nc
real(8) :: jday0_nc
character(len_default) :: DL
character(len_default) :: DI
type(date_type) :: date_c, date_fst, date_lst
integer :: last_date, first_date
......@@ -371,7 +373,18 @@ contains
& ntime_mode, &
& ntime_user => ntime, &
& timestamp_lst => datetime_last, &
& UTC_user => UTC
& UTC_user => UTC, &
& datetime_init_1, &
& datetime_last_1, &
& datetime_init_2, &
& datetime_last_2, &
& datetime_init_3, &
& datetime_last_3, &
& datetime_init_4, &
& datetime_last_4, &
& datetime_init_5, &
& datetime_last_5, &
& station_name
integer :: ncid, dimid, varid
real(8), allocatable :: work1r8(:)
......@@ -392,6 +405,25 @@ contains
call nc_errhand( nf90_close(ncid) )
case('station')
select case(station_name)
case('DAO4')
DI = datetime_init_1
DL = datetime_last_1
case('DAO3')
DI = datetime_init_2
DL = datetime_last_2
case('TRGK')
DI = datetime_init_3
DL = datetime_last_3
case('VLDR')
DI = datetime_init_4
DL = datetime_last_4
case('Rostov')
DI = datetime_init_5
DL = datetime_last_5
end select
case default
nt_nc = miss_v
dt_nc = miss_v
......@@ -414,15 +446,31 @@ contains
select case(datetime_init_mode)
case('auto')
select case(environment_data_type) !!!
case('lsm_offline') !!!
call date_fst%init(jday = jday0_nc, UTC = UTC_user)
case('station') !!!
call date_fst%init(timestamp = DI, UTC = UTC_user) !!!
case default !!!
stop "check failed : this option can not work with these settings" !!!
end select !!!
case('manual')
call date_fst%init(timestamp = timestamp_fst, UTC = UTC_user)
end select
select case(ntime_mode)
case('auto')
select case(environment_data_type) !!!
case('lsm_offline') !!!
ntime = nt_nc
call date_lst%init(jday = date_fst%jday + ntime*dble(dt)/day2sec)
case('station') !!!
call date_lst%init(timestamp = DL, UTC = UTC_user) !!!
ntime = nint((date_lst%jday - date_fst%jday) * day2sec/dt) !!!
case default !!!
stop "check failed : this option can not work with these settings" !!!
end select !!!
case('ntime')
ntime = ntime_user
call date_lst%init(jday = date_fst%jday + ntime*dble(dt)/day2sec)
......
......@@ -23,3 +23,5 @@
!> station_name = 'Rostov':
datetime_init_5 = '1975-01-01 00:00:00'
datetime_last_5 = '2018-01-01 00:00:00'
/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment