Skip to content
Snippets Groups Projects
Commit 0a74b9dd authored by Sumbel Shangareeva's avatar Sumbel Shangareeva
Browse files

parameters in separate file for optimization

parent 3fc168bc
Branches
No related tags found
No related merge requests found
...@@ -42,6 +42,7 @@ rm -f run.exe ...@@ -42,6 +42,7 @@ rm -f run.exe
gfortran $keys_compile -c source/const.f90 -o bin/const.o -Jbin gfortran $keys_compile -c source/const.f90 -o bin/const.o -Jbin
gfortran $keys_compile -c source/paths.f90 -o bin/paths.o -Jbin gfortran $keys_compile -c source/paths.f90 -o bin/paths.o -Jbin
gfortran $keys_compile -c source/parameters.f90 -o bin/parameters.o -Jbin
gfortran $keys_compile -c source/config.f90 -o bin/config.o -Jbin gfortran $keys_compile -c source/config.f90 -o bin/config.o -Jbin
gfortran $keys_compile -c source/netcdf_kit.f90 -o bin/netcdf_kit.o -Jbin gfortran $keys_compile -c source/netcdf_kit.f90 -o bin/netcdf_kit.o -Jbin
gfortran $keys_compile -c source/datetime.f90 -o bin/datetime.o -Jbin gfortran $keys_compile -c source/datetime.f90 -o bin/datetime.o -Jbin
...@@ -71,7 +72,7 @@ gfortran $keys_compile -c source/carbon/carbon_postprocessing.f90 -o bin/carbon_ ...@@ -71,7 +72,7 @@ gfortran $keys_compile -c source/carbon/carbon_postprocessing.f90 -o bin/carbon_
gfortran $keys_compile -c source/carbon/carbon.f90 -o bin/carbon.o -Jbin gfortran $keys_compile -c source/carbon/carbon.f90 -o bin/carbon.o -Jbin
gfortran $keys_compile -c source/main.f90 -o bin/main.o -Jbin gfortran $keys_compile -c source/main.f90 -o bin/main.o -Jbin
gfortran -o run.exe bin/*.o $keys_linking gfortran -o run.exe bin/*.o $keys_compile $keys_linking
if [ ! -e data/inmcm_ru-fyo_fluxnet_1998-2015_0.5h.nc ]; then if [ ! -e data/inmcm_ru-fyo_fluxnet_1998-2015_0.5h.nc ]; then
tar -xzf data/inmcm_ru-fyo_fluxnet_1998-2015_0.5h.tar.gz -C data/ tar -xzf data/inmcm_ru-fyo_fluxnet_1998-2015_0.5h.tar.gz -C data/
...@@ -81,6 +82,6 @@ if [ ! -e data/inmcm_05x05 ]; then ...@@ -81,6 +82,6 @@ if [ ! -e data/inmcm_05x05 ]; then
tar -xzf data/inmcm_05x05.tar.gz -C data/ tar -xzf data/inmcm_05x05.tar.gz -C data/
fi fi
doxygen ./docs/doxyfile &> /dev/null #doxygen ./docs/doxyfile &> /dev/null
exit 0 exit 0
&parameters_config_namelist
kd_in(1:6,1) = 0.03, 0.03, 0.0402, 0.08581933, 0.012, 0.07
kd_in(1:6,2) = 0.03, 0.03, 0.05067, 0.08581933, 0.007, 0.007
kd_in(1:6,3) = 0.035, 0.035, 0.04185, 0.08581933, 0.007, 0.007
kd_in(1:6,4) = 0.03, 0.03, 0.0, 0.0, 0.0, 0.0
/
module config module config
use const, only : len_default use const, only : len_default
use parameters, only: kd_in
implicit none implicit none
...@@ -144,6 +145,9 @@ module config ...@@ -144,6 +145,9 @@ module config
& C_s1_st_in, & & C_s1_st_in, &
& C_s2_st_in & C_s2_st_in
namelist /parameters_config_namelist/ &
& kd_in
type namespace_type type namespace_type
character(len_default) :: lon character(len_default) :: lon
character(len_default) :: lat character(len_default) :: lat
...@@ -186,6 +190,10 @@ module config ...@@ -186,6 +190,10 @@ module config
read(1, nml = carbon_pools_config_namelist) read(1, nml = carbon_pools_config_namelist)
close(1) close(1)
open(1, file = 'parameters_config.nml', status = 'old', action = 'read')
read(1, nml = parameters_config_namelist)
close(1)
select case (lsm_dataformat) select case (lsm_dataformat)
case('inmcm') case('inmcm')
nc_namespace%lon = 'lon' nc_namespace%lon = 'lon'
......
...@@ -7,6 +7,7 @@ module environment_data_station ...@@ -7,6 +7,7 @@ module environment_data_station
use grid, only: date_c, date_fst, date_lst, dt, i0, i1, j0, j1, ml, ms,dz use grid, only: date_c, date_fst, date_lst, dt, i0, i1, j0, j1, ml, ms,dz
use config, only: station_name, station_opt use config, only: station_name, station_opt
use const, only: yrs, nmonth, pi use const, only: yrs, nmonth, pi
use parameters, only: kd_in
! ---------------------------------------------- Variables ------------------------------------------------------------ ! ---------------------------------------------- Variables ------------------------------------------------------------
implicit none implicit none
...@@ -46,16 +47,6 @@ module environment_data_station ...@@ -46,16 +47,6 @@ module environment_data_station
real(kind = 16) :: sw_in (station_max) = (/0.120, 0.120, 0.120, 0.120, 0.120, 0.120/) !0.146 real(kind = 16) :: sw_in (station_max) = (/0.120, 0.120, 0.120, 0.120, 0.120, 0.120/) !0.146
real(kind = 16) :: bettar_in(station_max) = (/20., 26., 7., 8., 44., 21.86/) real(kind = 16) :: bettar_in(station_max) = (/20., 26., 7., 8., 44., 21.86/)
! ---- For SOCs ----
real :: kd_in (station_max,opt_max) !< Коэф. перехода углерода из C2 в C1, десорбация, разрушение агрегатов
! opt = 1 2 3 4
data kd_in(01,:) /0.03, 0.03, 0.035, 0.03/
data kd_in(02,:) /0.03, 0.03, 0.035, 0.03/ !0.08581933
data kd_in(03,:) /0.0402, 0.05067, 0.04185, 0./ !0.015, 0.008, 0.008, 0.
data kd_in(04,:) /0.08581933, 0.08581933, 0.08581933, 0./ !0.015, 0.008, 0.008, 0.
data kd_in(05,:) /0.012, 0.007, 0.007, 0./
data kd_in(06,:) /0.012, 0.007, 0.007, 0./
contains contains
! внешние процедуры ! внешние процедуры
......
module parameters
! интерфейс
! ---------------------------------------------------------------------------------
implicit none
public
private :: parameters_init
! переменные
! ---------------------------------------------------------------------------------
real :: kd_in(6, 4)
contains
! внешние процедуры
! ---------------------------------------------------------------------------------
subroutine carbon_parameters_init()
! ---------------------------------------
call parameters_init()
end subroutine
! внутренние процедуры
! ---------------------------------------------------------------------------------
subroutine parameters_init()
! ---------------------------------------
end subroutine
end module
import os
import f90nml as nml
import numpy as np
BASE_DIR = '../../'
parameters_nml_path = os.path.join(BASE_DIR, 'parameters_config.nml')
config_nml_path = os.path.join(BASE_DIR, 'ui1_config.nml')
params_nml = nml.read(parameters_nml_path)
config_nml = nml.read(config_nml_path)['config_namelist']
kd_in = np.array(params_nml['parameters_config_namelist']['kd_in'])
kd_in[0, 5] = 0.07
params_nml['parameters_config_namelist']['kd_in'] = kd_in.tolist()
params_nml.write(parameters_nml_path, force=True)
...@@ -123,8 +123,8 @@ ...@@ -123,8 +123,8 @@
Csoil_st_in(6,:) = 4.655 Csoil_st_in(6,:) = 4.655
Csoilb_st_in(6,:) = 0.095 Csoilb_st_in(6,:) = 0.095
! SOCS ! SOCS
C_s1_st_in(6,:) = 0.095 C_s1_st_in(6,:) = 0.
C_s2_st_in(6,:) = 4.655 C_s2_st_in(6,:) = 0.
! ----------------------------------------------------------------- ! -----------------------------------------------------------------
/ /
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
! 'calc' - расчёт согласно настройкам всё как обычно ! 'calc' - расчёт согласно настройкам всё как обычно
!> Углеродная модель: !> Углеродная модель:
carbon_model_type = 'inmcm' carbon_model_type = 'socs'
! !
! 'inmcm' - модель inmc [1,2] ! 'inmcm' - модель inmc [1,2]
! 'socs' - модель SOCS [3] ! 'socs' - модель SOCS [3]
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
testing_log_mode = 'read' ! none, write, read testing_log_mode = 'read' ! none, write, read
nv_singlecolumn = 12 ! Для модели INMCM нужно поставить 12, для RothC и SOCS 1 nv_singlecolumn = 1 ! Для модели INMCM нужно поставить 12, для RothC и SOCS 1
environment_model_type = 'inmcm' ! inmcm 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