Skip to content

Commit 1d3b97f

Browse files
committed
read in the same order of variables as they are defined
1 parent e33c2f5 commit 1d3b97f

File tree

1 file changed

+49
-43
lines changed

1 file changed

+49
-43
lines changed

src/cases/header_inq_F_case.cpp

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -308,21 +308,30 @@ int e3sm_io_case::inq_F_case(e3sm_io_config &cfg,
308308
*/
309309
varp = vars + nvars_decomp - 1;
310310

311-
/* below 10 are fixed-size climate variables ---------------------------*/
311+
/* below 5 are fixed-size climate variables ----------------------------*/
312312

313-
/* double lat(ncol) */
314-
INQ_VAR("lat", NC_DOUBLE, 1, &dim_ncol, MPI_DOUBLE, 1)
313+
/* int ndbase */
314+
INQ_VAR("ndbase", NC_INT, 0, NULL, MPI_INT, -1)
315315
GET_ATTR_TXT("long_name", txtBuf)
316-
GET_ATTR_TXT("units", txtBuf)
317316

318-
/* double lon(ncol) */
319-
INQ_VAR("lon", NC_DOUBLE, 1, &dim_ncol, MPI_DOUBLE, 1)
317+
/* int nsbase */
318+
INQ_VAR("nsbase", NC_INT, 0, NULL, MPI_INT, -1)
320319
GET_ATTR_TXT("long_name", txtBuf)
321-
GET_ATTR_TXT("units", txtBuf)
322320

323-
/* double area(ncol) */
324-
INQ_VAR("area", NC_DOUBLE, 1, &dim_ncol, MPI_DOUBLE, 0)
321+
/* int nbdate */
322+
INQ_VAR("nbdate", NC_INT, 0, NULL, MPI_INT, -1)
323+
GET_ATTR_TXT("long_name", txtBuf)
324+
325+
/* int nbsec */
326+
INQ_VAR("nbsec", NC_INT, 0, NULL, MPI_INT, -1)
327+
GET_ATTR_TXT("long_name", txtBuf)
328+
329+
/* int mdt */
330+
INQ_VAR("mdt", NC_INT, 0, NULL, MPI_INT, -1)
325331
GET_ATTR_TXT("long_name", txtBuf)
332+
GET_ATTR_TXT("units", txtBuf)
333+
334+
/* below 7 are fixed-size not-partitioned variables of type double -----*/
326335

327336
/* double lev(lev) */
328337
INQ_VAR("lev", NC_DOUBLE, 1, &dim_lev, MPI_DOUBLE, -1)
@@ -361,28 +370,23 @@ int e3sm_io_case::inq_F_case(e3sm_io_config &cfg,
361370
INQ_VAR("hybi", NC_DOUBLE, 1, &dim_ilev, MPI_DOUBLE, -1)
362371
GET_ATTR_TXT("long_name", txtBuf)
363372

364-
/* below 6 are record climate variables --------------------------------*/
373+
/* below 3 are fixed-size partitioned variables of type double ------------*/
365374

366-
/* double time(time) */
367-
INQ_VAR("time", NC_DOUBLE, 1, &dim_time, MPI_DOUBLE, -1)
375+
/* double lat(ncol) */
376+
INQ_VAR("lat", NC_DOUBLE, 1, &dim_ncol, MPI_DOUBLE, 1)
368377
GET_ATTR_TXT("long_name", txtBuf)
369378
GET_ATTR_TXT("units", txtBuf)
370-
GET_ATTR_TXT("calendar", txtBuf)
371-
GET_ATTR_TXT("bounds", txtBuf)
372379

373-
/* int date(time) */
374-
INQ_VAR("date", NC_INT, 1, &dim_time, MPI_INT, -1)
380+
/* double lon(ncol) */
381+
INQ_VAR("lon", NC_DOUBLE, 1, &dim_ncol, MPI_DOUBLE, 1)
375382
GET_ATTR_TXT("long_name", txtBuf)
383+
GET_ATTR_TXT("units", txtBuf)
376384

377-
/* int datesec(time) */
378-
INQ_VAR("datesec", NC_INT, 1, &dim_time, MPI_INT, -1)
385+
/* double area(ncol) */
386+
INQ_VAR("area", NC_DOUBLE, 1, &dim_ncol, MPI_DOUBLE, 0)
379387
GET_ATTR_TXT("long_name", txtBuf)
380388

381-
/* double time_bnds(time, nbnd) */
382-
dimids[0] = dim_time;
383-
dimids[1] = dim_nbnd;
384-
INQ_VAR("time_bnds", NC_DOUBLE, 2, dimids, MPI_DOUBLE, -1)
385-
GET_ATTR_TXT("long_name", txtBuf)
389+
/* below 2 are record climate variables of type char -------------------*/
386390

387391
/* char date_written(time, chars) */
388392
dimids[0] = dim_time;
@@ -394,37 +398,41 @@ int e3sm_io_case::inq_F_case(e3sm_io_config &cfg,
394398
dimids[1] = dim_chars;
395399
INQ_VAR("time_written", NC_CHAR, 2, dimids, MPI_CHAR, -1)
396400

397-
/* below 5 are fixed-size climate variables ----------------------------*/
401+
/* below 5 are record climate variables of type int -------------------*/
398402

399-
/* int ndbase */
400-
INQ_VAR("ndbase", NC_INT, 0, NULL, MPI_INT, -1)
403+
/* int date(time) */
404+
INQ_VAR("date", NC_INT, 1, &dim_time, MPI_INT, -1)
401405
GET_ATTR_TXT("long_name", txtBuf)
402406

403-
/* int nsbase */
404-
INQ_VAR("nsbase", NC_INT, 0, NULL, MPI_INT, -1)
407+
/* int datesec(time) */
408+
INQ_VAR("datesec", NC_INT, 1, &dim_time, MPI_INT, -1)
405409
GET_ATTR_TXT("long_name", txtBuf)
406410

407-
/* int nbdate */
408-
INQ_VAR("nbdate", NC_INT, 0, NULL, MPI_INT, -1)
411+
/* int ndcur(time) */
412+
INQ_VAR("ndcur", NC_INT, 1, &dim_time, MPI_INT, -1)
409413
GET_ATTR_TXT("long_name", txtBuf)
410414

411-
/* int nbsec */
412-
INQ_VAR("nbsec", NC_INT, 0, NULL, MPI_INT, -1)
415+
/* int nscur(time) */
416+
INQ_VAR("nscur", NC_INT, 1, &dim_time, MPI_INT, -1)
413417
GET_ATTR_TXT("long_name", txtBuf)
414418

415-
/* int mdt */
416-
INQ_VAR("mdt", NC_INT, 0, NULL, MPI_INT, -1)
419+
/* int nsteph(time) */
420+
INQ_VAR("nsteph", NC_INT, 1, &dim_time, MPI_INT, -1)
417421
GET_ATTR_TXT("long_name", txtBuf)
418-
GET_ATTR_TXT("units", txtBuf)
419422

420-
/* below 393 are record climate variables ------------------------------*/
423+
/* below 8 are record climate variables of type double ---------------*/
421424

422-
/* int ndcur(time) */
423-
INQ_VAR("ndcur", NC_INT, 1, &dim_time, MPI_INT, -1)
425+
/* double time(time) */
426+
INQ_VAR("time", NC_DOUBLE, 1, &dim_time, MPI_DOUBLE, -1)
424427
GET_ATTR_TXT("long_name", txtBuf)
428+
GET_ATTR_TXT("units", txtBuf)
429+
GET_ATTR_TXT("calendar", txtBuf)
430+
GET_ATTR_TXT("bounds", txtBuf)
425431

426-
/* int nscur(time) */
427-
INQ_VAR("nscur", NC_INT, 1, &dim_time, MPI_INT, -1)
432+
/* double time_bnds(time, nbnd) */
433+
dimids[0] = dim_time;
434+
dimids[1] = dim_nbnd;
435+
INQ_VAR("time_bnds", NC_DOUBLE, 2, dimids, MPI_DOUBLE, -1)
428436
GET_ATTR_TXT("long_name", txtBuf)
429437

430438
/* double co2vmr(time) */
@@ -452,9 +460,7 @@ int e3sm_io_case::inq_F_case(e3sm_io_config &cfg,
452460
GET_ATTR_TXT("long_name", txtBuf)
453461
GET_ATTR_TXT("units", txtBuf)
454462

455-
/* int nsteph(time) */
456-
INQ_VAR("nsteph", NC_INT, 1, &dim_time, MPI_INT, -1)
457-
GET_ATTR_TXT("long_name", txtBuf)
463+
/* below 384 are record climate variables of type float ----------------*/
458464

459465
if (cfg.hist == h0) {
460466
/* float AEROD_v(time, ncol) */

0 commit comments

Comments
 (0)