Problem with reading the namelists in case of grb1 input, but ncdf output – in #10: INT2LM

in #10: INT2LM

<p> I encountered a problem with int2lm2.0_clm4 when reading grb1 input ( <span class="caps"> COSMO </span> -EU-analysis data) <br/> and writing ncdf output (thus compiling with - <span class="caps"> DNETCDF </span> ). </p> <p> The INT2LM crashes with <br/> ERROR *** while reading <span class="caps"> NAMELIST </span> Group /DATA/ *** </p> <p> After a few tests, I found that this only happens when compiling with -DNETCDF <br/> and using grb1 input and ncdf output. It seems to be related to <br/> lines 4208 ff. in src_namelist.f90: </p> <p> !_br 28.01.15 Bug #56 RedC / Trailing slash #ifdef NETCDF ! to prevent an often error from users read dimension lengths from data file ierrstat = nc_get_dimlen( <acronym title="ylmext_cat"> <span class="caps"> TRIM </span> </acronym> //’/’// <acronym title="ylmext_lfn"> <span class="caps"> TRIM </span> </acronym> , ‘rlon’, ie_ext, yerrmsg) ierrstat = nc_get_dimlen( <acronym title="ylmext_cat"> <span class="caps"> TRIM </span> </acronym> //’/’// <acronym title="ylmext_lfn"> <span class="caps"> TRIM </span> </acronym> , ‘rlat’, je_ext, yerrmsg) #endif <br/> !_br 28.01.15 end </p> <p> because then INT2LM tries to read ncdf input data, which of course fails. <br/> (see line 12 in the logfile: “yerrmsg: Error in nc_get_dimlen / nf90_open — NetCDF: Unknown file format”) </p> <p> Is there a workaround or are there maybe also other reasons that mixed types in input/output is not advisable? Thanks. </p>

  @susannebrienen in #033f871

<p> I encountered a problem with int2lm2.0_clm4 when reading grb1 input ( <span class="caps"> COSMO </span> -EU-analysis data) <br/> and writing ncdf output (thus compiling with - <span class="caps"> DNETCDF </span> ). </p> <p> The INT2LM crashes with <br/> ERROR *** while reading <span class="caps"> NAMELIST </span> Group /DATA/ *** </p> <p> After a few tests, I found that this only happens when compiling with -DNETCDF <br/> and using grb1 input and ncdf output. It seems to be related to <br/> lines 4208 ff. in src_namelist.f90: </p> <p> !_br 28.01.15 Bug #56 RedC / Trailing slash #ifdef NETCDF ! to prevent an often error from users read dimension lengths from data file ierrstat = nc_get_dimlen( <acronym title="ylmext_cat"> <span class="caps"> TRIM </span> </acronym> //’/’// <acronym title="ylmext_lfn"> <span class="caps"> TRIM </span> </acronym> , ‘rlon’, ie_ext, yerrmsg) ierrstat = nc_get_dimlen( <acronym title="ylmext_cat"> <span class="caps"> TRIM </span> </acronym> //’/’// <acronym title="ylmext_lfn"> <span class="caps"> TRIM </span> </acronym> , ‘rlat’, je_ext, yerrmsg) #endif <br/> !_br 28.01.15 end </p> <p> because then INT2LM tries to read ncdf input data, which of course fails. <br/> (see line 12 in the logfile: “yerrmsg: Error in nc_get_dimlen / nf90_open — NetCDF: Unknown file format”) </p> <p> Is there a workaround or are there maybe also other reasons that mixed types in input/output is not advisable? Thanks. </p>

Problem with reading the namelists in case of grb1 input, but ncdf output

I encountered a problem with int2lm2.0_clm4 when reading grb1 input ( COSMO -EU-analysis data)
and writing ncdf output (thus compiling with - DNETCDF ).

The INT2LM crashes with
ERROR *** while reading NAMELIST Group /DATA/ ***

After a few tests, I found that this only happens when compiling with -DNETCDF
and using grb1 input and ncdf output. It seems to be related to
lines 4208 ff. in src_namelist.f90:

!_br 28.01.15 Bug #56 RedC / Trailing slash #ifdef NETCDF ! to prevent an often error from users read dimension lengths from data file ierrstat = nc_get_dimlen( TRIM //’/’// TRIM , ‘rlon’, ie_ext, yerrmsg) ierrstat = nc_get_dimlen( TRIM //’/’// TRIM , ‘rlat’, je_ext, yerrmsg) #endif
!_br 28.01.15 end

because then INT2LM tries to read ncdf input data, which of course fails.
(see line 12 in the logfile: “yerrmsg: Error in nc_get_dimlen / nf90_open — NetCDF: Unknown file format”)

Is there a workaround or are there maybe also other reasons that mixed types in input/output is not advisable? Thanks.

View in channel
<p> May be the IF clause below can fix this. If so, it should be introduced in the next INT2LM version. </p> <p> <pre> #ifdef NETCDF IF (<acronym title="ylmext_form_read"><span class="caps">TRIM</span></acronym> == ‘ncdf’) THEN ! to prevent an often error from users read dimension lengths from data file ierrstat = nc_get_dimlen(<acronym title="ylmext_cat"><span class="caps">TRIM</span></acronym>//’/’//<acronym title="ylmext_lfn"><span class="caps">TRIM</span></acronym>, ‘rlon’, ie_ext, yerrmsg) ierrstat = nc_get_dimlen(<acronym title="ylmext_cat"><span class="caps">TRIM</span></acronym>//’/’//<acronym title="ylmext_lfn"><span class="caps">TRIM</span></acronym>, ‘rlat’, je_ext, yerrmsg) ENDIF #endif</pre> </p> <p> </p>

  @burkhardtrockel in #2add0b4

<p> May be the IF clause below can fix this. If so, it should be introduced in the next INT2LM version. </p> <p> <pre> #ifdef NETCDF IF (<acronym title="ylmext_form_read"><span class="caps">TRIM</span></acronym> == ‘ncdf’) THEN ! to prevent an often error from users read dimension lengths from data file ierrstat = nc_get_dimlen(<acronym title="ylmext_cat"><span class="caps">TRIM</span></acronym>//’/’//<acronym title="ylmext_lfn"><span class="caps">TRIM</span></acronym>, ‘rlon’, ie_ext, yerrmsg) ierrstat = nc_get_dimlen(<acronym title="ylmext_cat"><span class="caps">TRIM</span></acronym>//’/’//<acronym title="ylmext_lfn"><span class="caps">TRIM</span></acronym>, ‘rlat’, je_ext, yerrmsg) ENDIF #endif</pre> </p> <p> </p>

May be the IF clause below can fix this. If so, it should be introduced in the next INT2LM version.

#ifdef NETCDF
  IF (TRIM == ‘ncdf’)  THEN
   ! to prevent an often error from users read dimension lengths from data file
   ierrstat = nc_get_dimlen(TRIM//’/’//TRIM, ‘rlon’, ie_ext, yerrmsg)
   ierrstat = nc_get_dimlen(TRIM//’/’//TRIM, ‘rlat’, je_ext, yerrmsg)
  ENDIF
#endif

<p> There was a closing brace missing in the listing in my last post. <br/> It should be hopefully correct now. </p>

  @burkhardtrockel in #86eaaef

<p> There was a closing brace missing in the listing in my last post. <br/> It should be hopefully correct now. </p>

There was a closing brace missing in the listing in my last post.
It should be hopefully correct now.

<p> Yes, this works. Thanks !!! </p>

  @susannebrienen in #26298b3

<p> Yes, this works. Thanks !!! </p>

Yes, this works. Thanks !!!