-
Notifications
You must be signed in to change notification settings - Fork 0
fix crash when debugging #173
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5979,10 +5979,10 @@ subroutine read_obs_MODIS_SCF( & | |
|
|
||
| N_lat = last_ind(1) - start_ind(1) + 1 | ||
|
|
||
| start_ind = (lon_min_vec - CMG_ll_lon)/CMG_dlon | ||
| last_ind = (lon_max_vec - CMG_ll_lon)/CMG_dlon | ||
| start_ind(1:N_files) = (lon_min_vec(1:N_files) - CMG_ll_lon)/CMG_dlon | ||
| last_ind(1:N_files) = (lon_max_vec(1:N_files) - CMG_ll_lon)/CMG_dlon | ||
|
|
||
| N_lon_vec = last_ind - start_ind + 1 | ||
| N_lon_vec(1:N_files) = last_ind(1:N_files) - start_ind(1:N_files) + 1 | ||
|
|
||
| N_lon = sum( N_lon_vec(1:N_files) ) | ||
|
|
||
|
|
@@ -9752,7 +9752,11 @@ subroutine scale_obs_tskin_zscore( N_catd, tile_coord, & | |
| ! check for no-data-values in observation and fit parameters | ||
| ! (any negative number could be no-data-value for observations) | ||
|
|
||
| if ( sclprm_mean_obs(ind)>0. .and. & | ||
| if ( sclprm_mean_obs(ind)==sclprm_mean_obs(ind) .and. & | ||
| sclprm_mean_mod(ind)==sclprm_mean_mod(ind) .and. & | ||
| sclprm_std_obs(ind) ==sclprm_std_obs(ind) .and. & | ||
| sclprm_std_mod(ind) ==sclprm_std_mod(ind) .and. & | ||
|
Comment on lines
+9755
to
+9758
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need these four lines, which should always be true? Not sure where they're coming from and what they might be meant to do.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that comparison is for Nan. If Nan == Nan is always .false. . In debugging mode, comparing Nan may lead to crash |
||
| sclprm_mean_obs(ind)>0. .and. & | ||
| sclprm_mean_mod(ind)>0. .and. & | ||
| sclprm_std_obs(ind)>=0. .and. & | ||
| sclprm_std_mod(ind)>=0. ) then | ||
|
|
@@ -9986,7 +9990,11 @@ subroutine scale_obs_sfmc_zscore( N_catd, tile_coord, & | |
| ! Check for no-data-values in observation and fit parameters | ||
| ! (any negative number could be no-data-value for observations) | ||
|
|
||
| if ( sclprm_mean_obs(j_ind, i_ind)>0. .and. & | ||
| if ( sclprm_mean_obs(j_ind, i_ind)==sclprm_mean_obs(j_ind, i_ind) .and. & | ||
| sclprm_mean_mod(j_ind, i_ind)==sclprm_mean_mod(j_ind, i_ind) .and. & | ||
| sclprm_std_obs(j_ind, i_ind) ==sclprm_std_obs(j_ind, i_ind) .and. & | ||
| sclprm_std_mod(j_ind, i_ind) ==sclprm_std_mod(j_ind, i_ind) .and. & | ||
|
Comment on lines
+9993
to
+9996
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| sclprm_mean_obs(j_ind, i_ind)>0. .and. & | ||
| sclprm_mean_mod(j_ind, i_ind)>0. .and. & | ||
| sclprm_std_obs(j_ind, i_ind)>=0. .and. & | ||
| sclprm_std_mod(j_ind, i_ind)>=0. ) then | ||
|
|
@@ -10381,7 +10389,11 @@ subroutine scale_obs_Tb_zscore( N_catd, tile_coord, date_time, this_obs_param, | |
| ! check for no-data-values in observation and fit parameters | ||
| ! (any negative number could be no-data-value for observations) | ||
|
|
||
| if ( sclprm_mean_obs(ind)>0. .and. & | ||
| if ( sclprm_mean_obs(ind)==sclprm_mean_obs(ind) .and. & | ||
| sclprm_mean_mod(ind)==sclprm_mean_mod(ind) .and. & | ||
| sclprm_std_obs( ind)==sclprm_std_obs( ind) .and. & | ||
| sclprm_std_mod( ind)==sclprm_std_mod( ind) .and. & | ||
|
Comment on lines
+10392
to
+10395
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| sclprm_mean_obs(ind)>0. .and. & | ||
| sclprm_mean_mod(ind)>0. .and. & | ||
| sclprm_std_obs( ind)>0. .and. & | ||
| sclprm_std_mod( ind)>0. ) 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.
@weiyuan-jiang : I'm not sure if we need this, and if we do, I'm not sure it's the best fix. First, I'm pretty confident that vegcls and soilcls here should never be no-data. So a better way of addressing this might be to check for (native) no-data-values first and stop if any are encountered.
If I'm wrong and no-data-values for the "integer" fields could happen, we might need to figure out a more robust solution. The current solution depends on "nodata_generic" being -9999. I was hoping that at some point in the future we can use MAPL_UNDEF instead of LDAS having its own nodata-value. But if nodata_generic turns into 1e15, the currently implemented solution won't work, I think.
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 I debugged, I printed the values and I did see 1.0e15. When it is converted to int, it becomes the most negative integer. Here our nondata_generic is -9999.0