-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to NORTRIP_multiroad code #1
base: master
Are you sure you want to change the base?
Conversation
- 🐛 corrected longwave/shortwave mixup in definitions - 🐛 Corrected index error when saving forecast meteorology - 🚧 Added function to relax meteorological values when swiching from observed to forecasted input
Read observations from netcdf, write netcdf files, modifications for shorter timesteps
integer :: replace_which_meteo_with_obs_input(num_replace_meteo_with_obs_input)=0 | ||
integer :: replace_which_meteo_with_obs(num_var_meteo)=0 | ||
integer, allocatable :: save_meteo_index(:) | ||
logical :: read_obs_from_netcdf = .True. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this instead be deduced from the file extension of the input?
NORTRIP_multiroad_find_init_file.f90
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flag determining if we want .nc or .txt files is not available at this time of the simulation. Should there be an option in the config file (which is available at this point) telling what kind of init files we want to look for? Or should it be “if .nc available, use this, elseif .txt is available use that, otherwise “no init found”?
if (n_hours_input.lt.1) then | ||
!n_hours_input=n_hours_default | ||
write(unit_logfile,'(A)') ' ERROR: Number of hours is 0 or less. Stopping' | ||
STOP 5 | ||
endif | ||
write(unit_logfile,'(A,4I5)') ' Number of hours: ', n_hours_input | ||
write(unit_logfile,'(A,4I5)') ' Number of timesteps: ', n_hours_input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the time step is different than 1 hour, the variable "n_hours_input" is treated as "number of time steps". Do we need one variable that is actually "number of hours", and another that is "number of timesteps"? Or is it ok to only have a "number of timesteps" variable. If so, the "n_hours_input" should be renamed?
@@ -296,7 +304,11 @@ subroutine read_NORTRIP_multiroad_pathnames | |||
DIFUTC_H=match_string_val('Time difference site',unit_in,unit_logfile,0.0) | |||
DIFUTC_H_traffic=match_string_val('Time difference traffic',unit_in,unit_logfile,0.0) | |||
missing_data=match_string_val('Missing data value',unit_in,unit_logfile,-999.) | |||
timesteps_in_hour=match_string_int('Number of timesteps within one hour',unit_in,unit_logfile,1) | |||
timestep = 1./timesteps_in_hour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure of the definition of "timestep" here is ok?
@@ -866,7 +874,11 @@ subroutine NORTRIP_multiroad_read_receptor_data | |||
else | |||
read(unit_in,*,ERR=19) name_receptor(k,1),lon_receptor(k),lat_receptor(k)!,h_receptor(k),name_receptor(k,2) | |||
h_receptor(k)=0 !0 height | |||
type_receptor(k)=1 !AQ type | |||
if ( calculation_type == "Avinor" ) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to discuss the definition of "type_receptor" based on "calculation_type", we once talked about having different receptor types for one simulation?
NORTRIP_read_t2m500yr_netcdf4.f90
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The still relevant parts of this file is in the renamed file NORTRIP_read_analysismeteo_netcdf4.f90
meteo_nc_timesteps = nint(1 + (dim_length_nc(time_index)-1)/timestep) !Number of time steps that will be saved from the meteo file. (If timestep = 1h this will just be the number of hours) | ||
|
||
!Fill a date_nc array that is used to match meteo dates to the date range specified in the simulation call. | ||
allocate(date_nc(num_date_index,meteo_nc_timesteps)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the filling of date_nc from NORTRIP_multiroad_save_meteodata.f90 to here. I'm sure I had a good reason for doing that related to the shorter timesteps, but I cannot right now remember why. Could it cause problems, or is it ok to leave it here?
… if timestep is hourly.
…orr, interpolate Nordic_analysis
These changes relates to the same additions that is mentioned in PR metno/NORTRIP#1.
I'll add comments to specific lines in this pull request where I would like some input before doing a final merge.