Skip to content
Snippets Groups Projects
Commit 434c6201 authored by Victor Stepanenko's avatar Victor Stepanenko
Browse files

End of forcing file does not stop calculations if PBLpar = 0 now

parent 3c513391
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -310,7 +310,7 @@ give significant speedup \\
\hline
\emph{varalb} & Water albedo: 0 - constant, 1 - zenith-angle dependent \\
\hline
\emph{PBLpar} & Surface fluxes scheme: -1 - sensible, latent heat and momentum fluxes are given as input for the model; 0 - the latent heat flux is set to zero, while sensible heat and momentum fluxes are constant in time, specified by sensflux0 and momflux0; 1 - Businger-Dayer formulas (Monin-Obukhov theory) for exchange coefficients, the code from INM RAS climate model; 2 - formulation from NH3d (Louis, 1979); 3 - formulation from FLake;
\emph{PBLpar} & Surface fluxes scheme: -1 - sensible, latent heat and momentum fluxes are given as input for the model; 0 - the latent heat flux is set to zero, while sensible heat and momentum fluxes are constant in time, specified by \emph{sensflux0} and \emph{momflux0}; 1 - Businger-Dayer formulas (Monin-Obukhov theory) for exchange coefficients, the code from INM RAS climate model; 2 - formulation from NH3d (Louis, 1979); 3 - formulation from FLake;
4 - formulation implemented by D.Chechin \\
\hline
\emph{waveenh} & The shallow water correction of surface fluxes (Panin et al., 1996) (0 - off, 1 - on) \\
......@@ -354,7 +354,7 @@ give significant speedup \\
\hline
\emph{salsoil} & Switch for salinity transport in soil: 0 - off (zero flux at the bottom), 1 - on \\
\hline
\emph{dyn\_pgrad} & Dynamic pressure gradient: 0 - off, 1 - on \\
\emph{dyn\_pgrad} & Dynamic pressure gradient: 0 - off, 1 - barotropic pressure gradient, 2 - two-layer approximation for pressure gradient, 3 - multilayer model for pressure gradient \\
\hline
\emph{zero\_model} & Switch for zero-dimensional model: 0 -off, 1 - on \\
\hline
......
......@@ -168,6 +168,7 @@
logical :: multi_lake_single_forcing
logical :: output_laststep = .true.
logical :: vartrib_inflow
logical :: dataread
real(kind=ireals) :: hour0
real(kind=ireals) :: tinteg
......@@ -575,7 +576,7 @@
& N_SensFlux, N_LatentFlux, N_Ustar, N_surfrad, N_cloud, dataname, &
& ta,qa,pa,ua,va,atm_rad,solar_rad, precip, &
& SensFlux,LatentFlux,Ustar, surfrad, cloud, &
& outpath,spinup_done,npoints)
& outpath,spinup_done,npoints,dataread)
elseif (forc_format == 1) then ! Reading input file in netcdf format
#ifdef netcdf_lib
......@@ -698,7 +699,7 @@
& ts(ix),SensFlux(ix),LatentFlux(ix), exch_coef(ix), surfrad(ix), &
& cloud(ix), ftot(ix), h_2d(ix,iy), &
& ix,iy,nx,ny,ndatamax,year,month,day,hour,init_T,flag_assim,flag_print, &
& outpath, spinup_done)
& outpath, spinup_done, dataread)
enddo iycyc
......@@ -935,7 +936,7 @@
& dataname, &
& ta, qa, pa, ua, va, atm_rad, solar_rad, precip, &
& SensFlux, LatentFlux, Ustar, surfrad, cloud, &
& outpath,spinup_done,npoints)
& outpath,spinup_done,npoints,dataread)
use DRIVER_DATATYPES!, only : ireals, iintegers
......@@ -1002,6 +1003,8 @@
character(len=60), intent(out) :: outpath
logical, intent(out) :: dataread
! Local variables
real(kind=ireals), parameter :: day_sec = 24.*60.*60.
real(kind=ireals), parameter :: hour_sec = 60.*60.
......@@ -1045,7 +1048,7 @@
integer(8) :: ti_int_old = -1
integer(kind=iintegers) :: ispin = 1
integer(kind=iintegers) :: i, inpoints, k = 1
integer(kind=iintegers) :: i, inpoints, ireaderr, k = 1
integer(kind=iintegers), allocatable :: nunit(:)
......@@ -1060,7 +1063,7 @@
z0_wind = 0.001
sigma = 5.67e-8
if (firstcallM1) then
if_firstcall : if (firstcallM1) then
allocate (nunit(1:npoints))
! print*, 'The lake is ', dataname
do inpoints = 1, npoints
......@@ -1116,7 +1119,7 @@
do inpoints = 1, npoints
if (N_header_lines>0) then
do i = 1, N_header_lines
read (nunit(inpoints),'(a)', err = 123)
read (nunit(inpoints),'(a)', iostat = ireaderr, err = 123)
enddo
endif
READ(nunit(inpoints),*,err = 123) (workinput(i),i=1,N_coloumns)
......@@ -1127,6 +1130,7 @@
read(workinput(N_Vspeed),*) va_old(inpoints)
read(workinput(N_Pres), *) pa_old(inpoints)
read(workinput(N_Hum), *) qa_old(inpoints)
dataread = .true.
! Optional variables
xx = EXMISS(N_LWdown)
SensFlux_old(inpoints) = EXMISS(N_SensFlux)
......@@ -1162,7 +1166,7 @@
firstcallM1=.false.
endif
endif if_firstcall
if (spinup_period > 0.) then
if (int(time/spinup_period) >= ispin .and. &
......@@ -1202,7 +1206,7 @@
read (nunit(inpoints),'(a)', err = 123)
enddo
endif
read(nunit(inpoints),*, err = 123) (workinput(i),i=1,N_coloumns)
read(nunit(inpoints),*, iostat = ireaderr, err = 123) (workinput(i),i=1,N_coloumns)
read(workinput(N_SWdown),*) solar_radf(inpoints)
read(workinput(N_Precip),*) precipf(inpoints)
read(workinput(N_Temp), *) taf(inpoints)
......@@ -1210,6 +1214,7 @@
read(workinput(N_Vspeed),*) vaf(inpoints)
read(workinput(N_Pres), *) paf(inpoints)
read(workinput(N_Hum), *) qaf(inpoints)
dataread = .true.
! Optional variables
xx = EXMISS(N_LWdown)
SensFluxf(inpoints) = EXMISS(N_SensFlux)
......@@ -1279,10 +1284,14 @@
RETURN
123 write(*,*) 'An error while reading ASCII forcing file: &
&The form is ', form
write(*,*) 'STOP'
STOP
123 if (ireaderr == -1) then
write(*,*) 'End of atmospheric forcing ASCII file encountered'
else
write(*,*) 'An error while reading ASCII forcing file. &
& iostat = ', ireaderr
endif
!write(*,*) 'STOP'
!STOP
contains
......
......@@ -132,7 +132,7 @@ SUBROUTINE LAKE &
& Tm, alphax, alphay, a_veg, c_veg, h_veg, area_lake, cellipt, depth_area, &
& tsw,hw1,xlew1,cdmw1,surfrad1,cloud1,ftot,h2_out, &
& ix,iy,nx,ny,ndatamax,year,month,day,hour,init_T,flag_assim,flag_print, &
& outpath1,spinup_done)
& outpath1,spinup_done,dataread)
!MAIN SUBROUTINE OF THE MODEL
!Calculates all the parameters of state of a lake (temperature, currents,
......@@ -338,6 +338,7 @@ character(len=60), intent(in) :: outpath1
logical, intent(in) :: flag_assim
logical, intent(in) :: flag_print
logical, intent(in) :: spinup_done
logical, intent(in) :: dataread
!Output variables
!Reals
......@@ -490,6 +491,12 @@ if (calibrate_parameter) then
calibr_par2 = calibr_par_min(2) + (j-1)*step_calibr(2)
endif
!Checking if forcing data is read
if ( (.not.dataread) .and. PBLpar%par /= 0) then
write(*,*) 'Atmospheric forcing is not available while PBLpar /= 0: STOP'
STOP
endif
tempair = tempair1 - Kelvin0
humair = humair1
pressure = pressure1
......
......@@ -21,7 +21,7 @@ nplot = input("Choose a variable to plot \n \
13 - methane measured \n \
14 - carbon dioxide measured \n ")
path = '../results/BolshoiVilui2015_dynpgrad1/time_series/' # path to files
path = '../results/BolshoiVilui2015_dynpgrad2/time_series/' # path to files
pathobs = os.path.expanduser('~/Files/main/observdata/Kuivajarvi/')
exp = 'base'
......
......@@ -415,7 +415,7 @@ def plot_timeser(plotid,nvar,legendcommon) :
nheader = 19 #Number of lines in the header
ncols = 19 #Total number of columns
ncol = [7,8,11,12] #The number of columns in the file to display
legend = ['ML E thickness','ML W thickness','ML S thickness','ML N thickness']
legend = ['ML E thickness','ML W thickness','Lower layer E thickness','Lower layer W thickness']
labelx = 'Time, minutes'
labely = 'Thickness, m'
ctime = 5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment