Skip to content
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

bug: obs_diag_streamflow #334

Open
hkershaw-brown opened this issue Mar 7, 2022 · 0 comments
Open

bug: obs_diag_streamflow #334

hkershaw-brown opened this issue Mar 7, 2022 · 0 comments
Labels
Bug Something isn't working obs_diag

Comments

@hkershaw-brown
Copy link
Member

🐛 🐛 🐨

Describe the bug

  1. Run obs_diag with wrf_hyrdo obs_seq.finals with SNOW_THICKNESS
  2. What was the expected outcome? Successful run of obs_diag
  3. What actually happened?
    Errors out with message about NC_UNLIMITED size already in use.

Error Message

 ERROR FROM:
  source : netcdf_utilities_mod.f90
  routine: WriteNetCDF
  message: types:def_dim obs_diag_output.nc: NetCDF: NC_UNLIMITED size already i
 n use
  message: ...

Which model(s) are you working with?

wrf_hydro

Version of DART

Which version of DART are you using?
Reported with v9.9.0-637-g654607621
Reproduced with v9.13.2

Have you modified the DART code?

Yes - v9.9.0-637-g654607621 has the fix for bug: #323
v9.13.2 nope.

Build information

Please describe:

  1. Cheyenne
  2. intel

Suspected cause

The error is happening because streamflow_obs_diag.f90 has a local max_defined_types that is undefined

86 integer :: max_defined_types_of_obs

There is

 550     max_defined_types_of_obs = lookup_flavor(flavor)

but this is in an if statement that is not entered.

So when you get to the netcdf writing:

max_defined_types_of_obs           0 NF90_UNLIMITED           0

so for this line:

call nc_check(nf90_def_dim(ncid=ncid, &
          name='obstypes', len=max_defined_types_of_obs, dimid=TypesDimID), &
          'WriteNetCDF', 'types:def_dim '//trim(fname))

Netcdf thinks you are defining the unlimited dimension again.

The 3D sphere obs_diag obs_kind_mod::max_defined_types_of_obs. I'm not sure at the moment why streamflow_obs_diag has a local max_defined_types_of_obs

"! All streamflow observations are identity observations at this point" is not true right?

         ! Check to see if it is an identity observation.
-         ! All streamflow observations are identity observations at this point
         if (flavor < 0) then

            ! Not every model location has a streamflow observation, but the
            ! location can be anywhere in the model state, so the 'flavor' can
            ! be quite large. We cannot allocate that much space, so we create
            ! a lookup array  ....

-           max_defined_types_of_obs = lookup_flavor(flavor)  !HK max_defined_types_of_obs  is unset for real obs.

            if (flavor > num_obs_types) then
               write(string1,*)'unsupported identity observation ',-1*flavor
               write(string2,*)'Increase "num_obs_types" and recompile.'
               call error_handler(E_ERR, 'obs_diag', string1, source, text2=string2)
            endif

            obsname = 'STREAM_FLOW'
            Nidentity = Nidentity + 1
         endif
@hkershaw-brown hkershaw-brown added the Bug Something isn't working label Mar 7, 2022
@hkershaw-brown hkershaw-brown self-assigned this Mar 7, 2022
hkershaw-brown added a commit that referenced this issue Mar 17, 2022
@hkershaw-brown hkershaw-brown added the build-system issues related to building dart label Apr 13, 2022
@hkershaw-brown hkershaw-brown removed the build-system issues related to building dart label Jun 10, 2022
@hkershaw-brown hkershaw-brown removed their assignment Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working obs_diag
Projects
None yet
Development

No branches or pull requests

1 participant