diff --git a/code/src/hd_driver.f90 b/code/src/hd_driver.f90 index 25d0876cddf52a63af5fec57cc8d1f0f2440add5..0f62ac689b8773d9d7a2deb987f49e85c57bfbd4 100644 --- a/code/src/hd_driver.f90 +++ b/code/src/hd_driver.f90 @@ -362,7 +362,7 @@ write(nout,*) 'OTBhd_init_io' IF (step == istep+nstep) THEN CALL hydrology_restart ELSE IF (step == istep+nstep_rest) THEN - CALL hydrology_restart(nstep_rest) + CALL hydrology_restart(date_rest, time_rest) ENDIF ! update model time step diff --git a/code/src/mo_hydrology.f90 b/code/src/mo_hydrology.f90 index 2d28d84000ff454c1aad3b2e6f35398c0e3971c3..4e88b880f250b7c7ab2e31082127e6a1f94948ff 100644 --- a/code/src/mo_hydrology.f90 +++ b/code/src/mo_hydrology.f90 @@ -57,7 +57,7 @@ MODULE mo_hydrology delta_time, ev_puthd, get_interval_seconds, & io_time_event, & initial_date, start_date, out_convert_date, inp_convert_date, & - current_date + current_date, cdate2ymd, ctime2hms USE mo_array_utils, ONLY: dec_monotonic_closest_midpoint, & inc_monotonic_closest_midpoint USE mo_coupling, ONLY: set_grid_dimensions, set_local_partition, & @@ -576,7 +576,7 @@ CONTAINS END SUBROUTINE read_hydrology - SUBROUTINE hydrology_restart(nstep_rest) + SUBROUTINE hydrology_restart(date_rest, time_rest) ! ! **** Routine that writes the restart file for the HD model @@ -610,7 +610,8 @@ CONTAINS ! finfl = Inflow data array for each gridbox for time step nstep ! - INTEGER, OPTIONAL :: nstep_rest ! Number of time steps until dedicated restart file writing + CHARACTER(LEN=*), OPTIONAL :: date_rest ! Date of dedicated restart file writing + CHARACTER(LEN=*), OPTIONAL :: time_rest ! Time of dedicated restart file writing TYPE (FILE_INFO) :: restartfile @@ -630,8 +631,9 @@ CONTAINS ALLOCATE(lons(grid_hd%nlon)) ALLOCATE(lats(grid_hd%nlat)) - IF (PRESENT(nstep_rest)) THEN - CALL out_convert_date (current_date, yyyymmdd, hhmmss) + IF (PRESENT(date_rest)) THEN + CALL cdate2ymd(date_rest, yyyymmdd) + CALL ctime2hms(time_rest, hhmmss) WRITE(cymd, '(I8.8)') yyyymmdd WRITE(chms, '(I6.6)') hhmmss fname = 'hdrestart_' // cymd // '_' // chms // '.nc' @@ -655,9 +657,15 @@ CONTAINS CALL IO_put_att_int (fileID, NF_GLOBAL, 'riverflow_timestep', riverflow_timestep) CALL out_convert_date (initial_date, yyyymmdd, hhmmss) CALL IO_put_att_int (fileID, NF_GLOBAL, 'initial_date', yyyymmdd) - CALL out_convert_date (current_date, yyyymmdd, hhmmss) - CALL IO_put_att_int (fileID, NF_GLOBAL, 'current_date', yyyymmdd) - CALL IO_put_att_int (fileID, NF_GLOBAL, 'current_time', hhmmss) + IF (PRESENT(date_rest)) THEN + CALL IO_put_att_text (fileID, NF_GLOBAL, 'restart_date', date_rest) + CALL IO_put_att_text (fileID, NF_GLOBAL, 'restart_time', time_rest) + ELSE + CALL out_convert_date (current_date, yyyymmdd, hhmmss) + CALL IO_put_att_int (fileID, NF_GLOBAL, 'current_date', yyyymmdd) + WRITE(chms, '(I6.6)') hhmmss + CALL IO_put_att_text (fileID, NF_GLOBAL, 'current_time', chms) + ENDIF CALL IO_def_dim (fileID, 'lon', grid_hd%nlon, xdimid) CALL IO_def_dim (fileID, 'lat', grid_hd%nlat, ydimid) @@ -743,7 +751,7 @@ CONTAINS ! close output streams only for final restart writing - IF (.NOT. PRESENT(nstep_rest)) THEN + IF (.NOT. PRESENT(date_rest)) THEN IF (nhd_diag > 0) CALL hd_close_timeseries IF (lhd_highres) CALL hd_highres_close(highres_file_id) ENDIF diff --git a/docu/namelist_settings.md b/docu/namelist_settings.md index 871507da19f72b2a5cf5cf74670e5fb04e669ebc..2e76a52c252a709c43d2deab48fd0cd99571dbe5 100644 --- a/docu/namelist_settings.md +++ b/docu/namelist_settings.md @@ -25,12 +25,18 @@ The namelists have to be written by the HD run script into the HD run directory. out_expname CHARACTER experiment name, Default: 'hd' out_datapath CHARACTER path to where the output data shall be written, Default: './' +Time Control year1 INTEGER initial year of the run, Default: 1900 month1 INTEGER initial month of the run, Default: 1 date_start CHARACTER start date of the run, format YYYYMMDD or YYYY-MM-DD date_end CHARACTER end date of the run, format YYYYMMDD or YYYY-MM-DD nstep INTEGER number of time steps within the run (Def. 365) if date_start & date_end are not provided delta_time REAL(dp) model time step length in seconds, Default: 86400. + time_start CHARACTER Start time of the run, format HHMMSS or HH:MM:SS (Def.: none) + time_end CHARACTER End of the run: Begin time of final time step, HHMMSS or HH:MM:SS (Def.: none) + date_rest CHARACTER Date of the first restart file writing, format YYYYMMDD or YYYY-MM-DD (Def.: none) + time_rest CHARACTER Time of the first restart file writing, format HHMMSS or HH:MM:SS (Def.: none) + ufakru REAL(dp) unit factor for runoff and drainage input data so that their unit becomes [m/s], Default: 1. runoff_file CHARACTER file with input runoff data if stand alone run, Default: "runoff.nc" drainage_file CHARACTER file with input drainage data if stand alone run, Default: "drainage.nc" diff --git a/scr/hd_subdaily_settings.ksh b/scr/hd_subdaily_settings.ksh index 49e583bb0af6311adafb7088689f3839f42cc4e1..300034c1f5bff1e2c84fb0b649bc521d2e4555a0 100644 --- a/scr/hd_subdaily_settings.ksh +++ b/scr/hd_subdaily_settings.ksh @@ -14,8 +14,8 @@ echo " ***** HD subdaily settings *****" # # Start and end dates/times (Note that time 24:00:00 is not allowed) -date_start=${YYYY}0707 ; date_end=${YYYY}0708 -time_start="00:00:00" ; time_end="23:30:00" +date_start=${YYYY}0707 ; date_end=${YYYY}0707 +time_start="00:00:00" ; time_end="04:00:00" # time_end is starting time of final time step xd="$date_start" MM=${xd:4:2} ; YYYY=${xd:0:4} echo " Startdate: $date_start time: $time_start Enddate: $date_end time: $time_end" @@ -28,6 +28,6 @@ if (( $ndt_set > 0 )) ; then fi # # Write an additional retart file -date_rest=${YYYY}0708 -time_rest="00:00:00" +date_rest=${YYYY}0707 +time_rest="03:00:00" # diff --git a/scr/run_hdmodel.ksh b/scr/run_hdmodel.ksh index d9e4963bc714e0785608b8389e4a3d4f4f33b94d..d60ff6ae19cdf92e27e4551095ded7cc24a11a5e 100755 --- a/scr/run_hdmodel.ksh +++ b/scr/run_hdmodel.ksh @@ -213,6 +213,19 @@ fi NFF=0 # stepwise forcing" if (( ${IWORK} == 5 )) ; then cdo seldate,$date_start,$date_end hdforcing.nc hdfsel.nc +# for testing only { +## cdo settime,0:00:00 -seldate,$date_start hdfsel.nc infile.nc +## cp -p infile.nc infile_cat.nc +## for i in $(seq 1 47) ; do +## let "nmin = ${i} * 30" +## shift="${nmin}min" +## cdo -shifttime,${shift} infile.nc next_year.nc +## cdo -cat infile_cat.nc next_year.nc tmp.nc +## mv tmp.nc infile_cat.nc +## done +## ndt_day=48 +## mv infile_cat.nc hdfsel.nc +# } if (( ${ndt_set} > 0 )) && (( ${ndt_set} != ${ndt_day} )) ; then if (( ${ndt_day} == 1 )) ; then NFF=1 # daily forcing"